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

Buy Now with Product Options

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-11-2005, 08:44 AM
 
jeffleeismyhero jeffleeismyhero is offline
 

Newbie
  
Join Date: Aug 2005
Posts: 9
 

Default Buy Now with Product Options

I need to either display the product options drop down menu(s) above the buy now button or have it actually displayed on the page after you click buy now (to avoid having to click "edit options").

My buy now code is below:

Code:
{* $Id: buy_now.tpl,v 1.15.2.7 2004/12/01 15:15:49 mclap Exp $ *} <TABLE border="0" width="100%" cellpadding="0" cellspacing="0"> {if $product.price eq 0} <TR> <TD height="25"> {assign var="button_href" value=$smarty.get.page|escape:"html"} {include file="buttons/buy_now.tpl" style="button" href="product.php?productid=`$product.productid`&cat=`$cat`&page=`$button_href`"} </TD> </TR> {else} <FORM name="orderform_{$product.productid}_{$product.add_date}" method="post" action="{if $product.is_product_options eq 'Y' && $config.Appearance.buynow_with_options_enabled eq 'Y'}product.php?productid={$product.productid}{else}cart.php?mode=add{/if}"> <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"}"> {if $product.is_product_options ne 'Y' || $config.Appearance.buynow_with_options_enabled ne 'Y'} <TR> {if $product.distribution eq ""} <TD height="25" width="15%" nowrap>{$lng.lbl_quantity} </TD> <TD width="20%" nowrap> {if $config.General.unlimited_products ne "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)} {$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} <SELECT name="amount"> {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/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> {/if} </TD> {else} <INPUT type="hidden" name="amount" value="1"> {/if} <TD width="100%" height="25" valign="middle"> <INPUT type="hidden" name="mode" value="add"> {include file="customer/main/product_prices.tpl"} </TD> </TR> {/if} <TR> <TD colspan="3"> {if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} <TABLE border="0" cellpadding="0" cellspacing="0"><TR> {if $js_enabled} {if $special_offers_add_to_cart eq 'Y'} <TD>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: document.orderform_`$product.productid`_`$product.add_date`.submit();"}</TD> {else} <TD>{include file="buttons/buy_now.tpl" style="button" href="javascript: document.orderform_`$product.productid`_`$product.add_date`.submit();"}</TD> {/if} {if $login ne "" and $active_modules.Wishlist ne "" and $special_offers_add_to_cart eq ""} {if $product.is_product_options ne 'Y' || $config.Appearance.buynow_with_options_enabled ne 'Y'} <TD></TD> <TD>{include file="buttons/add_to_wishlist.tpl" style="button" href="javascript:document.orderform_`$product.productid`_`$product.add_date`.mode.value='add2wl'; document.orderform_`$product.productid`_`$product.add_date`.submit()"}</TD> {/if} {/if} {else} <TD>{include file="submit_wo_js.tpl" value=$lng.lbl_buy_now}</TD> {/if} </TR></TABLE> {/if} </TD> </TR> </FORM> {if $product.min_amount gt 1} <TR> <TD colspan="3"><FONT class="ProductDetailsTitle">{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT> </TD> </TR> {/if} {/if} </TABLE>
__________________
Jeff
Reply With Quote
  #2  
Old 08-11-2005, 09:46 AM
 
jeffleeismyhero jeffleeismyhero is offline
 

Newbie
  
Join Date: Aug 2005
Posts: 9
 

Default

Solutions found here:

http://forum.x-cart.com/viewtopic.php?t=19958&highlight=buy+options
__________________
Jeff
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:48 AM.

   

 
X-Cart forums © 2001-2020