小编Jam*_*ods的帖子

woocommerce 自定义运输方式未出现在运输区

已编辑 - 原始帖子取得的进展

我创建了一个简单的自定义运输方式插件存根(见下面的代码)。

该插件已注册,现在在我创建送货区域时出现在送货方式下拉列表中。However when selected the custom field doesn't appear for the shipping zone (see gif)

<?php

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}

if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {

    function launch_shipping_method() {
        if (!class_exists('Launch_Shipping_Method')) {

            class Launch_Shipping_Method extends WC_Shipping_Method {

                public function __construct( $instance_id = 0 ) {
                    $this->id = 'launch_shipping';
                    $this->instance_id          = absint( $instance_id );
                    $this->method_title         = __('Launch Simple Shipping', 'launch_shipping');
                    $this->method_description   = __('Custom Simple Shipping Method', …
Run Code Online (Sandbox Code Playgroud)

php wordpress woocommerce

4
推荐指数
1
解决办法
1605
查看次数

标签 统计

php ×1

woocommerce ×1

wordpress ×1