Using the new attribute quantity feature, I would like to make sure that the customer selects a set number of attributes. For example, I'm selling a three pack of soap and I would like them to select a color for each item in the "pack". How can I go about this?
(2003/08/08)I added a new token, %quantity_required|xxx|% (where xxx is the required quantitiy) which can be used in the main attribute template or the product template (if used in the product template it has to be between the %beginform%..%endform% tokens if they're in the template). It adds a hidden field so that the module can make sure that the quantity selected with the attribute quantity fields matches the required quantities. If the quantitites do NOT match it passes the customer back to the product page and sets the variable g.QuantityError. If the selected quantity is too low, the variable g.QuantityError will have a value of 'low'. If the selected quantity is too high, the variable g.QuantityError will have a value of 'high'.
So, to require that the customer to select three soap colors (three total quantity; they can make all three the same color if they like) to make up their three pack, you would add the token:
%quantity_required|003|% to the attribute main template OR the product template area of the template.
That's all you need to assure that the customer selects exactly enought attributes. To display a message you can use the %begin_if|var|% token to display something by adding something like this to the template:
%begin_if|g.QuantityError EQ 'low'|%
The selected quantity is too low.
%end_if%
%begin_if|g.QuantityError EQ 'high'|%
You selected too many.
%end_if%
This will check the variable g.QuantityError and if it is equal to 'low' it will display one message and if it is 'high' it will display another. Of course you can put a more explanatory note in there than I used in this example.
Last update: 2004-12-07 14:13
Author: Support
Revision: 1.0
You cannot comment on this entry
Most Recent FAQ Entries: 
- I have the module configured to add the key ... (2008-08-13 14:50)
- What is the format for the htaccess file if ... (2008-08-12 14:50)
- Is there any way to look up a customer's ... (2008-08-06 18:04)
- I am looking for a module that will allow ... (2008-08-06 18:00)
- Is it possible to display a link in Phone ... (2008-08-06 12:05)
Top 10 
- 2754 views:
Adding Tokens to Evaluate Expressions - 2698 views:
Is there a way to "Limit" the number of ... - 2654 views:
Why won't you call me for technical support? I ... - 2549 views:
Are license keys valid for more than one store? ... - 2447 views:
I'm trying to enter a license key and get ... - 2425 views:
How do I install a module? - 2286 views:
How do I check for a module upgrade? - 2255 views:
How can display and change the parameters of an ... - 2097 views:
The total on my checkout pages are not correct. ... - 1932 views:
I have select and radio type attributes in my ...
















