Main “Parent A” product is created in shopify. This item has no inventory and has no sku. The customer does not technically order this product
Parent A is a kit that references Child B and Child C (both children are other products in the store with inventory
When someone clicks add to cart on the Parent A listing, Child B and Child C are added to the cart individually (Parent A is never added)
Essentially, Parent A is just a reference to the 2 children. However, Parent A is able to be added to collection pages and looks like a normal product to the end consumer.
So custom template looks for handles “red-t-shirt” and “red-pants”, splitting the container handle into strings in and array based on “bundle”, “with” “and” using string filters
i.e. {{ red-bundle-with-t-shirt-and-pants | split:“bundle” | first }} == “red”
Once you’ve figure out a method, to add multiple items to the cart at once using the variant.ids you’ll need to either modify the themes javascript, or update the underlying id inputs the form submits to submit as an array.
You could also process the order post purchase and remove the bundle line and replace it with component lines like we do with our bundleup app.
My main concern with doing it before checkout is the buyer is seeing different products in their cart instead of the item they added. They can also remove one of them which would affect pricing if using a discount code to reduce the cost of the kit.
If you do want to do it before checkout then you could have the inventory calculated of Parent A based on the child products. So if one of the child products is out of stock Parent A will also go out of stock. You can do this on our bundle app as well and not worry about splitting the order after checkout. Otherwise if a child product is out of stock and a user is still able to add the parent then probably not ideal.