Skip to content

Conversation

@JosephMaxwell
Copy link
Contributor

This fixes two bugs in relation to bundled products and a customer editing their selections in the cart.

Description

When a bundle item was edited after being in the cart, it was no different than loading the original product. There are two aspects to the fix:

  • Updating the JSON config to show the new quantities and selections
  • Adding selection array matching for checkboxes.

Fixed Issues (if relevant)

  1. On editing a Bundle product from shopping cart the user defined quantities of the options are overwritten #4942: On editing a Bundle product from shopping cart the user defined quantities of the options are overwritten

Manual testing scenarios

  1. Locate a bundled item with checkboxes
  2. Add that bundled item to the cart (with at least some checkboxes checked)
  3. Edit the item in the cart.
  4. Ensure that all items are checked and that the specified quantities match.

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 on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jun 6, 2018

CLA assistant check
All committers have signed the CLA.

@dmanners
Copy link
Contributor

Hi @JosephMaxwell thank you for this Pull Request. Would you be able to take a look at the test failures?

There were 2 failures:
1) Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer detected 2 violation(s): 
FILE: ...agento2/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------
 186 | ERROR | [x] Space before opening parenthesis of function call prohibited
 186 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Failed asserting that 2 matches expected 0.
/home/travis/build/magento/magento2/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php:212
2) Magento\Test\Php\LiveCodeTest::testCodeMess
PHP Code Mess has found error(s):
/home/travis/build/magento/magento2/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php:155	The method getJsonConfig() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.

@dmanners
Copy link
Contributor

Hi @JosephMaxwell just to let you know I have updated your branch to be up to date with 2.2-develop and have made some style changes while processing this PR. I have done a forced push to your repo so please take care if you want to make any further changes to this branch. Feel free to reach out to me if you need help.

@magento-engcom-team
Copy link
Contributor

Hi @JosephMaxwell. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

gelanivishal pushed a commit to gelanivishal/magento2 that referenced this pull request Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants