0

I'm getting this in Total Orders section when I'm on the Create New Order page

"Fatal error: Call to a member function setTotals() on a non-object in /home/pixelsp0/public_html/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php on line 77"

enter image description here

What it could be?


edit:

@kunz

<sales>
        <quote>
            <totals>
                <giantpoints_renderer_point>
                    <class>giantpoints/total_quote_renderer_point</class>
                    <before>nominal,subtotal</before>
                    <renderer>giantpoints/checkout_cart_renderer_point</renderer>
                    <admin_renderer>giantpoints/adminhtml_checkout_cart_renderer_point</admin_renderer>
                </giantpoints_renderer_point>
                <giantpoints_spending_before_tax>
                    <class>giantpoints/total_quote_spending_beforeTax</class>
                    <after>discount</after>
                    <before>tax</before>
                </giantpoints_spending_before_tax>
                <giantpoints_spending_after_tax>
                    <class>giantpoints/total_quote_spending_afterTax</class>
                    <after>tax</after>
                    <before>grand_total</before>
                </giantpoints_spending_after_tax>
            </totals>
        </quote>

So I found the extension that is in conflict: Mage giant Points. For some reason, it's in my local and not community. I don't understand what exactly is going on after <totals>, I have watched quite an old (2012) 20 hour course online, but now I realized Magento even in version 1 has changed a few things (or this is what it looks like to me). Shouldn't he be specifying a <rewrite> tag in order to rewrite? Can you help me understand what is going on just by looking thing short XML?

    class Magegiant_GiantPoints_Model_Total_Quote_Renderer_Point
    extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    public function __construct()
    {
        $this->setCode('giantpoints_renderer_point');
    }

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        // Init Giant Points
        $address->setGiantpointsSpent(0);
        $address->setGiantpointsBaseDiscount(0);
        $address->setGiantpointsDiscount(0);
        $address->setGiantpointsEarn(0);

        return $this;
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $address->addTotal(array(
            'code'  => $this->getCode(),
            'title' => '1',
            'value' => 1,
        ));

        return $this;
    }
}

is the giantpoints/total_quote_renderer_point Point.php file.

  • 1
    Magento could not get object/method. Like this, you have called $object->setTotals({{some peram}}) and magento could not get $object as PHP object or setTotals method is not there in that $object. – kunj May 23 '18 at 8:13
  • @kunj Thanks for your reply. Could you please explain a bit more since I have just started using Magento. – Umer Z May 24 '18 at 5:16
  • If you have not customized Magento admin total then it is rendering total from this file app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php From this function : protected function _getTotalRenderer($code) You can see $block = $this->getLayout()->createBlock($block, $blockName); in that function Magento creating all total's object. try to debug it. Your can also check any module have this type of code: <sales><quote><totals>{{some xml code}}</totals></quote></sales> – kunj May 24 '18 at 5:42
  • @kunj I just edited my initial question. Could you please have a look and let me know? – Umer Z May 28 '18 at 11:40
  • Is this giantpoints/total_quote_renderer_point file exist? I hope that module enabled and please share full content or module so investigate on it. – kunj May 28 '18 at 12:08
0

The solution was dead simple: disable the module not working! In this case Magegiant Refer one was having issues here and overall as well. Since it was really buggy, I completely disabled it from app/code/etc/modules/... since disabling it from Magento webpage was not working at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.