Magento howto fetch / modify / overwrite calculation totals.phtml?

I added a product that is calculated using two attributes and uses its own estimated price. the problem is that I had to rewrite the grandiose and intermediate calculation ... for example, with the replacement of material.

Hope @stackoverflow is the magento guru who solved my problem :-)

I changed / app / design / frontend / default / gutlauf / template / checkout / cart / item / default.phtml where the layout of the cart items is done.

but now I have a problem with / app / design / frontend / default / gutlauf / template / checkout / cart / totals.phtml

<table id="shopping-cart-totals-table">
    <col />
    <col width="1" />
    <tfoot>
        <?php echo $this->renderTotals('footer'); ?>
    </tfoot>
    <tbody>
        <?php echo $this->renderTotals(); ?>
    </tbody>
</table>

How can I get my own calculation? I realized that the blocks

tax / checkout_grandtotal tax / checkout _subtotal tax / checkout_tax

/app/design/frontend/default/gutlauf/template/tax/checkout/grandtotal.phtml

<?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?>

"Mage_Tax_Block_Checkout_Grandtotal"

/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php, ... ...

, - , "", foreach, .

/app/code/core/Mage/Checkout/Block/Cart/ Totals.php

renderTotal... foreach , -

            $productIds = array(); 
            $productIds[] = $_item['product_id'];

            $products = Mage::getModel('catalog/product')->getCollection() 
            ->addAttributeToSelect('gl_special') 
            ->addMinimalPrice() 
            ->addStoreFilter() 
            ->addIdFilter($productIds);

            $product = $products->getItemById($_item['product_id']);
            #print_r($product);
            $bBerechnet = $product->getData('gl_special');


$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);

,

public function renderTotal($total, $area = null, $colspan = 1)
{
    $code = $total->getCode();

    if ($total->getAs()) {
        $code = $total->getAs();
    }
    return $this->_getTotalRenderer($code)
        ->setTotal($total)
        ->setColspan($colspan)
        ->setRenderingArea(is_null($area) ? -1 : $area)
        ->toHtml();
}
+5
1

. , , config.xml

     <sales>
        <quote>
            <totals>
                <subtotal><class>modulename/sales_quote_address_total_subtotal</class></subtotal>
            </totals>
        </quote>
    </sales>

class Namespace_Modulename_Model_Quote_Address_Total_Subtotal extends Mage_Sales_Model_Quote_Address_Total_Subtotal { }

_initItem() .

, !

+2

All Articles