shopify icon indicating copy to clipboard operation
shopify copied to clipboard

Shopify Product Slugs Not Updating / Re-Syncing

Open sm9 opened this issue 2 years ago • 6 comments
trafficstars

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

  • Craft version: 4.5.9
  • PHP version: 8.0
  • Database driver & version: MySQL 8
  • Plugins & versions: Shopify 4.0.0

sm9 avatar Nov 03 '23 01:11 sm9

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.

sm9 avatar Nov 03 '23 18:11 sm9

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

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

lukeholder avatar Nov 03 '23 23:11 lukeholder

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.

sm9 avatar Nov 04 '23 10:11 sm9

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

siebird avatar Jan 15 '24 16:01 siebird

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 [email protected] so we can look into this one?

Thanks.

lukeholder avatar Apr 24 '24 13:04 lukeholder

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

dyerc avatar Sep 17 '24 13:09 dyerc