I am setting up an eCommerce site where the items in the shop have Size options (S, M, L), but each Size is a different price. I was thinking of creating a sub-collection called Options that would hold the Size and it's related Price. Then I could display the Size & Price combo in a select menu. The problem is that I'm not sure how to pass the Price of the selected Size into Vae eCommerce. Any ideas?
Vae will handle that automatically as long as the price structure in the Options collection is the named the same as the price structure in the main collection of items.
We will soon be updating <v:option_select> to show the price differential as well in the dropdown.
Thanks Kevin. I had not added a Price structure for the main Items collection, but now that I have done that, it is returning an error saying that "Adding an item to cart, but the price field is blank."
So the main collection is called Store with fields for Name, Description, Image, Price, [Options]. Options is a sub-collection with fields for Size, Price.
This is the code I am using on item.html to add the item to the cart:<v:store:add_to_cart redirect="/cart" name_field="name" options_collection="options" option_field="size" price_field="price" >
Quantity: <v:text_field name="quantity" value="1" />
<select name="options">
<v:collection path="options">
<option value="<v->"><v:text path="size" /> - $<v:text path="price" /></option>
</v:collection>
</select>
<input type="submit" value="Add to Cart" />
</v:store:add_to_cart>
It looks like you're new here. If you want to get involved, click one of these buttons!