承接 wooletthedevsout/product-admin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wooletthedevsout/product-admin

Composer 安装命令:

composer require wooletthedevsout/product-admin

包简介

WLTDO module for product admin and edit implementations.

README 文档

README

To be used either as a standalone module or library, or as part of the WLTDO framework, this module intends to automate and ease the process of customizing WC product edit pages.

Initially, classes will take care of everything as you add new tabs and panels to product meta within the edit pages. Additionally, we are developing classes to manage and alter existent tabs and fields.

Install

The easier way of using this package is by requiring it using Composer.

Usage

In the plugin's main file, use the classes and autoload them with Composer.

use Wooletthedevsout\Product\Admin\{Tabs, Panels};
require __DIR__ . '/vendor/autoload.php';

$tabs = new Tabs('New Tab', $fields);

The class Tabs needs two parameters: the first is the name (not the slug) of the new tab, and the second an array of fields to be added. The array admits any number of fields, each one of them as a new array.

// Once the tab is created, we need to inject the panels dependency, using the method getPanel()

$tabs->getPanel();

// Also, a title can be added if you want so

$tabs->addTitle('The title');

Ok, what about the fields?

Ohh... of course. As shown, the fields and firstly passed to the Tabs instance as an array. For this moment, we cover all field types with native support by Woocommerce: text, number, textarea, checkbox, select, radio (needs a CSS fix, as the WC native function is defective for the product edit area).

So, we need an array of arrays. Each element is a field, and for each of these, the first element will be the field type:

*** [{{FIELD TYPE}}, {{SLUG}}, {{LABEL}}, {{DESCRIPTION}}] ***

For the select type, an additional element (another array) will include the options to be added. The same happens for the radio field, although for this latter we just cut the description, as it generates a lot of bugs within the backend. So, for the SELECT field and the RADIO field, respectivelly, we need to register like this:

*** [{{FIELD TYPE}}, {{SLUG}}, {{LABEL}}, {{DESCRIPTION}}, {{ARRAY OF OPTIONS}}] *** *** [{{FIELD TYPE}}, {{SLUG}}, {{LABEL}}, {{ARRAY OF OPTIONS}}] ***

Thus, imagine that we want two text fields, one checkbox, one select field and one radio, considering the previous code. The array to be passed would look like this:

$forms = [
	[
		'text',
		'user_message', 
		'Cool Label', 
		'Description for the tooltip with question mark.'
	],
	[
		'text', 
		'capacity', 
		'Another Label', 
		'Description for the tooltip with question mark.'
	],
	[
		'checkbox', 
		'confirm', 
		'Confirmation', 
		'Description for the tooltip with question mark.'
	],
	[
		'select', 
		'choices', 
		'Select Title', 
		'Description for the tooltip with question mark.',
		[
			'Choice 1',
			'Choice 2',
			'Choice 3'
		]
	],
	[
		'radio', 
		'choices', 
		'Select Title',
		[
			'Choice 1',
			'Choice 2'
		]
	];

FAQ

Well, this is one of the first libraries and modules for the new Woo Let The Devs Out framework. So I imagine you guys have a lot of questions. Let's try to answer some of them.

Do I need to use hooks or further implementation in order to save the meta of these new fields?

No, the Panels class is already equipped with the methods to do so.

What about validating fields?

Honestly? We are working at... we are not pretty satisfied with WC's native validation, so we should eventually come up with something more sophisticated.

Can we expect new field type (especially those not covered by the WC native API, like datetime, image, etc)?

Definitely, the point with the WLTDO framework is to provide, ultimately, an easy and OO way of extending Woocommerce. Although some implementations and extensions for WC are really well-developed, like those for payment gateways, when developing complex integrations and entire packages, they require us to be really repetitive.

wooletthedevsout/product-admin 适用场景与选型建议

wooletthedevsout/product-admin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 11 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 wooletthedevsout/product-admin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wooletthedevsout/product-admin 我们能提供哪些服务?
定制开发 / 二次开发

基于 wooletthedevsout/product-admin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-15