0

In Recently Viewed Product block, there are links for adding product to wishlist. These links are not working because data-post attribute is empty.

File path:-

/vendor/magento/module-reports/view/frontend/templates/product/widget/viewed/item.phtml

Code:-

<a href="#" data-post='<?= $block->getAddToWishlistParams($item) ?>'  class="action towishlist" data-action="add-to-wishlist" title="<?= __('Add to Wish List') ?>">
    <span><?= __('Add to Wish List') ?></span>
</a>

$block->getAddToWishlistParams($item); returns no content.

How can I fix this? Thanks in advance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.