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

Feature: Add hyva_react_checkout_config event to be able to alter the checkout config #317

Conversation

michielgerritsen
Copy link
Contributor

Recently in version 1.1.2 the ability to support shipping methods was added, which is great. For some shipping methods implementations, we need access to configuration items. In the regular Magento checkout, any module can dump any setting into the window.checkoutConfig configuration. The current React checkout only passes the payment configuration.

In this PR, I've added an event that allows developers to extend the checkoutConfig however needed.

]);

$this->eventManager->dispatch('hyva_react_checkout_config', ['transport' => $transport]);
Copy link
Collaborator

@rajeev-k-tomy rajeev-k-tomy Oct 17, 2022

Choose a reason for hiding this comment

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

It is good we pass $checkoutConfig as well. Because there are occasions where we need to pass other data from the $checkoutConfig as well. So that will help to avoid a dependency injection in the observer in order to load it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree! I've just updated the PR to include it as well.

@rajeev-k-tomy rajeev-k-tomy merged commit 7878740 into hyva-themes:main Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants