Jump to content

Edit History

Heiji

Heiji


Forget to enter file path to be edited.

Hi SolucionesWeb,
encountered the same problem on Prestashop versions 1.7.3 and 1.7.8.6 where I did some testing. The problem only seems to occur on the product page when changing the quantity, in the "quick view" of the article it seems to work correctly.
On the product page when changing the quantity the following javascript function is executed:

t.focusout(function(){(""===t.val()||t.val()<t.attr("min"))&&(t.val(t.attr("min")),t.trigger("change"))})

I think 't.val()' and 't.attr("min")' are compared as strings and not integers.
I tried modifying the function (/themes/classic/assets/js/theme.js) as follows and it seems to work.

t.focusout(function(){(""===t.val()||parseInt(t.val())<parseInt(t.attr("min")))&&(t.val(t.attr("min")),t.trigger("change"))})

It's a fix that I made quickly, I cannot guarantee that it will work without problems.

Heiji

Heiji

Hi SolucionesWeb,
encountered the same problem on Prestashop versions 1.7.3 and 1.7.8.6 where I did some testing. The problem only seems to occur on the product page when changing the quantity, in the "quick view" of the article it seems to work correctly.
On the product page when changing the quantity the following javascript function is executed:

t.focusout(function(){(""===t.val()||t.val()<t.attr("min"))&&(t.val(t.attr("min")),t.trigger("change"))})

I think 't.val()' and 't.attr("min")' are compared as strings and not integers.
I tried modifying the function as follows and it seems to work.

t.focusout(function(){(""===t.val()||parseInt(t.val())<parseInt(t.attr("min")))&&(t.val(t.attr("min")),t.trigger("change"))})

It's a fix that I made quickly, I cannot guarantee that it will work without problems.

×
×
  • Create New...