gpt4 book ai didi

magento - 如何将购买的产品图片添加到 Magento 的订单审核部分?

转载 作者:行者123 更新时间:2023-12-04 01:25:41 24 4
gpt4 key购买 nike

如何将所购买产品的图像添加到 Magento 结账的订单审查部分?

我希望在订单审核中看到产品图片?

最佳答案

Order Review 表的设计模板位于 frontend/{your_theme}/decault/template/checkout/onepage/review/文件夹中。您需要更新的文件是 info.phtml(添加列)和 item.phtml(添加实际图像)。

前端/{your_theme}/decault/template/checkout/onepage/review/info.phtml

  <table class="data-table" id="checkout-review-table">
<?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
<col />
<col width="1" />
<col width="1" />
<col width="1" />
<col width="1" /> <!-- <---Add this new col in table description -->
...

然后找到表头并添加您的图像列:
      <thead>
<tr>
<th rowspan="<?php echo $rowspan ?>">&nbsp;</th> <!-- Here's the empty col for the image -->
<th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
<th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
...

前端/{your_theme}/decault/template/checkout/onepage/review/item.phtml

在 item.phtml 文件的开头,添加您的图像:
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*/
?>
<?php $_item = $this->getItem()?>
<tr>
<!-- Product Image Here -->
<td><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></td>
<td><h3 class="product-name"><?php echo $this->htmlEscape($this->getProductName()) ?></h3>
...

记住 -
不要更改核心文件,而是更新您自己主题中的模板文件。

关于magento - 如何将购买的产品图片添加到 Magento 的订单审核部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9309767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com