Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Altering options, how to put "Quantity" above drop

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-01-2005, 12:32 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default Altering options, how to put "Quantity" above drop

I know this is a simple template edit (or so I think), but not sure which one. I'm simply trying to move the Options Description (i.e. Quantity) "above" the actual drop down menu. The reason is, longer option lines break my template apart. Below is an example of what I'm trying to do...

Change this:

http://xcarttemplates.com/1.gif

To this:

http://xcarttemplates.com/1a.gif
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #2  
Old 02-01-2005, 01:08 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You've got a couple different templates to edit there. The product options drop-down is in /modules/Product_Options/customer_options.tpl

The quantity drop-down box is in product.tpl.

Both are pretty simple edits, just move the cell with the drop-down to a new row and you are golden.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-01-2005, 02:03 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Thank you very much.
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #4  
Old 02-01-2005, 02:29 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Well I thought I could simply drop this is my html editor and change it, but I'm not 100% sure. If anyone gets a second, can you look at this code and tell me where to edit (the quantity isn't neccessary)? (modules/Product_Options/customer_options.tpl)

Code:
{* $Id: customer_options.tpl,v 1.16.2.2 2004/08/11 12:04:14 max Exp $ *} {if $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var alert_msg = '{$alert_msg}'; {include file="modules/Product_Options/check_options.tpl"} </SCRIPT> {foreach from=$product_options item=v} {if $v.options ne '' || $v.is_modifier eq 'T'} <TR> <TD valign="middle" height="25">{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class}{/if}</TD> <TD valign="middle"> {if $cname ne ""} {assign var="poname" value="$cname[`$v.classid`]"} {else} {assign var="poname" value="product_options[`$v.classid`]"} {/if} {if $v.is_modifier eq 'T'} <INPUT id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default}" size="20"> {else} <SELECT id="po{$v.classid}" name="{$poname}"{if $disable} disabled{/if} onchange="javascript: check_options();"> {foreach from=$v.options item=o} <OPTION value="{$o.optionid}"{if $o.selected eq 'Y'} selected{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} ({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1}{else}{$o.price_modifier}%{/if}){/if}</OPTION> {/foreach} </SELECT> {/if} </TD> </TR> {/if} {/foreach} {/if} {if $product_options_ex ne ""} <TR> <TD colspan="2"><FONT id="exception_msg" color="red">{if $err ne ''}{/if}</FONT></TD> </TR> {if $err ne ''} <TR> <TD colspan="2"><FONT class="CustomerMessage">{$lng.txt_product_options_combinations_warn}:</FONT></TD> </TR> {foreach from=$product_options_ex item=v} <TR> <TD>{foreach from=$v item=o}{if $usertype eq "A"}{$o.class}{else}{$o.classtext}{/if}: {$o.option_name} {/foreach} </TD> </TR> {/foreach} {/if} {/if}

Thank you
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #5  
Old 02-05-2005, 02:16 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Anyone?
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #6  
Old 02-06-2005, 05:48 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Check your PM.....
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 02-06-2005, 11:37 AM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Quote:
Originally Posted by balinor
Check your PM.....

Thank you very much balinor! Worked like a charm. I did have to modify the product.tpl as well, as it moved over the quantity drop down menu. Below are the two files if anyone wants to do the same. This is for 4.0.10 and will change the drop down options exactly as I have posted in my original thread. Thanks again balinor.

customer/main/product.tpl:

