cancel
Showing results for 
Search instead for 
Did you mean: 

Same SKU in 2 or more categories?

Same SKU in 2 or more categories?

Hi,
Can the same SKU be used in 2 different categories on Magento 2?
For example, a white cardigan can go in the boys and the girls category.  This is the same product therefore it has the same SKU. However when I list the cardigan in a 2nd category it puts an additional '1' at the end of the SKU because it thinks it is a duplicate product but it's not, it's the same one.  Is there a way of getting around this? Thanks. 

4 REPLIES 4

Re: Same SKU in 2 or more categories?

Hi Keri,

 

Magento is meant to have products display in multiple categories. When you create (or manage) a product, you can add it to multiple categories. Regardless of what category you reach this product from, the SKU remains the same. This is very important since inventory and other vital information becomes tied to the product / SKU. It's also important in terms of avoiding duplicate pages in the site, which can be harmful for SEO.

 

So, the SKU is a unique identifier. You cannot enter 2 products in the admin with the exact same SKU. You can, of course, have variations of a SKU. If you try to enter 2 products with SKU ="ABCD1234", Magento is programmed to tell you"SKU for product ABCD1234 has been changed to ABCD1234-1" This is a safety feature. You can however have variations of a SKU. For example:

 

SKU=ABCD1234-Large

SKU=ABCD1234-Small

SKU=ABCD1234-Black

SKU=ABCD1234-White

SKU=ABCD1234-Oak

SKU=ABCD1234-Maple

SKU=ABCD1234-2018

SKU=ABCD1234-2019

SKU=ABCD1234-New

SKU=ABCD1234-Old

 

However, you cannot have two products with the same SKU. If you want a product to show up in multiple categories, you should adjust the products to appear in those categories. There's a Category field available to edit each time you add or edit a product in the Magento admin. Similarly, when managing Categories in the Magento Admin, you can select which products are to appear in a category. This is a good way to add many products to an additional category quickly.

 

Best of luck!

Re: Same SKU in 2 or more categories?

Hello @keri_dingley 

If you want to show same product in multiple category then you don't need to create same products multiple times . You can assign one product into multiple categories in Magento. And about same sku .. sku is a unique attribute of any product so this can't be same for multiple products.

 

If my answer is useful click kudos and Accept as answer

Re: Same SKU in 2 or more categories?

Hi,

Thanks for your reply.  I probably should have mentioned that this is a configured product.  In the girls department there is a pink and a white option and in the boys department there is blue and a white option.  The SKU for each of these has a (B) for boys and a (G) for girls at the end of it so the SKU is different. Obviously the pink and the blue don't appear in each department but the white cardigan does and it is this is the one that is getting a 1 at the end of it.  Does this make sense?

Re: Same SKU in 2 or more categories?

Hi Keri,

 

Let me ask, are you simply listing the same gender-neutral White Cardigan (configurable product) in both categories (ie. Girls + Boys) or are you making 2 different configurable products? 

 

If so, what's the difference between the two configurable products? 

 

If you're listing the same gender-neutral product in both categories (ie. One product, displayed in two categories), you shouldn't have a problem.

 

If the product is indeed different and has different stock associated with it (ie. a girls cut and a boys cut cardigan), then they're different products and should have different SKUs. 

 

As previously mentioned, Magento treats SKUs as unique identifiers, so there is no simple way to have two products with the same SKU... just as there's no simple way to have two customers with the same e-mail address.

 

If the simple items (ex. The small white children's cardigan, medium white kids cardigan, and large white kids cardigan) remain the same, but you want a configurable product page for the Boys category that uses specific male-oriented product descriptions, and a different configurable product for the Girls category that uses its own female-oriented product descriptions, you could use gender-neutral simple products for the inventory and pricing and create 2 configurable products for sales and marketing purposes, but the SKU used by the configurable products would need to remain different. (ie. Cardigan-White-Boys and Cardigan-White-Girls).

 

I hope this is helpful. Feel free to provide more info.

 

PS - I would have referred to the products as unis-e-x, but the forum won't allow any word that contains s-e-x, so I swapped to "gender-neutral" for simplicity. Good to know that I'm still a rebel!