<p>The slug for products is generated from the Title, for example in my case "Green Shirt". Seems like these are not unique, and if I create a product later on, also called "Green Shirt", they both get "green-shirt" as slug, and causing problem when viewing the products in a template.</p>

<p>Why isn't this creating unique slugs like for Entries?</p>

<p>And I would rather have the slug autogenerated, like the option for SKU. Is this possible?
Have seen threads about this, but has anyone made a solution yet?</p>

<p>Thanks!</p>

CC BY-SA 4.0
2020-04-13T13:48:20.333Z
Did you set a **Product URI Format** in Commerce → System settings → Product Types → your product type?
Oli
CC BY-SA 4.0
2020-04-13T16:31:09.333Z
Product URI is set to "produkt/{id}"
Carl-Johan
CC BY-SA 4.0
2020-04-14T12:34:53.100Z
Can you try `produkt/{slug}`?
Oli
<plugin-craftcommerce><slug>
Commerce product slug creates duplicates - can they also be autogenerated?
# Commerce product slug creates duplicates - can they also be autogenerated?

(Asked by: username_0 on 2020-04-13)

The slug for products is generated from the Title, for example in my case "Green Shirt". Seems like these are not unique, and if I create a product later on, also called "Green Shirt", they both get "green-shirt" as slug, and causing problem when viewing the products in a template.

Why isn't this creating unique slugs like for Entries?

And I would rather have the slug autogenerated, like the option for SKU. Is this possible?
Have seen threads about this, but has anyone made a solution yet?

Thanks!

**Tags:** plugin-craftcommerce, slug

> **Comments:**
> **username_1**: Did you set a **Product URI Format** in Commerce → System settings → Product Types → your product type?  
> **username_0**: Product URI is set to "produkt/{id}"  
> **username_1**: Can you try `produkt/{slug}`?  

---

## 0 answers

