Deploying a server-side cart validation function to live store

Solved

Deploying a server-side cart validation function to live store

MA-Malindu
Shopify Partner
4 1 2

Hi, I have created a Shopify server-side cart validation function to fulfill some of our business requirements,

I created the function in a development store using a Shopify partner account, The function is working as expected and it covers our requirements as well.

 

Now I need to add this cart validation function to our live store.
How can I do that? I couldn't find any clear documentation on deploying the functions to live stores.

Accepted Solution (1)

MA-Malindu
Shopify Partner
4 1 2

This is an accepted solution.

I managed to deploy the app to the live store.
For anyone that has the same question, follow the below steps to deploy the custom app into your live store.

 

Go to your Shopify partner account then select "Apps" from the left menu then click on "All apps".

 

Select the app you want to deploy from the list. then click on the "Distribution" button on the right side. after that, you can select the distribution method you want.

in my case is "Custom distribution"

Hope this helps

View solution in original post

Replies 4 (4)

MA-Malindu
Shopify Partner
4 1 2

This is an accepted solution.

I managed to deploy the app to the live store.
For anyone that has the same question, follow the below steps to deploy the custom app into your live store.

 

Go to your Shopify partner account then select "Apps" from the left menu then click on "All apps".

 

Select the app you want to deploy from the list. then click on the "Distribution" button on the right side. after that, you can select the distribution method you want.

in my case is "Custom distribution"

Hope this helps

jameshagood
Shopify Partner
37 0 17

I am trying to figure out how these functions are hosted, I thought maybe you have done it before. Can functions be used by themselves without having to self host any code? I realize most of the data may have to be hard-coded into the functions but is that possible? Thank You.

MA-Malindu
Shopify Partner
4 1 2

Hi, I'm not sure I understood your question correctly,
But as per my knowledge, you don't need to host functions anywhere, you just need to deploy the function and Shopify will automatically handle the hosting of the function.

and I don't think hard-cording data is a good practice since you can get live/up-to-date data using GraphQL.
See this document, it is a good starting point to learn about Shopify function creation and deployment.

Hope I answered your question correctly 🙂

jameshagood
Shopify Partner
37 0 17

Yeah I played around with them for the past couple of days and I figured out the answer that I was looking for. The functions themselves are hosted by Shopify. With what I was talking about with hardcoding was like the configurations. For example if you want a 5% discount then the 5% can be hardcoded without needing to host anything yourself. If you want the 5% to be editable from the Admin area then those files for the GUI that is inside the Admin area would need to be hosted somewhere.