craftcms / shopify

Synchronize and extend product data from your Shopify storefront.
MIT License
45 stars 25 forks source link

Shopify Product Slugs Not Updating / Re-Syncing #87

Open sm9 opened 11 months ago

sm9 commented 11 months ago

Description

Before installing the Shopify plugin, I had a section named 'Shop Entries', and these contained all my products. When updating the settings for the Shopify products for the first time, I gave them the same Product URI Format as the Shop Entries section. When I synced my products from Shopify, all the Shopify products in my Craft install have a "-2" at the end of the slug, e.g. /shop/product-name-2.

I have tried changing the Shop Entries URI format to something different to remove the clashing slugs, but that didn't change anything with the Products. I tried clicking the Shopify Sync button in case that updated the product slugs, but that didn't change anything either. Is there a way to update these Shopify product slugs at all? Thanks.

Additional info

sm9 commented 11 months ago

Just a quick follow-up on this - I noticed that the slug for each product is stored within the slug row of the craft_elements_sites table, so I tried changing the slug for one product in here, and it seemed to work okay, so I don't mind fixing this duplicate slug issue by doing the same for the rest of the products. But are there any consequences to doing this that I should be aware of? Thanks.

lukeholder commented 11 months ago

You can fix it in that table as long is it is unique.

I'll look into allowing edits on the front end.

sm9 commented 11 months ago

Thanks Luke, I'll fix this in that table for now then. There's only 9 products and I'll make sure the slug is unique. It'd be great if a native way of editing this is added in the future of course, so thanks for looking into this.

siebird commented 8 months ago

We're running into a similar issue. We have two entries for the same Shopify product in Craft, thus giving us -2 with slugs. Not able to delete one either.

CleanShot 2024-01-15 at 11 59 00

lukeholder commented 5 months ago

You are getting duplicate Shopify product elements? Re-sycning all from the command line doesn't fix it?

@siebird Can you send your DB dump, composer.json, composer.lock to support@craftcms.com so we can look into this one?

Thanks.

dyerc commented 2 weeks ago

I just encountered this issue or a very similar one. I updated the slug/url handle for a product in Shopify and despite performing a full resync, Craft still displays the product on its original URL. In the admin area, the updated slug is displayed but not used by Craft to display the page