cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-SKU

Auto-SKU

Looking for a Magento 2 extension that enables the SKU field to auto populate with a unique value. For example first product starting with an SKU of 100001 and each time a new product is created it moves on one (100002, 100003, 100004).

3 REPLIES 3

Re: Auto-SKU

Hi @jasonatextra,


That functionality isn't part of Magento and I guess there isn't a module for that yet.

Probably you could use an observer or maybe a plugin to handle the save process and then change the SKU.

Re: Auto-SKU

I managed to get it working for existing products by using the before product save observer. This doesn't work for new products as it tries to change the sku value for a product that hasn't been created yet.

Re: Auto-SKU

Maybe you can try with the after_save event?