نقل قول از رودریگو در 30 ژوئن 2022، 20:12
من نیاز به اضافه کردن پشتیبانی به نوع محصول سفارشی خود داشتم، و نمیتوانستم این کار را با افزودن نوع محصول در فیلتر انجام دهم، بنابراین پیشنهاد من این است:
در فایل: 'classes/fixed/fixed_price.php'، در روش 'woocommerce_product_options_general_product_data'
عملکرد عمومی woocommerce_product_options_general_product_data() { global $WOOCS; جهانی $post; $_product = wc_get_product ($post->ID); add_action('admin_footer', array($this, 'admin_footer')); if ($_product->is_type('simple') OR $_product->is_type ('external') OR $_product->is_type ('subscription') OR $_product->is_type ('composite') OR $_product-> is_type('bundle') OR $_product->is_type('box_product')) { ... } }
برای تغییر به:
عملکرد عمومی woocommerce_product_options_general_product_data() { global $WOOCS; جهانی $post; $_product = wc_get_product ($post->ID);
add_action('admin_footer', array($this, 'admin_footer')); $product_types = application_filters('woocs_product_fixed_price_data_simple_types', array('sample', 'external', 'subscription', 'composite', 'bundle', 'box_product')); if (in_array($_product->get_type()، $product_types)) { ... } }
من نیاز به اضافه کردن پشتیبانی به نوع محصول سفارشی خود داشتم، و نمیتوانستم این کار را با افزودن نوع محصول در فیلتر انجام دهم، بنابراین پیشنهاد من این است:
در فایل: 'classes/fixed/fixed_price.php'، در روش 'woocommerce_product_options_general_product_data'
عملکرد عمومی woocommerce_product_options_general_product_data() { global $WOOCS; جهانی $post; $_product = wc_get_product ($post->ID); add_action('admin_footer', array($this, 'admin_footer')); if ($_product->is_type('simple') OR $_product->is_type ('external') OR $_product->is_type ('subscription') OR $_product->is_type ('composite') OR $_product-> is_type('bundle') OR $_product->is_type('box_product')) { ... } }
برای تغییر به:
عملکرد عمومی woocommerce_product_options_general_product_data() { global $WOOCS; جهانی $post; $_product = wc_get_product ($post->ID);
add_action('admin_footer', array($this, 'admin_footer')); $product_types = application_filters('woocs_product_fixed_price_data_simple_types', array('sample', 'external', 'subscription', 'composite', 'bundle', 'box_product')); if (in_array($_product->get_type()، $product_types)) { ... } }