How to create multiple simple-products with same SKU in WooCommerce?

China☆狼群 提交于 2019-12-04 05:58:20

If you want to completely disable the SKU feature then you have to use wc_product_sku_enabled filter. It will remove the SKU field from both backend and frontend.

add_filter( 'wc_product_sku_enabled', '__return_false' );

If you want to keep the SKU feature but need to disable unique SKU check then you have to use wc_product_has_unique_sku filter. It will keep the SKU field in both backend and frontend, but will allow you to add multiple duplicate SKU.

add_filter( 'wc_product_has_unique_sku', '__return_false' ); 

Code goes in function.php file of your active child theme (or theme). Or also in any plugin php files.
Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!