0
<?php
/**
 * @var $block Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist
 * @var $amLayoutViewModel Amasty\JetTheme\ViewModel\ProductPage\ProductPageViewModel
 * @var $escaper Magento\Framework\Escaper
 */
$amLayoutViewModel = $block->getData('amLayoutViewModel');
$productId = $block->getParentBlock()->getProduct()->getId(); 
?>
<?php if ($block->isWishListAllowed()): ?>
    <?php if ($amLayoutViewModel->showAddToWishlist()): ?>
            <div class="pdp-wishlist">
                <a href="#"
                class="action towishlist"
                data-post='<?= /* @noEscape */ $block->getWishlistParams() ?>'
                data-product-id='<?= $productId ?>'
                
                data-action="add-to-wishlist"
                title="<?= $escaper->escapeHtmlAttr(__('Favourite')) ?>"
                aria-label="<?= $escaper->escapeHtmlAttr(__('Favourite')) ?>">
                    <span class="amtheme-circle-icon">
                        <svg class="amtheme-icon -hover-bg">
                            <use xlink:href="#icon-wishlist"/>
                        </svg>
                    </span>
                    <span class="amtheme-title">
                        <?= $escaper->escapeHtmlAttr(__('Favourite')) ?>
                    </span>
                </a>
            </div>
        <?php endif; ?>
    <?php endif; ?>
    <script type="text/x-magento-init">
    {
        "body": {
            "addToWishlist": <?= /* @noEscape */ $block->getWishlistOptionsJson() ?>
        }
    }
</script>
<?php endif; ?>
3
  • please give answer for this question i am unable to find it
    – Rajesh
    Sep 21 at 12:09
  • Can you add a screenshot? Sep 21 at 17:27
  • screenshot is not available
    – Rajesh
    Sep 22 at 10:32

0

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.