Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug minimum quantity to purchase a product: prestashop thinks 102 is lower than 50 #28531

Open
2 tasks done
jmrubio96 opened this issue May 19, 2022 · 5 comments
Open
2 tasks done
Labels
1.7.8.0 Affects versions Bug Type: Bug Customized Product type: issue about customized products FO Category: Front Office Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Needs Specs Status: issue needs to be specified Old Products Page Concerns the old product page Verified The issue has been reproduced

Comments

@jmrubio96
Copy link

jmrubio96 commented May 19, 2022

Prerequisites

Describe the bug and add screenshots

From version 1.7.8.0 onwards, a bug appears in the minimum quantity for the purchase of a product.
As long as you set the minimum quantity between 1 and 10 there is no problem, but from 11onwards a bug appears when buying the product

producto-presta-google-chrome-2022-05-19-10-32-16_W6vDBUe8.mp4

.

Expected behavior

No response

Steps to reproduce

We put as example a minimum quantity for sale of 50. Then we go to buy the product.

If we set less than 50 there is no problem, it corrects your quantity and put 50 again.
If you set a quantity between 50 and 99 there is no problem either.
If you enter a quantity between 100 and 499, it deletes your quantity and set it back to 50.
If you enter a quantity of 500 or higher, there is no problem either.

if you add a quantity between 100 and 499 to your cart, it doesn't add it to your cart. It adds 50.
If you decide to change that amount in the cart page it will make a duplicity of the same product, adding the product with the quantity 50 and another one with the rest until you reach the amount you added. For example, if you add 120 it will create a cart with the product with quantity 50 and another one with the same product with quantity 70.

QA referent: @AureRita for more details

PrestaShop version(s) where the bug happened

1.7.8.6

PHP version(s) where the bug happened

7.4

If your bug is related to a module, specify its name and its version

No response

@jmrubio96 jmrubio96 added Bug Type: Bug New New issue not yet processed by QA labels May 19, 2022
@hibatallahAouadni
Copy link
Contributor

Hello @jmrubio96

Thanks for reporting the issue!
Indeed it's a regression since 1.7.8.0 😞 I’ll add this to the debug backlog so that it’s fixed.

Please be aware that due to the high number of reported issues, some bugs might take a very long time to be resolved. If this issue is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider hiring a specialist to help you.

If you manage to get the problem fixed, then please contribute the fix back to the project as a Pull Request. Remember that the more people contribute, the better PrestaShop becomes for everyone.

Thank you

@hibatallahAouadni hibatallahAouadni added Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification FO Category: Front Office Needs Specs Status: issue needs to be specified Old Products Page Concerns the old product page Regression Type: regression Customized Product type: issue about customized products 1.7.8.0 Affects versions Verified The issue has been reproduced and removed New New issue not yet processed by QA labels May 19, 2022
@hibatallahAouadni hibatallahAouadni added this to Regression issues 1.7.8.x in Backlog Patch via automation May 19, 2022
@MatShir MatShir removed this from Regression issues 1.7.8.x in Backlog Patch Aug 17, 2022
@matks matks changed the title Bug minimum quantity Bug minimum quantity to purchase a product: prestashop thinks 102 is lower than 50 Sep 5, 2022
@FabienPapet
Copy link
Member

Hello,

I tried to reproduce the issue and I think this is not a regression. If you type fast enough the quantity you want, everything is working fine, even with numbers like 120, etc.

When you are editing the desired quantity, prestashop waits for 300ms before sending the value you've entered to the server and if the quantity is not valid, resets the the minimal quantity. If you are editing this value while the value is being checked (i.e you are not typing fast-enough). Then the value you've entered will be reset.

As it is expected (and maybe weird) behavior it is not a regression. Perhaps the delay can / should be changed, but it will be in a future release and will not be in 1.7.8

Thank you for understanding.

@jolelievre jolelievre added the Waiting for QA Status: action required, waiting for test feedback label Sep 6, 2022
@AureRita
Copy link
Contributor

AureRita commented Sep 7, 2022

Hello @FabienPapet ,

as you can see on this video, we still have some issue even if I write new things before the 300ms :

bug.present.mp4

Moreover, this issue isn't here if you select minimum quantity = 1. I think the quantity of 123 should be a desire quantity but it still rejected. I think also that the client can't say to them users : "you have to choose a good quantity faster else you've got a bad quantity of your product".

Currently, we put this one with 1.7.8.0 label because it's the oldest version where the issue is finded.

@AureRita AureRita added Waiting for dev Status: action required, waiting for tech feedback and removed Waiting for QA Status: action required, waiting for test feedback labels Sep 7, 2022
@matks matks removed the Waiting for dev Status: action required, waiting for tech feedback label Oct 16, 2022
@MatShir MatShir removed the Regression Type: regression label Oct 28, 2022
@ilario-santa
Copy link

ilario-santa commented Jan 29, 2024

HI

Could you tell me if anyone has solved this bug, it's been almost two years, also compare in version 8.2

@ilario-santa
Copy link

it wasn't a complicated thing
just change this line in the theme.js
("" === t.val() || t.val() < t.attr("min")) && (t.val(t.attr("min")), t.trigger("change"))
with
("" === t.val() || **parseInt**(t.val()) < **parseInt**(t.attr("min"))) && (t.val(t.attr("min")), t.trigger("change"))

I hope it helps someone else

ciao
ilario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.8.0 Affects versions Bug Type: Bug Customized Product type: issue about customized products FO Category: Front Office Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Needs Specs Status: issue needs to be specified Old Products Page Concerns the old product page Verified The issue has been reproduced
Projects
None yet
Development

No branches or pull requests

8 participants