Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Add separate render function to CheckoutProgressBlock#869

Open
MatthieuScarset wants to merge 3 commits intodrupalcommerce:8.x-2.x from
MatthieuScarset:extends-checkout-progress-block
Open

Add separate render function to CheckoutProgressBlock #869
MatthieuScarset wants to merge 3 commits intodrupalcommerce:8.x-2.x from
MatthieuScarset:extends-checkout-progress-block

Conversation

@MatthieuScarset
Copy link

@MatthieuScarset MatthieuScarset commented Dec 11, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /