VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: mauriziomomix on January 24, 2019, 20:56:49 PM

Title: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: mauriziomomix on January 24, 2019, 20:56:49 PM
Hello,
in two websites using VirtueMart 3.4.2 I am noticing the same error when clicking on the link present in the email notification of the order ("{SITEURL}/index.php?option=com_virtuemart&view=orders&layout=details&order_number={ORDERNUMBER}")

The error is: Error 0 Call to a member function priceDisplay() on null.

The PHP version is 7.1 but I also changed it in lower or upper without better results.
One of the two websites is in J3.9.1 and the second is in 3.9.2.

Anyone has experienced the same?

Thanks in advance
Maurizio
Title: Re: Error 0 Call to a member function priceDisplay() on null
Post by: GJC Web Design on January 24, 2019, 22:52:12 PM
you need to trace the call stack to find the file and line

use   https://www.rupostel.com/utilities-for-joomla/extensions/fatal-catcher-plugin or full debugging
Title: Re: Error 0 Call to a member function priceDisplay() on null
Post by: mauriziomomix on January 25, 2019, 09:39:24 AM
Hello,
thanks for replying me.
Full debugging is getting this output:

Undefined property: VirtuemartViewOrders::$print in /var/www/vhosts/ruggedstore.it/httpdocs/templates/vp_smart/layouts/default/html/com_virtuemart/orders/details.php on line 16
Informazioni sull'ordine

Notice: Undefined property: VirtuemartViewOrders::$orderdetails in /var/www/vhosts/ruggedstore.it/httpdocs/templates/vp_smart/layouts/default/html/com_virtuemart/orders/details.php on line 38

Notice: Trying to get property of non-object in /var/www/vhosts/ruggedstore.it/httpdocs/templates/vp_smart/layouts/default/html/com_virtuemart/orders/details.php on line 38

Warning: Creating default object from empty value in /var/www/vhosts/ruggedstore.it/httpdocs/templates/vp_smart/layouts/default/html/com_virtuemart/orders/details.php on line 38
Title: Re: Error 0 Call to a member function priceDisplay() on null
Post by: Jörgen on January 25, 2019, 09:58:43 AM
Looks like a problem with Your template, try switching to protostar or VMBeez3.

Jörgen @ Kreativ Fotografi
Title: Re: Error 0 Call to a member function priceDisplay() on null
Post by: mauriziomomix on January 25, 2019, 10:18:24 AM
Hello Jörgen,
thank you very much.
Actually I did this (with the same result) adding all menu voices to Protostar but now I've done it again setting it as predefined also.
Well, the link works correctly. So is definitely a Virtueplanet Smart template Issue.
I already informed the template producer.

Thanks to all.

Maurizio
Title: Re: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: escozul on February 07, 2019, 11:36:32 AM
Hello,

I'm getting the same error too after a successfull order.

How exactly were you able to resolve it?
Title: Re: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: Jörgen on February 07, 2019, 12:33:59 PM
Try with Protostar as template setting. If error disappers then You have a template issue.

Jörgen @ Kreativ Fotografi
Title: Re: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: StefanSTS on October 10, 2019, 19:25:19 PM
Who has marked this as SOLVED?
Solved posts generally include an answer to the question, otherwise it is not solved and useless as a forum post.


EDIT: Actually there was an answer from the first poster, the unsolved question was from someone else.
How rude am I? ;-)

Stefan
Title: Re: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: Jörgen on October 10, 2019, 21:02:26 PM
I guess mauriziomomix since he saw this as a template issue

Jörgen
Title: Re: [SOLVED] Error 0 Call to a member function priceDisplay() on null
Post by: webcomil on November 05, 2019, 21:57:19 PM
I had it also
and it took me some time to understand and solve.

The reason for that error is that the user is not authorized to view the compoeted order, meaning, in the sysem seting it sets to allow only registretd user  to view ordrs.

Therefore when user is not authorized, the data in that function is null,
therefore you get this error.  it is aslo on VM views (template files) as for 3.4.2 versioin

So the solution for it on configuration → check out field "Order tracking mode" needs to be set to allow guest shoppers.