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}"/>
  • are you sharing knowledge or asking question? – Sunil Patel Oct 26 '17 at 5:46
  • @SunilPatel I'm asking question Sir – Adrian Paul Oct 26 '17 at 6:13
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

  • is that works for you? – Sunil Patel Oct 27 '17 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, privacy policy and cookie policy

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