gpt4 book ai didi

php - 原始价格未显示在 magento 1.8.1 的销售订单 View 中?

转载 作者:可可西里 更新时间:2023-11-01 06:51:10 25 4
gpt4 key购买 nike

magento 1.8.1 中的销售订单 View 中未显示原始价格?

亲爱的,我的原价是 299,卖价是 149,但原价和销售价显示相同的 149 怎么看原价?我的代码在这里 请帮助我了解如何显示原价app\design\adminhtml\default\default\template\sales\order\view\items\renderer/default.phtml

enter link description here
(来源:suditi.in)

<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package default_default
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php $_item = $this->getItem() ?>
<?php $this->setPriceDataObject($_item) ?>
<tr<?php if (!$this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
<td>
<?php if ($this->canDisplayContainer()): ?>
<div id="<?php echo $this->getHtmlId() ?>" class="item-container">
<?php endif; ?>
<div class="item-text">
<?php echo $this->getColumnHtml($_item, 'name') ?>
</div>
<?php if ($this->canDisplayContainer()): ?>
</div>
<?php endif ?>
</td>
<td class="a-center"><?php echo $_item->getStatus() ?></td>
<td class="a-right"><?php echo $this->displayPriceAttribute('original_price') ?></td>
<td class="a-right">
<?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
<span class="price-excl-tax">
<?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
<span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
<?php
echo $this->displayPrices(
$_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
$_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
);
?>
<?php else: ?>
<?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
<?php endif; ?>


<?php if (Mage::helper('weee')->getApplied($_item)): ?>
<br />
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
<?php endforeach; ?>
</small>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
<?php endforeach; ?>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
<?php endforeach; ?>
</small>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<br />
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
<?php
echo $this->displayPrices(
$_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
$_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
);
?>
</span>
<?php endif; ?>
<?php endif; ?>
</span>
<br />
<?php endif; ?>
<?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
<span class="price-incl-tax">
<?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
<span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
<?php endif; ?>
<?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
<?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
<?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
<?php else: ?>
<?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
<?php endif; ?>

<?php if (Mage::helper('weee')->getApplied($_item)): ?>
<br />
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
<?php endforeach; ?>
</small>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
<?php endforeach; ?>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
<?php endforeach; ?>
</small>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<br />
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
<?php endif; ?>
<?php endif; ?>
</span>
<?php endif; ?>

</td>
<td><?php echo $this->getColumnHtml($_item, 'qty') ?></td>

<td class="a-right">
<?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
<span class="price-excl-tax">
<?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
<span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
<?php
echo $this->displayPrices(
$_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
$_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
);
?>
<?php else: ?>
<?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
<?php endif; ?>


<?php if (Mage::helper('weee')->getApplied($_item)): ?>
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
<?php endforeach; ?>
</small>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
<?php endforeach; ?>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
<?php endforeach; ?>
</small>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<br />
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
<?php
echo $this->displayPrices(
$_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
$_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
);
?>
</span>
<?php endif; ?>
<?php endif; ?>
</span>
<br />
<?php endif; ?>
<?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
<span class="price-incl-tax">
<?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
<span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
<?php endif; ?>
<?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
<?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
<?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
<?php else: ?>
<?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
<?php endif; ?>


<?php if (Mage::helper('weee')->getApplied($_item)): ?>

<br />
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
<?php endforeach; ?>
</small>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
<?php endforeach; ?>
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
<small>
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
<?php endforeach; ?>
</small>
<?php endif; ?>

<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
<br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item),$_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
<?php endif; ?>
<?php endif; ?>
</span>
<?php endif; ?>
</td>
<td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
<td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
<td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
<td class="a-right last">
<?php echo $this->displayPrices(
$_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
$_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
); ?>
</td>
</tr>

最佳答案

编辑:在底部添加了一个简化的答案。没有它,我的解释有点困惑。

欢迎来到 Magento 的困惑。您订单中显示的原始价格和价格实际上是正确的。快速回答为什么是 Click Here并查看对其进行简要说明的博客条目。有关详细信息,请阅读:

产品原价是按步骤计算的。如果项目是不属于可配置产品或组的简单产品,则计算结束。使用该产品价格标签中的任何内容;价格、特价、厂商建议零售价等。

如果产品是可配置产品的一部分,则会采取额外的步骤。基本上产品价格标签被忽略,可配置产品的价格标签被用作起点。然后可配置产品检查其关联的产品选项卡并执行适当的计算。


示例:
这是我网站上使用床垫 (9LTXMT-004) 的示例,作为一个简单的产品,它的价格为 1203 美元(这是它的原价)。但是,我已将该产品添加到可配置产品(父级)并将该成本设置为 782 美元。所以现在 782 美元取代了 1203 美元作为我的原始成本,然后将关联产品选项卡中的计算(如果有)添加到此。在我的例子中(下图),它在可配置产品价格上增加了 472 美元,这变成了产品的原价,1254 美元。不是简单产品价格 1675 美元加上可配置产品的额外 472 美元。

Magento configurable product associated product tab

在这里,您可以看到(第 1 部分)我所解释的原价。如果他们使用折扣代码,您也可以(第 2 部分)看到您的订单应该是什么样子。这也是正常的 Magento 操作。 Order placed in Magento


回到答案:
原始价格和价格将始终显示 Magento 计算给用户的成本。在您的帖子中,您告诉我们它的售价是 149 美元,所以这正是它在订单中显示给您的价格。唯一一次原始价格和价格会有所不同的是,如果您对产品应用管理方折扣。因此,在 Magento 计算成本后,您将有一个规则(也许是促销?),为用户提供比原价低 10% 的折扣。

您应该能够打印显示这种差异的报告。 “客户 X 以 $$$ 的价格购买了产品 Y,但实际花费了 $$$”。如果您找不到已内置到 Magento 中的报告来执行此操作,创建您自己的报告并将其添加到系统与破解核心代码以添加此不寻常的功能相比并没有太多工作。

虽然我明白你的意思。如果能在订单页面上显示真实的原始产品价格和我们出售的价格会很好,因为这是我们开具发票和打印的价格。但这不是默认的Magento。也许您应该向 Magento 社区开发人员请求它。

编辑,简化答案:

您在帖子中要求的不是 Magento 显示价格的默认方式;见上面的解释。您只有三个选择:

  1. 编写自己的解决方案;自定义扩展或破解核心代码(不推荐)
  2. 创建您自己的可由 Magento 生成的报告。可能不是您想要的,但这是处理此类情况的正确方法。
  3. 在 Magento CE 论坛中请求添加此功能。

关于php - 原始价格未显示在 magento 1.8.1 的销售订单 View 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29602909/

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