I've read up on the product variant options and had a quick question.
I'm trying to create a page that allows the customer to purchase two "linked" items (bikini top and bottom) on one page and still allow proper tracking of the skus.
For example, I'd like the customer to be able to select a large top and medium bottom (which is now possible via the product options) but track this as two separate skus so we properly maintain inventory.
I understand that shopify doesn't support this out of the box. Does anyone have any good examples or know of any tutorials on how to custom extend shopify themes to allow this behavior?
Yes, you can do this. I am not aware of a good example out there though, or any tutorial for this. I can't make any promises but I will try to write some code for this by Tuesday, to show to you.
Here are a few hints:
1- You will need to store the associated product handle in a product tag, so that your product page becomes 'aware' of an association. You could use some product field to store the product handle of the associated product, e.g. the 'product type' field, or the 'vendor' field, if you can spare those, but using a tag is usually sound...
In other words, you must tell each product what other product it has to be sold with. Shopify does not give you a product property to stick that information in, out of the box. You have to 'high-jack' some property for this purpose.
2- In your 'add to cart' form, you will need to set your form fields 'name' attribute to id.
Some quick example - but it does not use Shopify options: http://11heavens.com/testing-something-for-Tom
Do a View Source or use Firebug.
On that page, there are 2 products (distinct products). One click - and if you have checked both checkboxes - both products are added to the cart.
Thank you so much for your invaluable feedback. I did a quick review of your page and like that you can add two products to the cart from one page. I'll look at the code in more detail tomorrow.
If you could write some sample code (as you said you may be able to) that would be very helpful.
Thanks and hope you had a great weekend
Then, I created an 'all' collection as per this tutorial here. This may not be necessary, but in my code I am accessing my 'extra' product using an 'all' collection, and was not sure the automatic 'all' collection would work for this. It probably would have.