Okay
  Public Ticket #3963069
Automatically Generate Unique Product SKUs for Vendors
Closed

Comments

  •  7
    Barni started the conversation

    Dear WebWizward Team,

    I’m reaching out to ask if there's a way to automatically generate product SKUs when a vendor creates a new product.

    The background:
    Right now, vendors are required to enter SKUs manually. As the number of vendors on our platform grows, the risk of duplicate SKUs increases significantly. Not every vendor comes up with a unique SKU, which can lead to product conflicts and backend issues.

    I’ve already tested the SKU for WooCommerce plugin, but unfortunately, it only works within the admin backend and doesn’t meet our needs.

    Ideally, we’re looking for a solution that:

    • Automatically generates a unique alphanumeric SKU (e.g. A2XFBD3),

    • Triggers when a product is created by a vendor,

    • Prevents the vendor from editing the generated SKU afterward.

    If you have a code snippet or solution that could help us implement this functionality, we’d really appreciate it.

    Best regards,

  •  2,405
    WebWizards replied

    Hi Barni,

    You could add this code snippet to your site: https://pastecode.io/s/hy1cxp07

     

    This does 2 things:

    1. It hides the SKU area from the vendor product edit panel, so it's no longer modifiable by vendors
    2. When the product is saved, it automatically sets a unique SKU. In this case, the sku is "SKU1234" where 1234 is the ID of each product (unique).

    Of course, you can modify it in the above code to configure a custom formula for SKUs.

     

    Kind regards,

    Stefan

  •   Barni replied privately
  •  2,405
    WebWizards replied

    Glad to assist : )

    I'm afraid we are not available for customization or larger projects though as we are focusing exclusively on the plugins. Happy to assist with any technical info though if you work with a developer or anyone else.