0
/**
     * @return array
     */
    protected function getItems()
    {
        $items = [];
        foreach ($this->helper->getItemCollection() as $item) {
            $items[] = [
                'id' => $item->getId(),
                'product_url' => $this->productUrl->getUrl($item),
                'name' => $this->outputHelper->productAttribute($item, $item->getName(), 'name'),
                'image' => $this->outputHelper->getProductImageUrl($item),
                'remove_url' => $this->helper->getPostDataRemove($item),
            ];
        }
        return $items;
    }

$this->_itemCollection->addAttributeToSelect('image')->addUrlRewrite()->load();

<img data-bind="attr: {'src': image}"/>
2
  • are you sharing knowledge or asking question? Commented Oct 26, 2017 at 5:46
  • @SunilPatel I'm asking question Sir Commented Oct 26, 2017 at 6:13

2 Answers 2

0

Please check below link

https://stackoverflow.com/questions/10659665/knockout-template-using-data-bind-to-image-src-property-not-working

otherwise check Magento\Checkout\view\frontend\web\template\summary\item\details\thumbnail.html

1
  • is that works for you? Commented Oct 27, 2017 at 11:32
1

render image using knockout js

<img data-bind="attr: {src: imagePath, alt: $t('Acceptance Mark')}"
                 class="image-icon"/>

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.