-
Notifications
You must be signed in to change notification settings - Fork 219
Add showRemoveItemLink
filter to CartLineItemRow
#7242
Conversation
This is a filter that will allow developers to set whether the link to remove a cartItem is visible
The release ZIP for this PR is accessible via:
|
Size Change: +78 B (0%) Total Size: 916 kB
ℹ️ View Unchanged
|
…' into add/show-remove-item-link-filter
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.
Great work, @opr! The PR works as expected. I'm pre-approving it, but regarding the documentation, I wonder if we should add an example similar to the ones seen in https://github.com/woocommerce/woocommerce-blocks/blob/ffdaab7815432c9fa8f256ceef873eccea14e724/docs/third-party-developers/extensibility/checkout-block/available-filters.md#examples.
Thanks @nielslange. I've added the example now! |
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.
Thanks for adding the example, @opr! I'd say, let's ⛴ this change! 🙌
* Add showRemoveItemLink filter This is a filter that will allow developers to set whether the link to remove a cartItem is visible * Add test for showRemoveItemLink filter * Remove unnecessary quantity override * Move definition of cart to avoid hardcoding id value in filter * Updated documentation for `showRemoveItemLink` filter * available-filters.md tweak * available-filters.md tweak * Add example to filters for showRemoveItemLink * Remove whitespace Co-authored-by: Paulo Arromba <[email protected]> Co-authored-by: Niels Lange <[email protected]>
This PR will add a new filter to the Cart block, specifically in the
CartLineItemRow
component.The filter's name is
showRemoveItemLink
and is used to disable the visibility of theRemove item
text.There are also unit tests and documentation changes included in this PR.
This PR does not add any changes to the StoreAPI to prevent removal because this something that should be handled by the extension that wants to implement the restriction. (It would be possible using the
woocommerce_remove_cart_item
hook.)Fixes #5415
Testing
Automated Tests
User Facing Testing
Remove item
button showing up for a product calledBeanie
docs/third-party-developers/extensibility/checkout-block/available-filters.md
file and ensure it is good, and the new text we added to describe the filter makes sense.WooCommerce Visibility
Performance Impact
Changelog