Shapedvier Shopify - Add to Cart Button

Hello everybody,
i’m currently trying to integrate my scripts into shopify and I cannot figure out how the AddtoCart, CreateModelState and CloseConfigurator buttons work. I see that the outputs are a Action parameters and I can not find any related help articles to any of them yet.
I have a custom python script that takes the state of every parameter in the script and gets a json file and I would like to link it to the AddtoCart button, so when an order is placed I get the Json file with those parameters
Thanks for your help !
Best
Svetlin

You need to connect action components to an Actions Widget, and include this widget in a container:

Keep in mind that these features are in beta and those workflows might evolve in the future (this is also the reason why there is little documentation about them).

Note that when you add items to cart, a model state is already created, and its ID is included in the cart as well. As the moment, loading this state necessitates to copy it as a query string in the URL of the App, which is not very convenient, but in the future we will directly include a link in the order page of Shopify to open the App using the state. At this time, you will not need your custom script anymore.

1 Like

Merci Matthieu,
this seems to do the trick. And I also have a couple of follow up questions. Do you have an idea when you will release the additional components and the corresponding documentation ? Also can you please remind me where I have to copy the ID string in the URL. I remember you showed it on the community catchup last week.
Best
Svetlin

I am not sure what you mean by “additional components”. There will be in the next few weeks improvements regarding model states in the platform, Apps and Shopify, to make the state associated with every order in Shopify can easily be reloaded (both from store owners and clients).

The action components in Grasshopper will stay in beta for the time being as we are planning to refactor several workflows there, I can not give a precise timeline about those changes yet. For the time being, the Add to Cart action should work as expected in Shopify.

Regarding loading a model state id: you can open your App (from the ShapeDiver platform for example), and add the query parameter modelStateId to the URL, like this:

https://www.shapediver.com/app/builder/v1/main/latest/?slug=MODEL_SLUG&modelStateId=MODEL_STATE_ID