Jump to content

Problem with objOrder


Recommended Posts

I'm trying to confirm an order. My method is:

 /**
     * This hook is used to display the order confirmation page.
     */
    public function hookPaymentReturn($params)
    {
        if ($this->active == false)
            return;

        $order = $params['objOrder'];

        if ($order->getCurrentOrderState()->id != Configuration::get('PS_OS_ERROR'))
            $this->smarty->assign('status', 'ok');

        $this->smarty->assign(array(
            'id_order' => $order->id,
            'reference' => $order->reference,
            'params' => $params,
            'total' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
        ));

        return $this->display(__FILE__, 'views/templates/hook/confirmation.tpl');
    }

But I have this problem:

image.thumb.png.a569cd2197c0c9ad1f0c3128a05c09e6.png

Link to comment
Share on other sites

23 minutes ago, joseantgv said:

if (version_compare(_PS_VERSION_, '1.7', '<')) {
    $order = $params['objOrder'];
} else {
    $order = $params['order'];
}

 

Thanks, but now I have the same problem with

$params['total_to_pay']

 

Link to comment
Share on other sites

  • 1 year later...
hace 14 horas, CarlosMirandaG dijo:

Hi good day i have a similar error, would you can help me please?

When completing the purchase in my store, it throws the following error (attach screenshoot)

índice.jpg

This is an error from module "ganalytics". Are you running last version?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...