craftcms / shopify

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

Imported products 404 after initial sync #47

Closed justenh closed 1 year ago

justenh commented 1 year ago

After running an initial sync of roughly 500 products, we noticed that the configured route settings would 404 unless an admin saved the product manually within Craft (Shopify > Products > Product). Is this intended behavior? If so, is there a way to automate the process of saving all imported products to avoid this step?

Couple additional notes.

  1. It's clear the products live in some sort of non published state after initial sync because the top of the edit page says "Create Draft" and "Save", but after saving it says "Preview", "View", "Create a draft", "Save".
  2. All "unsaved" entries show as "Enabled" in the edit page

Thanks for a great plugin! Our team is excited about this integration.

Additional info

lukeholder commented 1 year ago

Hi @justenh ,

Thanks for the report. I’m sorry that we didn’t get to this quicker.

I just tried to reproduce and was able to determine what was going on.

  1. When doing the initial sync, the uriFormat and template settings are blank, so when editing the products, the preview and view buttons will not show up since no URL can be generatd.

  2. When adding the uriFormat and template in settings, the elements are not automatically resaved to generate the URLs.

I have gone ahead and done the following for the next release:

  1. Added a php craft resave/shopifyProducts command to resave all elements (without syncing from Shopify). This will fix all product elements without a URL and save you from having to resave all products manually.

  2. When changing the uriFormat in settings, we now trigger and resave queue job to resave all Product elements.

lukeholder commented 1 year ago

Will let you know when the above is out in the next release.

justenh commented 1 year ago

@lukeholder Thanks for addressing the issue! I'll be on the look out for the next update.