Code:
<script language=JavaScript1.3 src="{$SkinDir}/tabs.js"></script> {* $Id: product.tpl,v 1.96.2.16 2004/12/10 13:14:52 max Exp $ *} {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/product_offers_short_list.tpl" product=$product} {/if} {include file="form_validation_js.tpl"} {if $product.product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_product.tpl"} {else} {capture name=dialog} <TABLE border="0" width="100%"> <FORM name="orderform" method="post" action="cart.php?mode=add" onsubmit="javascript: return FormValidation();"> <INPUT type="hidden" name="amount" value="1"> <TR> <TD valign="top" align="left" rowspan="2" width="100"> {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"} </TD> <TD valign="top"> <SPAN class=> {$product.descr} </SPAN> <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD colspan="2"><FONT class="ProductDetailsTitle">{$lng.lbl_details}</FONT></TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR> {/if} {if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN> {$config.General.weight_symbol}</TD></TR>{/if} {if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product.tpl"} {/if} {if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD> <TD valign="top"> {if $product.taxed_price ne 0 || $variants ne ''} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT> {if $product.taxes} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if} {else} <INPUT type="text" size="7" name="price"> {/if} </TD> </TR> {/if} </TABLE> <TABLE border="0" width="100%" cellpadding="0" cellspacing="0"> <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_options}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} <TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1} <FONT class="ProductDetailsTitle">{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD> <TD> </TD></TR> <TR><TD colspan="2"> {if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 0; var product_avail = 0; </SCRIPT> {$lng.txt_out_of_stock} {else} {if $config.General.unlimited_products eq "Y"} {math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity} {else} {math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"} {if $tmp<2} {assign var="minamount" value=$product.min_amount} {else} {assign var="minamount" value=1} {/if} {math equation="min(maxquantity+minamount, productquantity+1)" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail} {/if} {if $product.distribution eq ""} {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = {$start_quantity|default:1}; var avail = {$mq|default:1}-1; var product_avail = {$product.avail|default:"0"}; </SCRIPT> <SELECT id="product_avail" name="D1"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> {else} <FONT class="ProductDetailsTitle">1</FONT> {$lng.txt_product_downloadable} {/if} {/if}</TD> </TR> <TR><TD colspan="2"> <INPUT type="hidden" name="mode" value="add"> {if $variants eq ''} {include file="customer/main/product_prices.tpl"} {/if} {if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} {if $js_enabled} {if $smarty.get.pconf ne ""} <INPUT type="hidden" name="slot" value="{$smarty.get.slot}"> <INPUT type="hidden" name="addproductid" value="{$product.productid}"> {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`';document.orderform.action='pconf.php';document.orderform.submit()`$rdelim`"} {/if} {if $product.forsale ne "B"} {include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"} {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {else} {$lng.txt_pconf_product_is_bundled} {/if} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart} {/if} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product_buttons.tpl"} {/if} <INPUT type="image" src="{$ImagesDir}/null.gif" width="10" height="10" border="0" valign="top"> </TD> </TR></TABLE> </TD> <TD align="right" valign="top" width="60"> {if $product.list_price gt 0 and $product.taxed_price lt $product.list_price}<TABLE border="0" width="60"><TR></TR></TABLE>{/if} </TD> </TR> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> </FORM> </TABLE> Use the TABS below to find more information on this product: <a name="tabs"></a> <ul id="tablist"> [*]Send to Friend [*]Detailed Images[*]Related Products [*]Reviews[*]More Information[/list] <DIV id="tabcontentcontainer"> <div id="sc1" class="tabcontent"> {include file="customer/main/send_to_friend.tpl" } </div> <div id="sc2" class="tabcontent"> {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} </div> <div id="sc3" class="tabcontent"> {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} </div> <div id="sc5" class="tabcontent"> {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if} </div> <div id="sc6" class="tabcontent"> {include file="detail.tpl" } </div> </DIV> {/capture} {include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"} {/if} {if $active_modules.Detailed_Product_Images ne ""}{/if} {if $active_modules.Upselling_Products ne ""}{/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""}{/if} {if $active_modules.Product_Options ne '' && $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> check_options(); </SCRIPT> {/if}

In /modules/Product_Options/customer_options.tpl

Code:
{* $Id: customer_options.tpl,v 1.16.2.2 2004/08/11 12:04:14 max Exp $ *} {if $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var alert_msg = '{$alert_msg}'; {include file="modules/Product_Options/check_options.tpl"} </SCRIPT> {foreach from=$product_options item=v} {if $v.options ne '' || $v.is_modifier eq 'T'} <TR> <TD valign="middle" height="25">{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class}{/if}</TD></tr> <tr><TD valign="middle"> {if $cname ne ""} {assign var="poname" value="$cname[`$v.classid`]"} {else} {assign var="poname" value="product_options[`$v.classid`]"} {/if} {if $v.is_modifier eq 'T'} <INPUT id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default}" size="20"> {else} <SELECT id="po{$v.classid}" name="{$poname}"{if $disable} disabled{/if} onchange="javascript: check_options();"> {foreach from=$v.options item=o} <OPTION value="{$o.optionid}"{if $o.selected eq 'Y'} selected{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} ({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1}{else}{$o.price_modifier}%{/if}){/if}</OPTION> {/foreach} </SELECT> {/if} </TD> </TR> {/if} {/foreach} {/if} {if $product_options_ex ne ""} <TR> <TD colspan="2"><FONT id="exception_msg" color="red">{if $err ne ''}{/if}</FONT></TD> </TR> {if $err ne ''} <TR> <TD colspan="2"><FONT class="CustomerMessage">{$lng.txt_product_options_combinations_warn}:</FONT></TD> </TR> {foreach from=$product_options_ex item=v} <TR> <TD>{foreach from=$v item=o}{if $usertype eq "A"}{$o.class}{else}{$o.classtext}{/if}: {$o.option_name} {/foreach} </TD> </TR> {/foreach} {/if} {/if}
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:53 PM.

   

 
X-Cart forums © 2001-2020