0

现阶段非常简单的产品:

class WC_Product_Event extends WC_Product_Variable
{
    public function get_type()
    {
        return 'event';
    }
}

这很好用。但是,如果我想命名它,WooCommerce 会将产品保存为“简单产品”。

namespace MyVendor\MyApp;

class WC_Product_Event extends WC_Product_Variable
{
    public function get_type()
    {
        return 'event';
    }
}

向我的类添加命名空间可以防止它被保存为“事件”产品。我必须进行哪些更改才能启用命名空间?

4

0 回答 0