NaN displayed in quantity field

  • Posts: 196
  • Thank you received: 11
  • Hikashop Business
8 years 6 months ago #256887

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6
-- Browser(s) name and version -- : FF

When I remove the quantity in the quantity select field and then click om the + or - symbol, I get the text NaN in the quantity field. The + and - buttons then don't work any more. Is there an option that when a invalid option is filled automatically a the text get changed to "1".



I hope you have a fix.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #256917

Hi,

We've added a fix for that.
Add the code:

if(isNaN(current)){
							current = fieldEl.value = 0;
						}
after the line:
current = parseInt(current);
in the two places in the file administrator/components/com_hikashop/helpers/cart.php and that will fix the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 196
  • Thank you received: 11
  • Hikashop Business
8 years 6 months ago #257004

Thanks Nicolas! Works like a charm!

The only problem remaining is that when a invalid option is entered and the add to card button is pressed, no product is added to the cart. I get the popup saying the product is successful added to the cart, but the cart remains empty.

Just to make it compete idiot proof. ;)

Please Log in or Create an account to join the conversation.

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257053

Hi,

Thanks, it would require several changes in the js in administrator/components/com_hikashop/helpers/cart.php so we've added some checks for that on HikaShop 3.0

The following user(s) said Thank You: Rixters

Please Log in or Create an account to join the conversation.

  • Posts: 196
  • Thank you received: 11
  • Hikashop Business
8 years 6 months ago #257157

Looking forward to the new version!

Please Log in or Create an account to join the conversation.

Time to create page: 0.135 seconds
Powered by Kunena Forum