-
Notifications
You must be signed in to change notification settings - Fork 219
Mini-cart: add setting to not render the block on the cart & checkout pages #8700
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/blocks/mini-cart/edit.tsx
|
Size Change: -960 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments in the code, but overall LGTM. I also tested it and it works perfectly. 👌
@pmcpinto @Aljullu do you have any suggestions for the toggle options and description copy?
It's a tricky one. An alternative would be to name the two options as "invisible" and "hidden", but I don't know if it makes things any easier to understand. Or to replace Don't render
with Don't display
.
Another option would be to use the explanation text below the toggle to explain what each options does. We seem to do it in some blocks, but I'm not sure if it's a correct GB pattern. 😕
Enregistrament.de.pantalla.des.de.2023-03-10.14-13-45.webm
More thoughts: what about
Yeah, that'd be useful, but I remember I changed that behavior some time ago on another toggle, so maybe it's something we are trying to avoid, not sure; |
In the future we may want to add more rendering styles, so a boolean wasn't the best option, a string will allowed us more than two options
I was going to suggest this as an alternative :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More thoughts: what about
Hide
andRemove
? 🤔
I like it! 👌
PR looks good to me.
Currently, the
Mini Cart
is hidden with CSS on the Cart & Checkout pages. As discussed on #7760 we want to give the users the option to not render it at all (not only hide it).This PR add this setting to the
Mini Cart
block and does not render the block when enabled. The default setting is to render it invisible (same behavior as until now) to not affect existing stores.Fixes #7760
Screenshots
Testing
User-Facing Testing
Site Editor
Mini Cart
block. Save.Hide
.Mini Cart
is rendered but invisible. Repeat but for the Checkout page.Mini Cart
setting toRemove
, and save.Mini Cart
markup is not rendered at all. Repeat but for the Checkout page.Post/page
Mini Cart
.Mini Cart in cart and checkout pages
setting does not appear.WooCommerce Visibility
Changelog