I am using the Empire theme now, and regarding the company needs, we would like to add one or more optional products on one page, like the below image. I tried some Apps, but it doesn’t work for us. Could you please let me know what I should do. Thanks.
Hi @Anna_Wang1 ,
Based on the image provided, this can be achieve by adding the option product as a variant and change the coding in the product section to add the image, title, price and quantity. You will need to hire a developer to do so
Hi, thank you for your reply. I just want to create a really simple one. Thank you for your help.
testing below
$795
Testing
XS
and for the JS part, I really confused.
Hi @Anna_Wang1
You need to make sure the id corresponds to your product id that you want to add. There are more codes you needed by the way, you need the remove code when the user uncheck the box
Hi, thanks for your reply. I have updated my code. The id is correct, but it can’t be added to the cart. Thank you.
$(document).ready(function () { $(document).on('click','.add_to_cart',function(){ var quantity = $(".quantity").val(); quantity = parseInt(quantity); var id="6836213612609"; $.ajax({ type: 'POST', url: '/cart/add.js', dataType: 'json', data: {id:id,quantity:quantity}, success: function(){ location.href="/cart"; } }); }) });