Enabling Duplicate SKUs in WooCommerce

Enabling Duplicate SKUs in WooCommerce

Why do I need to allow duplicate SKUs

If you are already using the Woosage50 Default SKU feature, then there are situations where you may want to allow WooCommerce to have duplicate SKU codes.

For example, if you are using the Default SKU feature for Product Bundles, but you also have non-stock items on your website. Rather than adding all the non-stock items to Sage, to allow orders containing these items to be imported by Woosage50, you could to the following.
  1. Add a non-stock item to Sage with a SKU of MISC001 (for example), with a name of something like Non stock item placeholder (this name will never appear in orders)
  2. Enable the WooCommerce to allow duplicate SKUs (see below)
  3. On the website give ALL the non-stock items the same SKU (MISC001, in this case)
  4. In Woosage50>Settings>Orders set Use website product names to Yes
Orders in Sage will appear with a line item SKU of MISC001 (in this example) and will have the item name, quantity, price and VAT from the website.

Enabling Duplicate SKUs

There are plugins to change WooCommerce to duplicate SKUs, but the easiest way is to add the following code snippet to your functions.php file.

/* Allow duplicate SKUs */
add_filter( 'wc_product_has_unique_sku', '__return_false' );

Editing your functions.php file can have unpredictable results and should only be done by WooCommerce specialists.


    • Related Articles

    • Adding WooCommerce Custom Fields From the Woosage Plugin

      Custom fields in WooCommerce orders, which are usually created by your developer (e.g. PO Number), can be passed through to Sage Custom Fields Analysis1, 2 or 3. In the website backend scroll to Woosage Settings and use the drop-downs to select the ...
    • Removing a Duplicate Monitor Service

      Due to an internal error there have been situation where a duplicate Woosage Monitor Service is running, which cannot be stopped from the Woosage Control Centre. To check if you have a duplicate enter Services in the Windows search box and click ...
    • Preventing Duplicate Invoices being Created by Opayo (Formerly SagePay)

      To prevent Opayo creating duplicate invoices, change the setting in Company Preferences>Opayo By Elavon to only download payments as shown below. Note: you will need to login to Sage as Manager to make the above change.
    • Creating a Sage Price List as a duplicate of Selling Prices

      Why might this be required? This may be a requirement in the following scenario. Your trade or wholesale prices are held in Sage in the Sage Selling Prices and you want to make these available to trade customers when they login to your website, via ...
    • Bundled and Composite Products

      Overview Bundles Product are groups of products that can be purchased together, usually at a discounted rate.  Composite Products are similar, but present different components (product options) based on customer selections. When the customer adds ...