X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   buy now button removal (https://forum.x-cart.com/showthread.php?t=42693)

boomobile 09-30-2008 03:14 PM

buy now button removal
 
I have this code in my product template:
Quote:

<BR><BR>{/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}

and I'm trying to comment out the actual button, but I can't quite find the exact spot to place the comment. Please help, I've been trying this for a week.

I tried this, but all I get is a blank page from the point that I modify:
Quote:

<BR><BR>{/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}


balinor 09-30-2008 04:13 PM

Re: buy now button removal
 
That's not a correctly formatted comment :) To comment something out, use this:

{* Commented Out Code *}

So in your case, it would be:

<BR><BR>{/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}

That's the add to cart button though, not the buy now button.

boomobile 09-30-2008 04:28 PM

Re: buy now button removal
 
Ah ha! Caught it. Thanks!
Oh so now I've fixed that, I can still see the "Quantity" and the dropdown of how many they can choose. I'm wondering if you could help me out with commenting out that portion too?
Quote:

<TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1}<BR><FONT class="ProductDetailsTitle">{$lng.txt_need_min_amo unt} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD>
<TD>
{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>
<B>{$lng.txt_out_of_stock}</B>
{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="amount"{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}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
var min_avail = 1;
var avail = 1;
var product_avail = 1;
</SCRIPT>


balinor 10-01-2008 03:27 AM

Re: buy now button removal
 
You actually need to comment out more than you posted above - everything from the first <tr> to the closing </tr>


All times are GMT -8. The time now is 11:19 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.