Skip to content

Conversation

sasha19957099
Copy link
Contributor

@sasha19957099 sasha19957099 commented Jan 26, 2021

Description (*)

Changed key in sales rules validator to avoid incorrect cached results

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Cart Price rule not working as expected for joined mutation for configurable options update #31779

Manual testing scenarios (*)

  1. use the latest magento with the sample data
  2. add to cart 1 product (WJ01-S-Yellow)
  3. make sure you have active cart price rule (for example 20% OFF Ever $200-plus purchase!* with magento sampledata )
  4. Run query
    mutation UpdateConfigurableOptions(
    $cartId: String!
    $cartItemId: Int!
    $parentSku: String!
    $variantSku: String!
    $quantity: Float!
    ) {
    addConfigurableProductsToCart(
    input: {
    cart_id: $cartId
    cart_items: [
    {
    data: { quantity: $quantity, sku: $variantSku }
    parent_sku: $parentSku
    }
    ]
    }
    ) {
    cart {
    id
    total_quantity
    available_payment_methods {
    code
    title
    }
    prices {
    grand_total {
    value
    currency
    }
    }
    }
    }
    removeItemFromCart(input: { cart_id: $cartId, cart_item_id: $cartItemId }) {
    cart {
    id
    total_quantity
    available_payment_methods {
    code
    title
    }
    prices {
    grand_total {
    value
    currency
    }
    }
    }
    }
    }

variables
{
"cartId":"HrDsuEYzcAfHDtP7Cy09Vhf0gbI0VgVU",
"cartItemId":13,
"parentSku":"WJ01",
"variantSku":"WJ01-S-Red",
"quantity":2
}

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

…tion for configurable options update - changed key for validator
@m2-assistant
Copy link

m2-assistant bot commented Jan 26, 2021

Hi @sasha19957099. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests 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 Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

…tion for configurable options update - added test
@sasha19957099
Copy link
Contributor Author

@magento run all tests

…tion for configurable options update - fixed unit tests
@sasha19957099
Copy link
Contributor Author

@magento run all tests

…tion for configurable options update - fixed unit tests
@sasha19957099
Copy link
Contributor Author

@magento run all tests

* @return $this
*/
public function init($websiteId, $customerGroupId, $couponCode)
public function init($websiteId, CartInterface $quote): self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid we can't do this in a patch release. no protected and especially public methods modification. Won't be able to approve SVC
At most we could add an optional parameter which is CartInterface $quote = null
Also don't change the return type, leave self out

@gabrieldagama gabrieldagama added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Mar 18, 2021
@engcom-Charlie engcom-Charlie self-assigned this Apr 1, 2022
@engcom-Charlie
Copy link
Contributor

Hi @sasha19957099,

Thank you for your contribution!

In reproduction steps of this issue, you are using addConfigurableProductsToCart mutation.

As per dev docs it is recommended of using addProductsToCart mutation rather than addConfigurableProductsToCart mutation.

Hence before proceeding with this PR, in discussion with the PO for the same. Till that time moving this PR to On Hold.

Thank you!

CC: @cpartica

@engcom-Charlie
Copy link
Contributor

As per @cpartica confirmation we need to process it ahead so moving this PR back to Changes Requested.

Thank you!

@engcom-Charlie
Copy link
Contributor

Hi @sasha19957099,

Thank you for your contribution!

As per the review comments, we can not go with the given solution in this PR as its making modifications in public methods.

image

Do you want to propose any other solution for the linked issue.

Thank you!

@engcom-Charlie
Copy link
Contributor

As we didn't got any reply on above comment, due to inactivity, closing this PR now.

Please reopen and update if you wish to continue.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: SalesRule PAP Partners acceleration program Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Project: GraphQL Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cart Price rule not working as expected for joined mutation for configurable options update
5 participants