You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
How can I make it so that the quantity field is only shown on product pages when the maximum quantity for a product is greater than 1?
Offline
You can do that by first adding a new element under HTML Pages & Elements | Manage Site Elements. Use the reference string 'ste_proddet_quanmax' and this HTML code:
Choose the appropriate quantity for this item below, then click the 'Add To Cart' button to add the item to your shopping cart.<BR><BR> <FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT> - Denotes a required field.<BR><BR> <CENTER> <TABLE WIDTH="(CGIVAR)html_content_table_size(/CGIVAR)" BORDER="0" CELLPADDING="10" CELLSPACING="3"> <TR BGCOLOR="(CGIVAR)html_pri_tablerow_color(/CGIVAR)"> <TD VALIGN="TOP"><FONT FACE="(CGIVAR)html_small_font_face(/CGIVAR)" SIZE="(CGIVAR)html_small_font_size(/CGIVAR)" COLOR="(CGIVAR)html_small_font_color(/CGIVAR)"><B>Quantity <FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT></B><BR><BR></FONT> <SELECT NAME="quantity"> <OPTION VALUE="1">1</OPTION> </SELECT> </TD> </TR> </TABLE> </CENTER> <BR>
Then in the file ./cgi-bin/library/modules/ste_prod.pl in the routine 'ste_prod_detail' change:
$column_line = "product_id,product_name,product_number,product_pricestatus,product_regprice,product_saleprice,product_volprice,product_voltext,product_recurprice,product_recurstatus,product_keywords,product_usecatdisc,product_useinv,product_inv,product_imgxlguse,product_imgxlg,product_imglg,product_imgsm,product_lgdisp,product_descshort,product_desclong,product_xopt";
To read:
$column_line = "product_id,product_name,product_number,product_pricestatus,product_regprice,product_saleprice,product_volprice,product_voltext,product_recurprice,product_recurstatus,product_keywords,product_usecatdisc,product_useinv,product_inv,product_imgxlguse,product_imgxlg,product_imglg,product_imgsm,product_lgdisp,product_descshort,product_desclong,product_xopt,product_usemax,product_max";
And change:
($product_id,$product_name,$product_number,$product_pricestatus,$product_regprice,$product_saleprice,$product_volprice,$product_voltext,$product_recurprice,$product_recurstatus,$product_keywords,$product_usecatdisc,$product_useinv,$product_inv,$product_imgxlguse,$product_imgxlg,$product_imglg,$product_imgsm,$product_lgdisp,$product_descshort,$product_desclong,$product_xopt) = @$row;
To read:
($product_id,$product_name,$product_number,$product_pricestatus,$product_regprice,$product_saleprice,$product_volprice,$product_voltext,$product_recurprice,$product_recurstatus,$product_keywords,$product_usecatdisc,$product_useinv,$product_inv,$product_imgxlguse,$product_imgxlg,$product_imglg,$product_imgsm,$product_lgdisp,$product_descshort,$product_desclong,$product_xopt,$product_usemax,$product_max) = @$row;
Then in the routine 'ste_prod_show_addtocart_detail' change:
&display_print('ste_proddet_quan');
To read:
if ($product_usemax eq "Y" && $product_max eq "1") { &display_print('ste_proddet_quanmax'); } else { &display_print('ste_proddet_quan'); } ######### End of if statement.
Offline
I'm trying to hide the quantity field and just have the add to cart button viewable when the user shops for "certain" products only. All other products will need two show the quantity field.
I can figure out how to hide it or show it all the time, but how do I make it hidden (and default to 1) only on certain products?
thanks,
JC
Offline
Under HTML Pages & Elements | Manage Product Detail Displays, create a new element there that does what you want (I guess using a hidden quantity field). Select that display type for any products you want to use it for (under Store Catalog | Manage Products).
Offline
Did you get this working? It sounds like what I'm looking for!
cheers
Rachael
Offline