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

Reduced multiple dispatch events in login form. #1206

Merged
merged 1 commit into from
Dec 31, 2020

Conversation

kiatng
Copy link
Contributor

@kiatng kiatng commented Sep 10, 2020

Description (*)

The login forms called these 2 methods multiple times:

$this->helper('customer')->isRegistrationAllowed(); // ref 4 times in custumer/login.phtml, 6 times in onepage/login.phtml
$this->getQuote()->isAllowedGuestCheckout() // ref 9 times in onepage/login.phtml

Both methods dispatch events, see customer/data and checkout/data.

So performance can improve by making one call, especially when there are observers.

Related Pull Requests

None.

Fixed Issues (if relevant)

  1. Fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. Not applicable.
  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)

@kiatng kiatng added performance Performance related Template : rwd Relates to rwd template labels Sep 10, 2020
@github-actions github-actions bot added the Component: Persistant Relates to Mage_Persistant label Sep 10, 2020
Copy link
Contributor

@kkrieger85 kkrieger85 left a comment

Choose a reason for hiding this comment

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

Nice improvement 👍

@tmotyl tmotyl merged commit e1c10c5 into OpenMage:1.9.4.x Dec 31, 2020
@github-actions
Copy link
Contributor

Unit Test Results

1 files  1 suites   0s ⏱️
0 tests 0 ✔️ 0 💤 0 ❌
2 runs  2 ✔️ 0 💤 0 ❌

Results for commit e1c10c5.

@sreichel sreichel added this to the Release 19.4.10 / 20.0.6 milestone Dec 31, 2020
@kiatng kiatng deleted the optimize_login_form branch January 1, 2021 08:58
@AlterWeb
Copy link
Contributor

Is there a reason this improvement wasn't made in the other theme's? base/default and default/iphone

@tmotyl
Copy link
Contributor

tmotyl commented Jan 20, 2021

@AlterWeb can you provide a PR which solves it

@AlterWeb
Copy link
Contributor

@tmotyl No problem, the pull request number is #1407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Persistant Relates to Mage_Persistant performance Performance related Template : rwd Relates to rwd template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants