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

Configurable: remove unused double foreach loop #4008

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hanmac
Copy link
Contributor

@Hanmac Hanmac commented May 24, 2024

Description (*)

The double foreach does nothing of value inside the Block:

  • it just calls $this->_preparePrice which just does format the price value.
  • but then it does nothing with it. Even where it supposed to go inside $_prices variable hasn't been working for 16 years since Magento 1.1 when this file was created.
  • In theory, the variables aren't even used and could be removed too. But that might be more of a BC break.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Obsolete code in block for configurable products #2246

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label May 24, 2024
* @var array
*/
protected $_prices = [];

/**
* Prepared prices
*
* @deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

_resPrices is used on line 167

Screenshot 2024-05-24 alle 18 35 15

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but only is set, it is never used (that's why i didn't removed the variables yet)

Copy link
Contributor

Choose a reason for hiding this comment

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

@Hanmac true, should the _preparePrice call be removed too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think yeah, but that might be for later MR

@fballiano
Copy link
Contributor

after reading the code I did a few tests and couldn't see any problem

@kiatng kiatng requested a review from elidrissidev June 4, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Relates to Mage_Catalog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete code in block for configurable products
2 participants