I hate to ask a more technical question here and not the discord but I’m not getting replies over there or on StackOverflow.
My problem is basically this: I’m trying to add two products to a Shopify cart on one click. When the button is clicked, the request is made, response comes back, and cart slideout is triggered. Sometimes two products show up and sometimes they don’t. It seems that my add to cart function is continuing before the 2nd response is received. I know I need to make an array for a queue and then send it over one by one to the function handling the ajax requests. I’ve seen other implementations online but I’m unsure how I can apply them.
My add function, gets two pre-selected items from form. Loops over and sends to itemAdd function
Item add function top half
itemAdd function bottom half