Miva Merchant 4 Module FAQs » Product Page Templates (BROK_PRODTEMPLATES )


{docurl}

I would like to use the "attribute quantity" feature that you recently added to the module to let my customers select quantities for each attribute. However, instead of text fields, I would like to use drop down lists so that they can select the quantities. Can this be done?

(2003/08/30)I modified the module so that you can do this. Here's how to go about it:

To the "Attributes main template" area of the template that you want to use, add (anywhere in the template works but put it at the top so you'll see it there):

<input type="hidden" name="AttributeQuantities" value="1">
<input type="hidden" name="BROK_FROM" value="PRODTEMPLATES">

and in the attribute template that you want to display the quantity select list add:

<input type="hidden" name="AttributeHasQuantity[%var|g.Total_Attributes|%]" value="1">

and the html for the drop down select list (using whatever options that you want:

<select name="AttributeQuantity[%var|g.Total_Attributes|%]">
<option value="0">0</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
</select>

make sure that the name for the select field is AttributeQuantity[%var|g.Total_Attributes|%]

As an example, in my store, I wanted a quantity selection list for quantities 0, 2, 4, 6, and 8. I modified the "Checkbox attr. template" so that it displayed the drop down select field next to the prompt and I wanted to hide the checkbox itself (using the %fields_hidden% token as described below). So in the "Checkbox attr. template" area I have:

<TR>
<TD ALIGN = "left" VALIGN = "top">
 </TD>
<TD ALIGN = "left" VALIGN = "middle">

<TABLE BORDER = "0">
<TR><TD>
%fields_hidden%
<select name="AttributeQuantity[%var|g.Total_Attributes|%]">
<option value="0">0</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
</select>
<input type="hidden" name="AttributeHasQuantity[%var|g.Total_Attributes|%]" value="1">
</TD><TD>
%prompt%
</TD></TR>

</TABLE>
</TD></TR>

Keep in mind that this will cause all checkbox attributes of products that are assigned to this template to display in the same manner.



Last update: 2004-12-07 14:08
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category