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 without the "Quantity" (https://forum.x-cart.com/showthread.php?t=12466)

interstellarsounds 07-24-2005 06:36 AM

Can anyone help with the request above...?

thank you

interstellarsounds 07-29-2005 03:11 PM

Someone MUST know how this can be done...???

Steele 09-14-2005 02:03 PM

Quote:

Originally Posted by Jon
You can edit out the quantity areas of your templates and instead use:

<input type="hidden" name="amount" value="1">


I'd like to do something like this, but only for certain products. Is there a way to limit this to particular produtcs only? To show the quantity for some and for others to set it to default of 1?

Thanks.

tron 10-05-2005 02:36 PM

this was excellent. worked nice.

anybody know how to remove quantity from product detailes.

Tron

maerik 10-07-2005 03:40 AM

Quote:

Originally Posted by Steele
Quote:

Originally Posted by Jon
You can edit out the quantity areas of your templates and instead use:

<input type="hidden" name="amount" value="1">


I'd like to do something like this, but only for certain products. Is there a way to limit this to particular produtcs only? To show the quantity for some and for others to set it to default of 1?

Thanks.


Hi all, I'm new to this forum.
See my code below - i know it isn't the best but it works :D

maerik 10-11-2005 04:07 AM

Quote:

Originally Posted by Steele

I'd like to do something like this, but only for certain products. Is there a way to limit this to particular produtcs only? To show the quantity for some and for others to set it to default of 1?

Thanks.




QUANTITY ONLY FOR CERTAIN PRODUCTS IN PRODUCT DESCRIPTION ONLY!

If the product ID is 666 or 667 the quanity dropdown menu will not apear! Customize at will!
You got to put 2x {if} tags in the "product.tpl".
But watch out - i worked on version 3.5.2!


The 1st one:

Code:

{if $product.productid eq 666 or $product.productid eq 667}

{else}<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>
{/if}


And the 2nd one (with the default amount variable = 1 before the {if} tag):

Code:


<input type=hidden name=amount value=1>
{if $product.productid eq 83 or $product.productid eq 84}

{else}
<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}



Quote:

Originally Posted by tron
anybody know how to remove quantity from product detailes.
Tron


To remove quantity from product details just comment out (HTML comment) or delete all the lines between the two {if} tags.

Hope i helped you guys out a bit!
Don't blame me for bad code - I'm a newbie to X-Cart.

harrismichael 10-11-2005 02:03 PM

Will this code pasted on the first page affect the categroy pages or the product pages .. or both ?


We wouldn't mind getting rid of the quantity dropdown on the category pages but are a bit hesitant to remove them from the product page.

maerik 10-11-2005 10:43 PM

Quote:

Originally Posted by harrismichael
Will this code pasted on the first page affect the categroy pages or the product pages .. or both ?


This code pasted in the correct place in "product.tpl" affects only the product description, not the category menu.

But if you add a "Product Option" to a product the quantity will disapear from the category menu too! If you wan't it to disappear from only certain products in the category menu you got to do it on your own :P

I think you can use the {if} tags in "buy_now.tpl" (like i did in "product.tpl") to remove the quantity.

harrismichael 10-12-2005 10:00 AM

Quote:

Originally Posted by maerik
Quote:

Originally Posted by harrismichael
Will this code pasted on the first page affect the categroy pages or the product pages .. or both ?


This code pasted in the correct place in "product.tpl" affects only the product description, not the category menu.



And how _do _ I get it to dissapear from only the category page ??

tron 10-13-2005 04:03 PM

[quote="maerik"][quote="Steele"]
Quote:

Originally Posted by Jon
You can edit out the quantity areas of your templates and instead use:

<input type="hidden" name="amount" value="1">


WORKS.

I replaced this code:

Code:

<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>


with this:

Code:

<input type="hidden" name="amount" value="1">

and deleted this to delete the "Quantity" before the box.
Code:

<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>



All times are GMT -8. The time now is 02:05 AM.

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