This sample shows one way (certainly not the only way) of requiring certain product attribute entries/selections for an item added to your Google Shopping Cart. In the sample below, in order to purchase a PayCircuit Coffee Mug Set priced at $19.95, a customer must choose 2 coffee blends.
In some ways, this is a much simplified version of a
previous sample on Required Items in that a product itself must be "complete"
when added to the cart (in order to purchase Item A, you must include certain Item
A "attributes" that make it up). The
previous sample implemented different/unique item/product
relationships (in order to purchase Item A, you must also purchase Item B).
Note that this expands on the same sample
code provided in this web site. As such it may contain other functions/features
not necessarily relevant to this topic. This page likewise clears the cart contents
each time it is requested and/or refreshed.
This should be in <head> of your HTML
file, or you can create a .js file and reference it for easier management.
This code:
This sample should be within your <body>.
Note that this makes use of the Google Checkout Shopping Cart (v. 2_2).
Copy the code below and modify the
following for this to work:
Usage Tips: