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

Magento 2.4.7 update (mini)cart no decimal qty allowed #39236

Open
1 of 5 tasks
Jilco opened this issue Oct 3, 2024 · 15 comments · May be fixed by #39669
Open
1 of 5 tasks

Magento 2.4.7 update (mini)cart no decimal qty allowed #39236

Jilco opened this issue Oct 3, 2024 · 15 comments · May be fixed by #39669
Assignees
Labels
Area: Cart & Checkout Component: Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@Jilco
Copy link

Jilco commented Oct 3, 2024

Preconditions and environment

  • Magento 2.4.7-p2
  • Webshop sells fabrics per 10 cm with minimum of 0.5 meter

Steps to reproduce

  1. Add product with qty 0.5 to cart
  2. Click on change (pencil) in minicart
  3. Change qty to 0.7 and click update

Expected result

Expected that 0.7 is in cart

Actual result

In cart is 1

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Oct 3, 2024

Hi @Jilco. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@Jilco
Copy link
Author

Jilco commented Oct 3, 2024

@magento give me 2.4.7 instance

@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. label Oct 4, 2024
@engcom-Bravo
Copy link
Contributor

Hi @Jilco,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Screenshot 2024-10-04 at 09 19 00

Product with quantity 0.7 in cart.

Kindly recheck the issue in Latest 2.4-develop instance and elaborate the steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Oct 4, 2024
@engcom-Bravo engcom-Bravo moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Oct 4, 2024
@Jilco
Copy link
Author

Jilco commented Oct 4, 2024

@engcom-Bravo have jou also tried tot change the 0.7 to 0.8 in the minicart and/or with the pencil? That is the problem

@Jilco
Copy link
Author

Jilco commented Oct 4, 2024

@magento give me 2.4-develop instance

@Jilco
Copy link
Author

Jilco commented Oct 4, 2024

image
It also states to use 0 or 1

@Jilco
Copy link
Author

Jilco commented Oct 5, 2024

@engcom-Bravo any updates? Customers cannot configure cart items now with decimals..

@engcom-Bravo engcom-Bravo self-assigned this Oct 8, 2024
Copy link

m2-assistant bot commented Oct 8, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

Hi @Jilco,

Thanks for your update.

We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.

Screen.Recording.2024-10-08.at.10.10.53.mov

Please enable Qty Uses Decimals under Advanced inventory as stated in above video after that we can able to add the decimal quantity for the product.

Thanks.

@Jilco
Copy link
Author

Jilco commented Oct 9, 2024

@engcom-Bravo i'm almost sure it has to do with the locale option (in my case set to The Netherlands). Due to that the comma and point in a number will be else (comma is decimal seperator in NL instead of thousand seperator in US).

When i add below to vendor/magento/framework/Filter/LocalizedToNormalized.php the problem is solved

 public function filter($value)
{
    **$value = (double)str_replace(",",".",$value);**

    if (is_numeric($value)) {
        $numberParse = new NumberParse($this->_options['locale'], NumberFormatter::PATTERN_DECIMAL);
        return (string) $numberParse->filter($value);
    } elseif ($this->_options['date_format'] === null && strpos($value, ':') !== false) {
        $formatter = new IntlDateFormatter(
            $this->_options['locale'],
            IntlDateFormatter::SHORT,
            IntlDateFormatter::SHORT
        );
        $formatter->setPattern($this->_options['date_format']);
        return $formatter->format(strtotime($value));
    } elseif ($this->checkDateFormat($value)) {
        return $this->parseDate($value);
    }

    return $value;
}

So please test again with other locale option (nl-NL)

@engcom-Bravo
Copy link
Contributor

HI @Jilco,

Thanks for your update.

We have verified the issue in the Latest 2.4-develop instance with locale option (nl-NL) and the issue is reproducible.Kindly refer the attached video.

Screen.Recording.2024-10-14.at.12.17.21.mov

When we are updating the qty in the mini cart it is not updating.

Hence Confirming the issue.

Thanks.

@engcom-Bravo engcom-Bravo removed the Issue: needs update Additional information is require, waiting for response label Oct 14, 2024
@engcom-Bravo engcom-Bravo added Component: Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Area: Cart & Checkout and removed Issue: ready for confirmation labels Oct 14, 2024
@engcom-Bravo engcom-Bravo moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Oct 14, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-13238 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Oct 14, 2024

✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@quterorta
Copy link
Contributor

@magento I am working on this

quterorta added a commit to quterorta/magento2 that referenced this issue Feb 28, 2025
- fixed issue with the wrong parsing float values (depends on '.' or ',')
quterorta added a commit to quterorta/magento2 that referenced this issue Feb 28, 2025
- fixed issue with the wrong parsing float values (depends on '.' or ',')
@quterorta
Copy link
Contributor

@magento run all tests

quterorta added a commit to quterorta/magento2 that referenced this issue Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cart & Checkout Component: Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants