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

Cart price rule created for logged in user incorrectly gets applied for not logged in user #38944

Open
dhruvi-prajapat1 opened this issue Jul 17, 2024 · 11 comments · May be fixed by #39103
Open
Assignees
Labels
Area: Cart & Checkout Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: dev in progress Progress: PR in progress Reported on 2.4.x 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

@dhruvi-prajapat1
Copy link

dhruvi-prajapat1 commented Jul 17, 2024

Preconditions (*)

  1. Magento dev-2.4-develop

Description (*)

There is a cart price rule that applies only to logged-in users, for example, a 5% discount. When the user is logged in and adds a product to the cart, the cart price rule will be applied. After that, the user is logged out automatically because the cookie lifetime has expired.
When the user visits the shop again, the product is still present in the cart, and the cart price rule is still applied to the product, even though the user is not logged in.

Screenshot-1:
image (1)

Screenshot-2:
image (2)

Screenshot-3:
image (3)

Screenshot-4:
image (4)

Steps to reproduce (*)

  1. In Marketing -> Cart Price Rules add rule for log in customers (select general customer group), for example 5% discount.(Shown in Screenshot - 1)
  2. In Stores -> Configuration ->Customers -> Persistent Shopping Cart -> set the following configuration: Enable Persistence - Yes , Clear Persistence on Sign Out – Yes (Shown in Screenshot - 2)
  3. In Stores -> Configuration -> General -> Web ->Default Cookie Settings ->Cookie Lifetime (For example 60 seconds) (Shown in Screenshot - 3)
  4. In the shop, create a customer account and add a product to the cart. At this time, the cart price rule will be applied, and the user will get a discount on the product.
  5. After that user will be log out according to the cookie lifetime (step – 3)
  6. Open the shop, at this time user is not log in into the shop, but user can still see the product into the cart with applied discount.(Shown in Screenshot - 4)

Expected result (*)

When user is logged out cart price rule should not applied and cart should be empty.

Actual result (*)

Here user is logged out but still we can see the product in the cart and cart price rule is still applied.

Copy link

m2-assistant bot commented Jul 17, 2024

Hi @dhruvi-prajapat1. 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. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


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.

Copy link

m2-assistant bot commented Jul 17, 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- 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.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.x Indicates original Magento version for the Issue report. label Jul 17, 2024
Copy link

m2-assistant bot commented Jul 17, 2024

Hi @engcom-Dash. 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).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. 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!

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

Copy link

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

Copy link

@engcom-Dash
Copy link

engcom-Dash commented Jul 18, 2024

Hi @dhruvi-prajapat1

Thanks for reporting and collaboration.

Verified the issue on Magento 2.4 dev instance and the issue is reproducable.

Cart price rule created for logged in user incorrectly gets applied for not logged in user . Hence, confirming the issue.

Steps to reproduce (*)

  1. In Marketing -> Cart Price Rules add rule for log in customers (select general customer group), for example 5% discount.
  2. In Stores -> Configuration ->Customers -> Persistent Shopping Cart -> set the following configuration: Enable Persistence - Yes , Clear Persistence on Sign Out – Yes
  3. In Stores -> Configuration -> General -> Web ->Default Cookie Settings ->Cookie Lifetime (For example 60 seconds)
  4. In the shop, create a customer account and add a product to the cart. At this time, the cart price rule will be applied, and the user will get a discount on the product.
  5. After that user will be log out according to the cookie lifetime (step – 3)
  6. Open the shop, at this time user is not log in into the shop, but user can still see the product into the cart with applied discount.

Please refer the attached screenshots.

Cart price rule:

Screenshot 2024-07-18 at 3 15 59 PM Screenshot 2024-07-18 at 3 17 20 PM

Setting cookie lifetime:

Screenshot 2024-07-18 at 3 18 24 PM

Loggedin customer:

Screenshot 2024-07-18 at 3 23 46 PM Screenshot 2024-07-18 at 3 24 03 PM

Logged out customer :

Screenshot 2024-07-18 at 3 29 06 PM

@engcom-Dash engcom-Dash added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Ui Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Cart & Checkout labels Jul 18, 2024
@github-jira-sync-bot
Copy link

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

Copy link

m2-assistant bot commented Jul 18, 2024

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

@engcom-Dash engcom-Dash added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Jul 18, 2024
@Mohamed-Asar
Copy link
Contributor

@magento i'm working on this

@engcom-Bravo
Copy link
Contributor

Hi @rogerdz,

Internal team has started to work on it

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cart & Checkout Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: dev in progress Progress: PR in progress Reported on 2.4.x 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
Status: Ready for Development
Development

Successfully merging a pull request may close this issue.

6 participants