在magento中为小计添加额外价格

时间:2016-04-07 04:06:26

标签: php magento

我想为购物车中的每件商品添加额外的定价。我已经从谷歌找到了一个解决方案,我遵循该指令并使其正常运行。但现在它不起作用,这是我遵循的代码..

路径 - /app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php

protected function _totalBaseCalculation($item, $request)
    {
        $calc   = $this->_calculator;
        $request->setProductClassId($item->getProduct()->getTaxClassId());
        $rate   = $calc->getRate($request);
        $qty    = $item->getTotalQty();

        $price          = $taxPrice         = $item->getCalculationPriceOriginal();
        $basePrice      = $baseTaxPrice     = $item->getBaseCalculationPriceOriginal();
        $subtotal       = $taxSubtotal      = $item->getRowTotal()+25;
        $baseSubtotal   = $baseTaxSubtotal  = $item->getBaseRowTotal()+25;



        $taxOnOrigPrice = !$this->_helper->applyTaxOnCustomPrice($this->_store) && $item->hasCustomPrice();
        if ($taxOnOrigPrice) {
            $origSubtotal       = $item->getOriginalPrice() * $qty;
            $baseOrigSubtotal   = $item->getBaseOriginalPrice() * $qty;
        }  

我改变了这两行

    $subtotal       = $taxSubtotal      = $item->getRowTotal()+25;
    $baseSubtotal   = $baseTaxSubtotal  = $item->getBaseRowTotal()+25;
你能帮帮我吗.....

0 个答案:

没有答案