In magento2 ADD TO WISHLIST button functionality not provided by default on cart page so I want to implement ADD TO WISHLIST functionality on cart page how can I do that?
So user can directly add item to wishlist from cart page.
I have enabled templatepath hint for frontend and I see that on cart page move_to_wishlist.phtml file is called from app/design/frontend/Forever/theme/Magento_Wishlist/templates/cart/item/renderer/actions
move_to_wishlist.phtml file code is below.
<?php if ($block->isAllowInCart() && $block->isProductVisibleInSiteVisibility()): ?> <a href="#" data-post='<?php /* @escapeNotVerified */ echo $block->getMoveFromCartParams(); ?>' class="use-ajax action action-towishlist"> <span><?php /* @escapeNotVerified */ echo __('Move to Wishlist'); ?></span> </a>
But move to wishlist button is not showing on cart page so I have remove if condition from above code so it's working perfect and showing move to wishlist on cart page and working.
So my question is when I remove
if ($block->isAllowInCart() && $block->isProductVisibleInSiteVisibility()) code from move_to_wishlist.phtml wishlist button is showing otherwise not so does there issue with block file or core code ?
Any help will be appreciated.