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-08 14:02
Author: Support
Revision: 1.0
You cannot comment on this entry
Most Recent FAQ Entries: 
- I have the UPS Custom Integration configured so that ... (2008-07-11 10:21)
- I would like to conditionally display something for a ... (2008-07-03 17:37)
- Is there any way to configure specific global headers ... (2008-06-02 18:28)
- I pay my affiliates with gift certificates from your ... (2008-05-29 10:42)
- Is there any way to add a negative number ... (2008-05-22 13:51)
Top 10 
- 2521 views:
Adding Tokens to Evaluate Expressions - 2510 views:
Why won't you call me for technical support? I ... - 2489 views:
Is there a way to "Limit" the number of ... - 2402 views:
Are license keys valid for more than one store? ... - 2308 views:
I'm trying to enter a license key and get ... - 2270 views:
How do I install a module? - 2133 views:
How do I check for a module upgrade? - 2132 views:
How can display and change the parameters of an ... - 1960 views:
The total on my checkout pages are not correct. ... - 1843 views:
I have select and radio type attributes in my ...
















