02.10.2014 13:42
|
|
celsoclaro
Name: celso
17.10.2011
Сообщения: 52
|
Error if character in quantity
Hi.
I'm using cartajax module and if I insert a character (like a or b or other) instead of a number in the quantity of a product and add it to cart, the cart goes empty, even if I had other products there. When I refresh the page the cart shows the products again.
Is this a bug? The inputbox shouldn't allow characters but only numbers.
Can you help me solve this?
Thanks
|
|
02.10.2014 15:29
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25941
|
Aw: Error if character in quantity
Not error
quantity 0
|
|
02.10.2014 16:21
|
|
celsoclaro
Name: celso
17.10.2011
Сообщения: 52
|
Aw: Error if character in quantity
The problem is that the cart shows this message "Your cart is empty" when, in fact, the cart has other products.
|
|
02.10.2014 21:18
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25941
|
Aw: Error if character in quantity
Need quantity > 0
See code
model cart.php
function add
....
if ($quantity <= 0){
return 0;
}
change to
if ($quantity <= 0){
JError::raiseNotice('', 'Error qty.');
return 0;
}
Последнее изменение: 02.10.2014 21:19
|
|
04.10.2014 15:01
|
|
celsoclaro
Name: celso
17.10.2011
Сообщения: 52
|
Aw: Error if character in quantity
That's it! Solved!
Thank you very much!
|
|
04.10.2014 15:14
|
|
celsoclaro
Name: celso
17.10.2011
Сообщения: 52
|
Aw: Error if character in quantity
Another question:
Using the same logic of your rply, I added this:
if ($quantity > $product->product_quantity) { JError::raiseNotice('', 'Quantity higher than stock. Products will be dispached after 15 days');
$updateqty = 1;
And it works but the products only show in cartajax after I refresh the page.
How can I make it show in cart in real time?
Thanks
|
|