I currently have an online store that uses shopify's checkout page. The information regarding the customers shopping cart is all done through my site built around node.js and then sends the cart information over to the shopify checkout page where they're able to pay for the order.
Previously the shopping cart would send over the product ID's and quantity number of each product to Shopify in the form of a URL once the "checkout" button was pressed in the following format:
However, now Shopify is no longer allowing for a 0 value of "qty" and lands you on an error 410 page. I now need to change my code to reflect when the productID has a zero quantity, it won't show up in the URL. Current code for the button is as follows:
var cBBM = ",product2:";
var co = ":";
var caHref = 'http://shop.mysite.com/cart/product1:';
var cMicro = ',product3:';
var cPower = ',product4:';
var bbQ = getStoredCartItemAmount('Product1name');
var bbmQ = getStoredCartItemAmount('Product2name');
var musbQ = getStoredCartItemAmount('Product3name');
var powersQ = getStoredCartItemAmount('product4name');
var cHref = caHref + bbQ + cBBM + bbmQ + cMicro + musbQ + cPower + powersQ;
I'm guessing a simple if;else statement would probably be able to solve this, however I'm not sure exactly how to implement that for every productID.
Any help appreciated, thanks! :)