Magento订购电子邮件的运输价格

时间:2020-01-13 13:37:39

标签: magento magento-1.9

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

enter image description here

1 个答案:

答案 0 :(得分: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; ?>

如果该代码为零,则它将跳过打印发货信息。

注意: 首先,您可以通过更新上述文件中的代码进行检查,然后可以覆盖它。