We are looking to automatically add a product to the cart, whenever a product, for a given vendor is purchased.
The idea here is to manage our delivery capacity by adding a 'delivery' product to the cart for each product purchased from a given vendor. For example, if we have Vendor A, Vendor B & Vendor C, then we will also have three products labeled 'Delivery A', 'Delivery B' & 'Delivery C'. Each will be automatically added to the cart when any product from the respective vendor is purchased.
Thus if one of the 'Delivery' products is sold out, then a customer can no longer purchase products from that vendor.
In order to implement this we just need some assistance adding some basic Javascript to the product.liquid and cart.liquid.
Can someone assist us with this ASAP?