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)
-   -   Qty Removal in product.tpl (https://forum.x-cart.com/showthread.php?t=47407)

Freakmode 05-07-2009 01:08 AM

Qty Removal in product.tpl
 
Hi

Does anyone know how to remove the quantity dropdown from this template?

We use a different product template for a few products (with X-conf) which only adds 1 by default so I need to remove the QTY box as it serves no purpose.

Thanks

Lingerieblowout 05-07-2009 06:35 AM

Re: Qty Removal in product.tpl
 
have you tried this

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

Of course you have to remove some code first :)

Freakmode 05-07-2009 06:43 AM

Re: Qty Removal in product.tpl
 
Yep got it working now - chunk of code at the top needs ripping out and replacing.

Also managed to remove the "Add to Cart" and "Wishlist" buttons now, so it just shows add to configuration.

Nearly got it looking like we need it.

Thanks again

Lingerieblowout 05-07-2009 06:50 AM

Re: Qty Removal in product.tpl
 
Good .. I been meaning to write a mod that takes care of displaying or not display based on the adding product page as some folks want it on some products but not others.

Freakmode 05-07-2009 07:17 AM

Re: Qty Removal in product.tpl
 
I needed it to work with X-configurator.

By default it shows QTY drop down but only adds 1 so there was no need to show it.

Also X-conf added a third button "Add to configuration" below the standard "add to Cart and "Add to Wishlist" buttons which the user is not supposed to click.

Problem is you automatically click on add to cart so they had to go as well. Got it working with the "Multiple product listing" mod from Websitecm.

Works a treat and cheaper than the $200 Qualiteam wanted

digiemp 09-29-2009 06:38 PM

Re: Qty Removal in product.tpl
 
What code, exactly, does one have to remove in order to get this to work?
I can effectively remove the word "Quantity" but the drop down box still remains.
Then I comment out a bit more code and the box jumps to the top of the screen.
I am unsure on what to remove and exactly where to add the code below.

Thanks for your help.

Quote:

Originally Posted by Lingerieblowout
have you tried this

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

Of course you have to remove some code first :)


cflsystems 09-29-2009 07:03 PM

Re: Qty Removal in product.tpl
 
This is the code you need to remove
Code:


 
<script type="text/javascript">
<!--
var min_avail = {$product.appearance.min_quantity|default:1};
var avail = {$product.appearance.max_quantity|default:1};
var product_avail = {$product.avail|default:"0"};
-->
</script>
                  <select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && ($product_options ne '' || $product_wholesale ne '')} onchange="javascript: check_wholesale(this.value);"{/if}>
                    {section name=quantity loop=$product.appearance.loop_quantity start=$product.appearance.min_quantity}
                      <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
                    {/section}
                  </select>


then put this one instead
Code:

<script type="text/javascript">
<!--
var min_avail = 1;
var avail = 1;
var product_avail = 1;
-->
</script>
                  <input type="hidden" name="amount" value="1" />
 
 


digiemp 09-29-2009 07:44 PM

Re: Qty Removal in product.tpl
 
Worked like a charm, thanks. I suppose I find the same bit of code to remove the Quantity Box from the products list page?

cflsystems 09-29-2009 08:08 PM

Re: Qty Removal in product.tpl
 
It will be in buy_now.tpl and is siimilar

artistwantab 11-30-2010 02:30 PM

Re: Qty Removal in product.tpl
 
OK this may seem noobish...but which product.tpl file do I correct.

There is nearly 40 of them....

cflsystems 11-30-2010 07:22 PM

Re: Qty Removal in product.tpl
 
Are you talking about 4.2.1 or 4.4.1?
4.2.1 has only one in skin1/customer/main
4.4.1 has many but you need the one in the skin you are using

artistwantab 01-11-2011 01:53 PM

Re: Qty Removal in product.tpl
 
4.4.1...

It took me this long to get the upgrade working properly...hehe.

HAS 02-25-2011 08:00 AM

Re: Qty Removal in product.tpl
 
Quote:

Originally Posted by cflsystems
It will be in buy_now.tpl and is siimilar


Hello,

I am trying to hide the quantity-dropdown box in productslist.tpl, so I put in next code (removed the original part):

Code:


<script type="text/javascript">
<!--
var min_avail = 1;
var avail = 1;
var product_avail = 1;
-->
</script>
                  <input type="hidden" name="amount" value="1" />


This works fine exept when a product has a minimum order quantity for example lets say 10pcs then an error shows up, and the product will not be added to the cart.
When I change the value="1" into value="10" the cart wil be updated with 10pcs as long as the MOQ is set less than 10pcs in the productdetails.
But then all the products with MOQ <10pcs will be added to the cart with 10x
Is there a way to fix this problem? What exactly does :
Code:

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

upupcreative 06-27-2011 11:31 AM

Re: Qty Removal in product.tpl
 
So, I'd like to remove the quantity selector ONLY for one category in my shop. So basically I'm going to modify product_details.tpl to achieve the following logic:

if category == wedding then:
quantity = 1
and hide the quantity input box

So here's what I think I need to add:

{if $product.categoryid == 4}
<script type="text/javascript">
<!--
var min_avail = 1;
var avail = 1;
var product_avail = 1;
-->
</script>
<input type="hidden" name="amount" value="1" />

{/if}

HOWEVER: I'm not sure where to add it and what to do with what's already there.

I appreciate any guidance - I considered just playing around to figure it out but I really don't want to spend the afternoon undoing things if I don't need to.

Thanks,
Julie

makenoiz 10-02-2011 08:01 PM

Re: Qty Removal in product.tpl
 
I just hid mine with css!

info@ausnetit.com.au 10-27-2011 03:11 AM

Re: Qty Removal in product.tpl
 
Hi,

How you do that?

Thanks,

info@ausnetit.com.au 10-27-2011 03:22 AM

Re: Qty Removal in product.tpl
 
HI,

How do we remove

Our price:

Options
Quantity (100 available)
  • Add to cart button or link to Contact us page?
from V 4.4.3?

makenoiz 10-27-2011 01:57 PM

Re: Qty Removal in product.tpl
 
I removed my quantity input box row by adding the following in my skins css file:
Code:

.product-details tr.quantity-row{display:none;}

I tested to make sure it would still default to quantity 1 if the customer clicked buy button.


All times are GMT -8. The time now is 06:33 PM.

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