如何将正在购买的产品的图像添加到Magento结帐的订单审核部分?
我希望在订单审核中看到产品图像?
发布于 2012-02-16 22:32:04
Order Review表的设计模板位于frontend/{your_theme}/decault/template/checkout/onepage/review/文件夹中。需要更新的文件是info.phtml (用于添加列)和item.phtml (用于添加实际图像)。
frontend/{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 ?>"> </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>
...frontend/{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>
...记住-不要改变核心文件,而是在你自己的主题中更新模板文件。
发布于 2012-03-06 18:52:19
此外,您还必须编辑totals模板:
frontend/{your_theme}/decault/template/checkout/onepage/review/totals.phtml
要调整botto列的跨度,请执行以下操作:
<?php if ($this->getTotals()): ?>
<tfoot>
<?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 6 : 4; ?>发布于 2012-07-16 03:59:39
实际上,info.phtml的空列应该使用$colspan,否则它的宽度会变得太大:
<th rowspan="<?php echo $colspan ?>"> </th>https://stackoverflow.com/questions/9309767
复制相似问题