View Single Post
  #2  
Old 11-19-2015, 09:10 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Set product quantity by counting characters in a text field.

The "Custom JavaScript" page is definitely not the way to go for such a complex modification.

Instead you should create a custom module that loads your JavaScript file on the product page: http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files
The tutorial explains how to load a custom JS file on every site page, but in your case you should inject it into one of the widget classes that are displayed on the product page only. Perhaps, the quantity box is the widget that you should extend from your module.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote