Skip to content

Use the block to check whether adding to the wish list is allowed - #29

Draft
pingiun wants to merge 1 commit into
mage-os:masterfrom
cresset-tools:widget-preview-wishlist-optional
Draft

pingiun wants to merge 1 commit into
mage-os:masterfrom
cresset-tools:widget-preview-wishlist-optional

Conversation

@pingiun

@pingiun pingiun commented Nov 1, 2026

Copy link
Copy Markdown

The product widget preview templates call Magento\Wishlist\Helper\Data directly, so they fail to render without Magento_Wishlist, which this module doesn't depend on. They now use $block->isAddToWishlistAllowed(), which returns false when Magento_Wishlist isn't installed.

Depends on mage-os/mageos-magento2#396, which adds isAddToWishlistAllowed() to Magento\Catalog\Block\Product\AbstractProduct. This is part of the series that makes Magento_Wishlist removable.

Test: the New Products and Catalog Products List widget previews in Page Builder show "Add to Wish List" as before.

🤖 Generated with Claude Code

The product widget preview templates called Magento\Wishlist\Helper\Data
directly, so rendering them fails when Magento_Wishlist is not installed,
even though this module doesn't depend on it. Use
$block->isAddToWishlistAllowed(), which Magento_Catalog provides and which
returns false without Magento_Wishlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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