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

Coupon code empty after update of sales rule through rest #35298

Closed
1 of 5 tasks
websecureNL opened this issue Apr 13, 2022 · 12 comments
Closed
1 of 5 tasks

Coupon code empty after update of sales rule through rest #35298

websecureNL opened this issue Apr 13, 2022 · 12 comments
Labels
Area: APIs Component: Api Use with concrete module component label E.g. "Component: Api" + "Catalog" Component: SalesRule 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: done Reported on 2.4.3 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

@websecureNL
Copy link

Preconditions (*)

1.Magento ver. 2.4.3

Steps to reproduce (*)

  1. Create a new disabled Cart Price Rule through API - endpoint POST: /rest/V1/salesRules/

Sample payload
{"rule":{"name":"This is the coupon name","store_labels":[{"store_id":0,"store_label":"Gift Card $20"}],"website_ids":[1],"customer_group_ids":[0],"from_date":"","to_date":"","uses_per_customer":0,"is_active":false,"stop_rules_processing":true,"is_advanced":true,"simple_action":"cart_fixed","discount_amount":20,"discount_qty":0,"discount_step":0,"apply_to_shipping":false,"is_rss":false,"coupon_type":"SPECIFIC_COUPON","use_auto_generation":false,"uses_per_coupon":0}}

  1. Create a new Coupon for newly created sales rule through API - endpoint POST: /rest/V1/coupons/

Sample payload
{"coupon":{"rule_id":insert rule_id,"code":"GC1-FD2SD","usage_limit":0,"usage_per_customer":0,"times_used":0,"is_primary":true,"type":0,"extension_attributes":{}}}

  1. Update the status of the Cart Price Rule to enabled through Cart Price Rule through API - endpoint PUT /rest/V1/salesRules/{rule_id}

Sample payload
{"rule":{"name":"New Name","from_date":"2022-01-01","to_date":"2022-10-10","is_active":true}}

Expected result (*)

  1. Expected that only updated values would be applied (existing Cart Price Rule got a status change from disabled to enabled with a from_date and to_date) and that the existing coupon code would still be attached.

Actual result (*)

  1. After updating the Cart Price Rule the coupon code is removed from the rule.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • 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”.
@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2022

Hi @websecureNL. 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.


⚠️ 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.

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

@websecureNL
Copy link
Author

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

@magento-deployment-service
Copy link

Hi @websecureNL. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @websecureNL, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@websecureNL
Copy link
Author

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

@magento-deployment-service
Copy link

Hi @websecureNL. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @websecureNL, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@engcom-November engcom-November self-assigned this Apr 13, 2022
@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2022

Hi @engcom-November. 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).

    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.

@engcom-November
Copy link

engcom-November commented Apr 13, 2022

Verified the issue on Magento 2.4-develop branch and the issue is reproducible:
Created Inactive/disabled cart price rule using POST: /rest/V1/salesRules/
Created Coupon for above rule using /rest/V1/coupons
image
Updated rule - Active, given from date and to date using PUT : /rest/V1/salesRules/{ruleID}
Sample payload:
{ "rule": { "rule_id": 6, "name": "refredv fewfewf name", "store_labels": [ { "store_id": 0, "store_label": "GiftCarddd $50", "extension_attributes": {} } ], "description": "dscvsdfcvsd", "website_ids": [ 0 ], "customer_group_ids": [ 0 ], "from_date": "2022-01-01", "to_date": "2022-10-01", "uses_per_customer": 0, "is_active": true, "stop_rules_processing": true, "is_advanced": true, "sort_order": 0, "discount_amount": 56, "discount_qty": 8, "discount_step": 0, "apply_to_shipping": true, "times_used": 0, "is_rss": true, "coupon_type": "string", "use_auto_generation": true, "uses_per_coupon": 0, "simple_free_shipping": "string", "extension_attributes": {} } }

Issue: Cart Price rule is updated as expected but coupon code is removed.
image
image

@engcom-November engcom-November added Component: SalesRule Component: Api Use with concrete module component label E.g. "Component: Api" + "Catalog" Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.3 Indicates original Magento version for the Issue report. Area: APIs Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 13, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Apr 13, 2022
@github-jira-sync-bot
Copy link

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

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2022

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

@sdzhepa sdzhepa added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Apr 14, 2022
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Apr 14, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Apr 22, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Apr 22, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Apr 25, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Apr 25, 2022
@engcom-Alfa
Copy link
Contributor

Hello @websecureNL

As I can see this issue got fixed in the scope of the internal Jira ticket AC-2845 by the internal team
Related commits: b092dd6

Based on Jira target version is 2.4.5

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: APIs Component: Api Use with concrete module component label E.g. "Component: Api" + "Catalog" Component: SalesRule 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: done Reported on 2.4.3 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
Development

No branches or pull requests

5 participants