Questions tagged «sales-invoice»

4
发票电子邮件模板中的产品图片
我正在尝试获取发票电子邮件模板的产品图像。我用下面的代码。但是我在电子邮件模板中只得到了Magento占位符图像。 <td> <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product_id = $_item->getOrderItem()->getProduct(); $product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id); $_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image'); $image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl(); ?> <img src="<?php echo $image_url; ?>" alt="<?php echo $product->getName(); ?>" /> </td>
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.