Shopping cart library and input field formating |
[eluser]tmengttm[/eluser]
Hi all, Update: Previously, i was asking: is there a way to extend/modify ci shopping cart library to make "qty" accept double value. Because it seemed to me that "qty" only accepts integer value. thanks jmadsen, the problem is solved. It turns out that I just need to change the code in system/library/cart file... Now my questions is: Is there a way to format input field in such a way: a number with 1 decimal place?
[eluser]jmadsen[/eluser]
At first glance, lines 161 & 332 use a preg_replace to strip non-numerics, including decimals. If you extend & change those to: Code: $items['qty'] = trim(preg_replace('/([^0-9\.])/i', '', $items['qty'])); I think it should work for you.
[eluser]tmengttm[/eluser]
Hi Jmadsen, Thanks, I just found that. I edited my question a bit. now i want to know is there a way to format input field. i.e when user do input, they'll see the format is sth like: __._ , and whatever they input first will be pushed to decimal place first, then fill other digits.. Thanks
[eluser]jmadsen[/eluser]
uhm...did you just edit & completely change your question? this was about extending the shopping cart a moment ago
[eluser]jmadsen[/eluser]
Uhm.... don't do that again, ok? When you post a question, leave it there for others.
[eluser]weboap[/eluser]
http://digitalbush.com/projects/masked-input-plugin/ |
Welcome Guest, Not a member yet? Register Sign In |