Apologies if this is asked before, I'm new in Shopify Development, I have implemented a third party design studio to my Shopify store, and I want to add a designed product image to cart instead of the default product image.
I have created the product property for this and add that property to cart along with product using property I'm able to show the designed image in cart page but not in the checkout page and order-related emails. So, now I've created the variant in the product from admin and want to update its image from frontend as when I add a custom image to product variant image that will show the correct image in cart checkout and order email. So I want to add a dynamic image to it when the user adds design I want to update that image in the product variant.
Below the Ajax, I'm using to add the product to the cart but not working it add the product with selected variation but not the updated image, even I tried using updated the featured image src too. nothing works
<script>
cartdata = {
"quantity": 1,
"id": 31708393013302,
"featured_image": {
"url" : "mycustomimageurl",
"aspect_ratio" : 1.0,
"alt" :productTitle,
},
"image" : "mycustomimageurl",
}
$.ajax({
type: 'POST',
url: '/cart/add.js',
data: cartdata,
dataType: 'json',
success: function(data_res) {
window.open('/cart', '_blank');
});
</script>