Discussing Shopify Functions development, deployment, and usage in Shopify apps.
We want to merge 2 products in the cart into one product, using Merge operation of the Shopify Function.
The function's output is correct:
but in the cart and checkout, the products are not merged
can someone explain why ?
Hi Tek-labs,
From looking at your output it does seem to closely match the format of the example, however you don't have values for the title and image properties. It's not 100% clear if these are required, but can you try adding these and testing again?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you for your feedback; I'll give it a try. However, there's another issue. I have a test site with the logic function working exactly like the logic function mentioned above, and it's functioning normally. But on the live and dev sites, it's not working. Could the issue be related to my store?
This is the output from my test site, and it also lacks a title and image
My live site is: https://demo-salepify.myshopify.com
And my test site is: https://test-function-toolkit.myshopify.com
I tried adding the title and image in the merge, but the function still doesn't work.
Then i installed the app on another store, and it works fine there. I've searched the documentation, but it seems there's no documentation addressing this issue.
Hi Tek-Labs,
It's possible there could have been some browser caching at work which didn't reload the new configuration? Glad it's working on another store though - I'll pass your feedback on documentation to our internal team.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi,
Try to check if there are any errors on your Partners Dashboard > Apps > Click your app > Extensions > click the function > see details and check Logs (STDERR).
There should be an error that explains the issue if any.
Have you run this on your live site to enable the function?
mutation.graphql
Copy
mutation {
cartTransformCreate(
functionId: "YOUR_FUNCTION_ID_HERE",
blockOnFailure: false # Determines if function failures should block buyers from checking out
) {
cartTransform {
id
functionId
}
userErrors {
field
message
}
}
}
I just had this same issue and it was because my "bundle container" product was not active. This really sucks because it now shows inside of my store as Out of Stock and I don't want it showing up at all.
Yeah. This is really annoying. They expect you to build the "Bundle Container" product dynamically and then attach your bundled products to it. This documentation for Checkout Extensibility, and the new Shopify Functions are a total nightmare. They had 1000's of great examples to model their documentation off of and they just made something up that makes no sense. They don't even tell you how to change the title or the price of the bundle dynamically.
Hi there, it happened to me several times. Try uninstalling any other apps that also uses the merge operation