#StackBounty: #magento-1.9 Extra fee doesn't show at the admin panel orders

Bounty: 50

I added an extra fee. It’s working well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How can I show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for the invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doesn't show at the admin panel orders

Bounty: 50

I added an extra fee. It’s working well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How can I show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for the invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doesn't show at the admin panel orders

Bounty: 50

I added an extra fee. It’s working well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How can I show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for the invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doen't show at the admin panel orders

Bounty: 50

I added extra fee. It’s work well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it’s doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How I can show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doen't show at the admin panel orders

Bounty: 50

I added extra fee. It’s work well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it’s doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How I can show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doen't show at the admin panel orders

Bounty: 50

I added extra fee. It’s work well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it’s doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How I can show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}

And can u explain pls, how to work in config.xml that:

   <order_invoice>
                     <totals>
                         <insurance>


Get this bounty!!!

#StackBounty: #magento-1.9 Extra fee doen't show at the admin panel orders

Bounty: 50

I added extra fee. It’s work well at the checkout. enter image description here

But at the admin panel -> sales -> orders -> my order it’s doesn’t show.
enter image description here

But price is well.
At the invoice too

enter image description here

How I can show it?
I tried :

<fieldsets>
     <sales_convert_quote_address>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_order>*</to_order></insurance>
         <insurance><to_invoice_item>*</to_invoice_item></insurance>
     </sales_convert_quote_address>
</fieldsets>

But it doesn’t help. Thanks advance.

EDIT:

class Cart_InsuranceUpsell_Model_Paymentinsurance extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    protected $_code = 'Insurance Upsell';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (Mage::getSingleton('checkout/session')->getInsuranceUpsellApply()) {
        parent::collect($address);

        $this->_setAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        $quote = $address->getQuote();

            $exist_amount = $quote->getFeeAmount();
            $fee = $address->getGrandTotal() * (Mage::getStoreConfig('cart_insurance_upsells/configuration/discount_rate',Mage::app()->getStore())/100);
            $balance = $fee - $exist_amount;
            $address->setInsurance($balance);
            $quote->setInsurance($balance);
            $address->setGrandTotal($address->getGrandTotal() + $address->getInsurance());
        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
            $amt = $address->getInsurance();
            if ($amt > 0){
                $address->addTotal(array(
                    'code' => $this->getCode(),
                    'title' => 'Insurance Upsell',
                    'value' => $amt
                ));
                return $this;
            }
        return true;
    }
}

Config.xml :

  <config>
       <global>

        <pdf>
            <totals>
                <insurance>
                    <title>Upsell Insurance</title>
                    <model>cart_insurance_upsell/pdf_earning</model>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>3</sort_order>
                </insurance>
            </totals>
        </pdf>

        <fieldsets>
            <sales_convert_quote_address>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_order>*</to_order></insurance>
                <insurance><to_invoice_item>*</to_invoice_item></insurance>
            </sales_convert_quote_address>
        </fieldsets>

        <sales>
            <quote>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/paymentinsurance</class>
                    </insurance>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <insurance>
                        <class>cart_insurance_upsell/earning</class>
                        <after>subtotal</after>
                    </insurance>
                </totals>
            </order_invoice>
        </sales>
 </global>
    </config>

And for invoice:

class  Cart_InsuranceUpsell_Model_Earning extends Mage_Sales_Model_Order_Invoice_Total_Abstract
{
    public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
        $order = $invoice->getOrder();
        $insurance = $order->getInsurance();

        $invoice->setInsurance($insurance);

        $invoice->setGrandTotal($invoice->getGrandTotal() + $insurance);

        return $this;
    }
}


Get this bounty!!!