Woocommerce – How to use same sku multiple times

How I bypassed the error message

    Inhaltsangabe
  1. The solution
  2. How i came in contact with

The solution

You can allow multiple sku’s just by deactivating the sku unique check from WooCommerce. To do so, just add the following line into your functions.php:

add_filter( 'wc_product_has_unique_sku', '__return_false', PHP_INT_MAX );

How i came in contact with

I have used this in a Project where i’ve used Polylang. WooCommerce was shouting because the translations had both the same sku. After adding this, i had no problems at all. Because of this i would recommend it to you.

Topics

Bugfixing Experience php Polylang Program technology WooCommerce WordPress

Beitrag teilen

WhatsApp it

Folgen Sie uns