View Single Post
  #25  
Old 08-30-2012, 07:23 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: X-Cart Adapt Template

Quote:
In the home page, the "new" and "random" product lists have quantity boxes which are always displayed even though the stock is 0. When a customer fills in the quantity number and press "add to cart", the page just refreshed itself. I want to make it consistent with the rest of the site which displays "Out of stock" if qty=0. This also applies to the related products list in the product detail page.

skin/adapt/custom/home_new_products.tpl
skin/adapt/custom/home_random_products.tpl
skin/adapt/modules/Recommended_Products/recommends.tpl
skin/adapt/modules/Upselling_Products/related_products.tpl

In all files, replace...

Code:
<form action="cart.php" name="add_{$product.productid}" method="get" class="form-inline" autocomplete="off"> <input name="mode" type="hidden" value="add" /> <input name="productid" type="hidden" value="{$product.productid}" /> <input name="amount" type="text" value="1" class="input-tiny" /> <button class="btn {$config.Adapt.adapt_buy_now_button}" type="submit">{$lng.lbl_add_to_cart}</button> </form>

With...

Code:
{if $product.avail ne "0"} <form action="cart.php" name="add_{$product.productid}" method="get" class="form-inline" autocomplete="off"> <input name="mode" type="hidden" value="add" /> <input name="productid" type="hidden" value="{$product.productid}" /> <input name="amount" type="text" value="1" class="input-tiny" /> <button class="btn {$config.Adapt.adapt_buy_now_button}" type="submit">{$lng.lbl_add_to_cart}</button> </form> {else} <span class="out-of-stock">{$lng.txt_out_of_stock}</span> {/if}

Quote:
Also, I'd like the quantity boxes to be pull down menus with only the available quantity in stock as the available option.

I will look into this, it needs custom coding, you'll have to make do with input qty boxes for now.
__________________
xcartmods.co.uk
Reply With Quote