View Single Post
  #1  
Old 11-18-2015, 07:42 AM
 
npav npav is offline
 

Member
  
Join Date: Nov 2015
Posts: 15
 

Question Set product quantity by counting characters in a text field.

Hey guys,

I'm trying to change how quantity is calculated on the product page.

We sell dimensional letters, which are sold by the letter. For example, if someone orders "Elementary School", that's a quantity of 16 letters.

I'd like to calculate the quantity based on the characters that typed into a text field, rather than have the customer select the quantity from a dropdown and risk them mis-counting / mis-selecting the number of letters.

I've written the javascript to calculate the number of letters (minus spaces) from a text field, and am trying to get it integrated into x-cart through the "custom javascript" page in the admin area. It works on it's own, but I am not sure of the correct selectors to use to get it to work with x-cart.

Here is a link to a JSFiddle with the code I wrote: http://jsfiddle.net/npav42/n7khd6kr/3/

If there is anyone that could help out with this that would be a huge help!
__________________
X Cart 5.3.4.5
mountingstandoffs.com
Reply With Quote