Magento订单电子邮件运费

Magento订单电子邮件运费,magento,magento-1.9,Magento,Magento 1.9,我如何从运费为0的订单电子邮件中隐藏运费 要隐藏运费,您必须覆盖以下文件: app/design/frontend/base/default/template/sales/order/totals.phtml 更新后的代码应该是这样的 <?php foreach ($this->getTotals() as $_code => $_total): ?> <?php if ($_code == 'shipping' && $_total->get

我如何从运费为0的订单电子邮件中隐藏运费


要隐藏运费,您必须覆盖以下文件: app/design/frontend/base/default/template/sales/order/totals.phtml

更新后的代码应该是这样的

<?php foreach ($this->getTotals() as $_code => $_total): ?>
<?php if ($_code == 'shipping' && $_total->getValue() == 0) continue; ?>
<?php if ($_total->getBlockName()): ?>
    <?php echo $this->getChildHtml($_total->getBlockName(), false); ?>
<?php else:?>
<tr class="<?php echo $_code?>">
    <td <?php echo $this->getLabelProperties()?>>
        <?php if ($_total->getStrong()):?>
        <strong><?php echo $this->escapeHtml($_total->getLabel());?></strong>
        <?php else:?>
        <?php echo $this->escapeHtml($_total->getLabel());?>
        <?php endif?>
    </td>
    <td <?php echo $this->getValueProperties()?>>
        <?php if ($_total->getStrong()):?>
        <strong><?php echo $this->formatValue($_total) ?></strong>
        <?php else:?>
        <?php echo $this->formatValue($_total) ?>
        <?php endif?>
    </td>
</tr>
<?php endif?>

<?php if ($_code == 'shipping' && $_total->getValue() == 0) continue; ?>