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

Add separate render function to CheckoutProgressBlock #869

Open
wants to merge 3 commits into
base: 8.x-2.x
Choose a base branch
from
Open

Add separate render function to CheckoutProgressBlock #869

wants to merge 3 commits into from

Conversation

MatthieuScarset
Copy link

Problem/Motivation

As a site builder, I would like to display the CheckoutProgressBlock on the Cart page (e.g /cart).

As of today, I can not do so. This block is restricted to checkout pages, where the commerce_product parameter is available.

Proposed solution

To separate the rendering of the CheckoutProgressBlock in another function. Currenlty, everything is inside the build() method.

This way, as a developer, I can create a child block and render the CheckoutProgressBlock with my own logic.

Example

Here is an example of a child block which load the current Cart if the default CheckoutProgressBlock rendered nothing.

https://gist.github.com/MatthieuScarset/c29672ee99805d955988bc150bb642ab

Useful for children plugins to display this Block on other routes than Checkout pages
Useful for children plugins to display this Block on other routes than Checkout pages
…Scarset/commerce into extends-checkout-progress-block
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.

1 participant