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)
-   -   Removing Quantity Box in Products_t.tpl? (https://forum.x-cart.com/showthread.php?t=36105)

artuli 12-12-2007 09:09 AM

Removing Quantity Box in Products_t.tpl?
 
Can someone please help me remove the quantity box in the products_t.tpl? The method for 4.0 doesn't really work in 4.1.


EDIT: I can either remove the box and have ERRORS and no "buy it now" button or have both the box and the button.


Thank you in advance.

artuli 12-13-2007 08:17 AM

Re: Removing Quantity Box in Products_t.tpl?
 
I also wanted to add a "buy now" button to the related prducts, but when ever I do, the buy now button just becomes a link to the product and the maths stop working.

Any help is greatly appreciated. Thanks.

carpeperdiem 12-13-2007 08:47 AM

Re: Removing Quantity Box in Products_t.tpl?
 
You may try to apply the technique used in this post:

http://forum.x-cart.com/showthread.php?p=196619#post196619

The code will not be the same, but the technique will apply. (that is, use a hidden input tag, pre-defined with value="1")

That's how I would do it.

artuli 12-13-2007 10:53 AM

Re: Removing Quantity Box in Products_t.tpl?
 
Thanks Carpeperdiem, but none of that post makes sense to me. I want to remove the quantity box on all products in the products_t.tpl. I tried using a similar mod with "<input type="hidden" name="amount" value="1">" but it doesn't really work.

Quote:

{* $Id: products_t.tpl,v 1.10.2.10 2005/10/17 07:54:19 max Exp $ *}
<table border="0" width="100%" align="center" cellpadding="0" cellspacing="0"><tr><td class="TableThumbnailBorder">
<table border="0" align="center" cellpadding="5" cellspacing="1">
{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}
{section name=product loop=$products}
{assign var="discount" value=0}
{if %product.index% is div by $config.Appearance.products_per_row}
<tr>
{assign var="cell_counter" value=0}
{/if}
{math equation="x+1" x=$cell_counter assign="cell_counter" }
<td align="center" valign="top" width="{$width}%" class="DialogBox">
<br>
{*$lng.lbl_sku*} {*$products[product].productcode*}
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{else}
<TABLE cellpadding="3" cellspacing="0" border="0"><TR><TD height="100">
<A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}">{i nclude file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}</A><BR>
</TD></TR>
</TABLE>
{/if}
<A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}">{$ lng.lbl_see_details}</A><BR><BR>
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<FONT class="MarketPrice">{$lng.lbl_market_price}: <S>
{include file="currency.tpl" value=$products[product].list_price}
</S></FONT><BR>
<input type="hidden" name="amount" value="1">
{/if}
{/if}
<FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT><BR><FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""}, {/if}{$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}<BR>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{else}
<FONT class="ProductPrice">{$lng.lbl_enter_your_price}</FONT>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}
<BR>
{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
{/if}
{*** Uncomment it if you need 'Buy Now' button ***}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
{*** Uncomment it if you need 'Buy Now' button ***}
</TD>
{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</TR>
{/if}
{/section}
{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<TD class="DialogBox">&nbsp;</TD>
{/section}
</TR>
{/if}
</TABLE>
</TD></TR></TABLE>
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}
{/if}


carpeperdiem 12-13-2007 10:56 AM

Re: Removing Quantity Box in Products_t.tpl?
 
Quote:

I tried using a similar mod with "<input type="hidden" name="amount" value="1">" but it doesn't really work.

if you identify the code in products_t.tpl that makes the qty, then you're golden. I am on deadline now, or else I'd figure it out for you. Keep plugging away at it...


All times are GMT -8. The time now is 06:00 AM.

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