小编J. *_*abu的帖子

在woocommerce 3中创建新的送货方式

在woocommerce 3+版中生成新的送货方式时,我需要帮助。新字段的名称为“第二天交货”。像固定费率一样,它也需要在方法中存在,但未在下拉选择字段中显示。

在此处输入图片说明

下面是我尝试过的代码。但这对我不起作用。

    function request_a_shipping_quote_init() {
        if ( ! class_exists( 'WC_Request_Shipping_Quote_Method' ) ) {
            class WC_Request_Shipping_Quote_Method extends WC_Shipping_Method {

                public function __construct() {
                    $this->id                 = 'request_a_shipping_quote'; // Id for your shipping method. Should be uunique.
                    $this->method_title       = __( 'Request a Shipping Quote' );  // Title shown in admin
                    $this->method_description = __( 'Shipping method to be used where the exact shipping amount needs to be quoted' ); // Description shown in admin

                    $this->title = "Request a Shipping Quote"; // This can …
Run Code Online (Sandbox Code Playgroud)

php methods wordpress shipping woocommerce

2
推荐指数
1
解决办法
1224
查看次数

标签 统计

methods ×1

php ×1

shipping ×1

woocommerce ×1

wordpress ×1