在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)