View Single Post
  #14  
Old 07-15-2004, 09:37 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

I implemented this before even finding this post. I did some Javascript validation to make sure they input greater than minimum amount.

Here's what I did. In 3.4.x, I changed the FormValidation at the top of skin1/customer/product.tpl to:
Code:
function FormValidation() { {/literal} {if $javascript_code} {$javascript_code} return false; {else} if(parseInt(document.orderform.amount.value) >= parseInt(document.orderform.minamount.value)) return true; else {literal} { {/literal} alert("{"The quantity you entered was invalid. Please enter the appropriate quantity to add this product to your cart."|replace:"\n":" "|replace:"\r":" "}"); return false; {literal} } {/literal} {/if} {literal} }

and I added this before the other hidden inputs:

Code:
{* BCSE Begin *} <input type=hidden name=minamount value="{$product.min_amount}"> {* BCSE End *}


FIXED! This should work now if you want to use a text box instead of a quantity drop down box.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote