定制 carloswph/wc-order-status 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

carloswph/wc-order-status

Composer 安装命令:

composer require carloswph/wc-order-status

包简介

WooCommerce comprehensive helper for custom order statuses.

README 文档

README

Adding custom order statuses to the Woocommerce platform could be definitely easier - and I am not talking about installing yet another plugin for dealing with silly tasks. This helper aims to automate and incept some intelligence to the way developers and web designers add, manage, style and even link behaviours and reactions to the custom statuses created.

First and foremost, we established a class to make the painful routine of adding custom statuses a single line of code.

Installation

No additional plugins, please. This library can be installed using Composer or, if you prefer, just download the main class OrderStatus and add to your project.

Usage

By definition, for adding a new status to WC orders we first need to register such status in Wordpress, and then include the newly added status to the pool where order statuses are saved within Woocommerce. So... why not doing that at once, instead of successive functions and hooks? So let's see how to simply add new statuses:

use WPH\WC\OrderStatus;
// Composer autoload
require __DIR__ . '/vendor/autoload.php';

/**
 * Follow the format:
 * new OrderStatus(*STATUS_NAME*, array(*BACKGROUND_COLOR*, *FONT_COLOR*));
 * And that's it.
 */
new OrderStatus('Custom Status', array('orange', '#ededed'));

Obs: any CSS predefined color name and HEX color will work, but also any other format accepted in CSS (rgb, rgba, hsl, hsla).

Todo

We are planning some new features shortly. With new statuses, sometimes we face the need of trigger or hook functions or actions to them. So it makes sense to generate a controller class where you can encapsulate any kind of desired behavior. Also, we expect to add:

  • An easy way of customizing table actions and icons for new statuses
  • Autogenerated email templates for them
  • Support for Woocommerce Subscriptions

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2021-02-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固