magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Magento multishipping error message incompatible with update-shopping-cart.js

Open iwanvanzijderveld opened this issue 1 year ago • 12 comments

Preconditions and environment

  • 2.4.5
  • Magento Multishipping

Steps to reproduce

  1. Login as customer.
  2. Add 99 quantity of any item
  3. Proceed to cart
  4. Use multishipping checkout
  5. Update the quantity to reach the limit for multishipping quantity
  6. Submit

Expected result

Error message to be shown: The requested qty exceeds the maximum qty allowed in shopping cart

Actual result

Site keeps loading with error in console: Uncaught SyntaxError: Unexpected token 'M', "Maximaal a"... is not valid JSON at JSON.parse (<anonymous>) at $.<computed>.<computed>.onError (update-shopping-cart.js:112:37) at $.<computed>.<computed>.onError (widget.js:132:25) at $.<computed>.<computed>.<anonymous> (update-shopping-cart.js:90:26) at fire (jquery.js:3500:50) at Object.fireWith [as resolveWith] (jquery.js:3630:29) at done (jquery.js:9796:30) at XMLHttpRequest.<anonymous> (jquery.js:10057:37)

Additional information

In update-shopping-cart.js expects a JSON object in error_message, but the checkitems call returns a string.

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”.

iwanvanzijderveld avatar Sep 23 '22 09:09 iwanvanzijderveld

Hi @iwanvanzijderveld. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: 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.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Sep 23 '22 09:09 m2-assistant[bot]

Hi @engcom-Lima. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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.

m2-assistant[bot] avatar Sep 23 '22 10:09 m2-assistant[bot]

@magento give me 2.4.5 instance

engcom-Lima avatar Sep 23 '22 10:09 engcom-Lima

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

Hi @engcom-Lima, here is your Magento Instance: https://33b79a08a4003f65b54402289187559d.instances.magento-community.engineering Admin access: https://33b79a08a4003f65b54402289187559d.instances.magento-community.engineering/admin_6046 Login: 4194fbf1 Password: 15408d5e4aca

@magento give me 2.4-develop instance

engcom-Lima avatar Sep 23 '22 11:09 engcom-Lima

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

Hi @engcom-Lima, here is your Magento Instance: https://1185cbfa2eb3ebb16eb47bb20c591ae6.instances.magento-community.engineering Admin access: https://1185cbfa2eb3ebb16eb47bb20c591ae6.instances.magento-community.engineering/admin_8f90 Login: c340ff43 Password: 87cf7858e9e3

:heavy_check_mark: Issue confirmed

Issue got reproduced in Magento 2.4-develop && 2.4.5 .

Description: Magento multishipping error message incompatible with update-shopping-cart.js

Pre-requisite:

  • 2.4.5 and 2.4-develop should be installed.
  • Multi_shipping

Steps to reproduce:

  1. Login as customer.
  2. Add 99 quantity of any item
  3. Proceed to cart
  4. Use multishipping checkout
  5. Update the quantity to reach the limit for multishipping quantity
  6. Submit

Expected result: Error message to be shown: The requested qty exceeds the maximum qty allowed in shopping cart

Actual result: Site keeps loading with error in console: Uncaught SyntaxError: Unexpected token 'M', "Maximaal a"... is not valid JSON at JSON.parse (<anonymous>) at $.<computed>.<computed>.onError (update-shopping-cart.js:112:37) at $.<computed>.<computed>.onError (widget.js:132:25) at $.<computed>.<computed>.<anonymous> (update-shopping-cart.js:90:26) at fire (jquery.js:3500:50) at Object.fireWith [as resolveWith] (jquery.js:3630:29) at done (jquery.js:9796:30) at XMLHttpRequest.<anonymous> (jquery.js:10057:37)

Screenshots: Screenshot 2022-09-23 at 5 33 11 PM

Hence, confirming the issue.

Thanks

engcom-Lima avatar Sep 23 '22 12:09 engcom-Lima

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

github-jira-sync-bot avatar Sep 23 '22 12:09 github-jira-sync-bot

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

m2-assistant[bot] avatar Sep 23 '22 12:09 m2-assistant[bot]

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6744

github-jira-sync-bot avatar Sep 23 '22 12:09 github-jira-sync-bot

@magento I am working on this

rogerdz avatar Sep 24 '22 05:09 rogerdz

Hi @rogerdz! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

m2-assistant[bot] avatar Sep 24 '22 05:09 m2-assistant[bot]

@magento add to contributors team

rogerdz avatar Sep 24 '22 05:09 rogerdz

Hi @rogerdz! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

m2-assistant[bot] avatar Sep 24 '22 05:09 m2-assistant[bot]

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-6744 by the internal team Related commits: https://github.com/magento/magento2/search?q=AC-6744&type=commits

Based on the Jira ticket, the target version is 2.4.6.

Thanks

engcom-Hotel avatar Oct 21 '22 06:10 engcom-Hotel

I have an issue related to this and popup was not closing after clicking on the close button. So, I have updated script on the following file:

vendor/magento/module-checkout/view/frontend/web/js/action/update-shopping-cart.js Desktop screenshot (2)

May be It helps someone

mohitnavik avatar Nov 25 '22 13:11 mohitnavik