1

Is there anyway to change this href to image url? Its from Magento Checkout module copied to my theme Magento_Checkout/web/template/minicart/item/default.html

<a data-bind="attr: {href: product_url, title: product_name}" tabindex="-1" class="product-item-photo" data-fancybox>
    <!-- ko foreach: $parent.getRegion('itemImage') -->
    <!-- ko template: {name: getTemplate(), data: item.product_image} --><!-- /ko -->
    <!-- /ko -->
</a>

I was trying to change to this:

<a data-bind="attr: {href: product_image, title: product_name}" 

but no success.

1 Answer 1

3

Try with this

<a data-bind="attr: {href: item.product_image.src, title: product_name}" tabindex="-1" class="product-item-photo">
1
  • It's works, perfect Thank You. It was also working when I overwrite /vendor/magento/module-checkout/CustomerData/DefaultItem.php in my theme adding new parametr 'img_src' => $imageHelper->getUrl() but whats the point adding new if there is one. Thanks
    – BartZalas
    Commented Mar 13, 2019 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.