Attempt to assign property "price_value" on null on checkout

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #346945

-- url of the page with the problem -- : cyclostyle.com
-- HikaShop version -- : 4.7.0
-- Joomla version -- : 3.10.11
-- PHP version -- : 8.0
-- Browser(s) name and version -- : firefox
-- Error-message(debug-mod must be tuned on) -- : Attempt to assign property "price_value" on null

I know this has something to do with php 8. I can not go back to php 7.4 as the provider removed that version form the servers. The eroor was not an issue with php 7.4

  • Put an item in the cart
  • Proceed to checkout
  • When clicking 'Checkout now' a page is shown with the error message Attempt to assign property "price_value" on null

No errors from error reporting are shown
In Databes Searches from debug mode several notifications 'Index key missing'

Is this an Hikashop issue, a template issue, or a (hikashop) plugin issue?|
Can you help me solve it? I can not make any sales now :(

Kind regards, Arjan

Last edit: 1 year 11 months ago by Arjan.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #346952

Hi,

I don't see the message on your checkout.
I suppose it depends on the product added to the cart.
If you still have the issue, please activate the "debug" setting of the joomla configuration and try again. It should display a more complete error message which will allow us to understand what's going on and tell you what to do.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #346958

Hi Nicolas,

Thanks for checking it out rightaway. But did you go all the way on the checkout? On my end the issue occures with every product I tried. You have to click the final button so the order is being created, the error message apperars on every chosen payment method.

Error reporting was already active, set on maximum.
I turned on the debug setting, can you have another look?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #346959

Hi,

I was only following your instructions which was to access the checkout to get the error, not to go to the end of the checkout.
I was indeed able to reproduce the error by going to the end of the checkout.
I can see that your template has a custom error page which doesn't support the extended debug display of Joomla.
Rename the file templates/YOUR_TEMPLATE/error.php to something else via FTP and then try again. You should now have the full error message which will point at the location of the problem.

Note that 2 months ago, someone else reported a similar error after upgrading their PHP to PHP8:
www.hikashop.com/forum/5-support-en-fran...ux-payer/344647.html
The error came from an old override of the emails which had some old PHP code not compatible with PHP8. The error might have the same source, but we would need the full error message to confirm it.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #346963

Hey again Nicolas,

I had seen that thread, but as I used a completly new template I did not think there could be a modified page. But you are right, there was a modified order-admin-notifictation file. I removed it and all is well. Sorry to have bothered you, but thanks for helping me to find the reason!

Keep up the good work!


>> spoke too soon.
Now the error is bccomp(): Argument #1 ($num1) is not well-formed :

Call stack
# Function Location
1 () JROOT/administrator/components/com_hikashop/helpers/shippingplugin.php:103
2 bccomp() JROOT/administrator/components/com_hikashop/helpers/shippingplugin.php:103
3 hikashopShippingPlugin->onShippingDisplay() JROOT/libraries/joomla/event/event.php:70
4 JEvent->update() JROOT/libraries/joomla/event/dispatcher.php:160
5 JEventDispatcher->trigger() JROOT/libraries/src/Application/BaseApplication.php:108
6 Joomla\CMS\Application\BaseApplication->triggerEvent() JROOT/administrator/components/com_hikashop/classes/shipping.php:356
7 hikashopShippingClass->getShippings() JROOT/administrator/components/com_hikashop/classes/cart.php:1373
8 hikashopCartClass->getFullCart() JROOT/components/com_hikashop/views/product/view.html.php:2392
9 ProductViewProduct->cart() JROOT/components/com_hikashop/views/product/view.html.php:28
10 ProductViewProduct->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:872
11 hikashop_getLayout() JROOT/modules/mod_hikashop_cart/mod_hikashop_cart.php:70
12 include() JROOT/plugins/system/t3/includes/joomla4/ModuleHelper.php:256
13 Joomla\CMS\Helper\ModuleHelper::renderRawModule() JROOT/plugins/system/t3/includes/joomla4/ModuleHelper.php:65
14 Joomla\CMS\Helper\ModuleHelper::renderModule() JROOT/libraries/src/Document/Renderer/Html/ModuleRenderer.php:98
15 Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render() JROOT/libraries/src/Document/Renderer/Html/ModulesRenderer.php:47
16 Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render() JROOT/libraries/src/Document/HtmlDocument.php:511
17 Joomla\CMS\Document\HtmlDocument->getBuffer() JROOT/libraries/src/Document/HtmlDocument.php:803
18 Joomla\CMS\Document\HtmlDocument->_renderTemplate() JROOT/libraries/src/Document/HtmlDocument.php:577
19 Joomla\CMS\Document\HtmlDocument->render() JROOT/libraries/src/Application/CMSApplication.php:1112
20 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
21 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:231
22 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49

UPDATE:
Turned of all shipping methods and found out that a product got stuck in the cart or something after the first fix.
removed it form the cart and turned on shipping methods again. All working well again.

Last edit: 1 year 11 months ago by Arjan. Reason: found the problem

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #346982

Hi,

While the view overrides are indeed located in the template, the email overrides are not. That's why you got the issue even though you changed the template.

Thank you for your feedback on that error. We'll look at it and add some fix for it.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #347574

Hi Nicolas!
I have the same problem as Arjan - same versions of Joomla & Hikashop, same error of "0 - Attempt to assign property "price_value" on null" when attempting to checkout using PHP 8.0+. If the browser is refreshed while attempting to get past the error, Hikashop adds another order entry with each refresh. I have set PHP back to 7.4.32 to avoid this problem until it is resolved.

The email that was sent when the error occurred included the following errors:
"Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.preload.modified.php on line 155"
"Warning: Undefined property: stdClass::$customtext_100_22_17_37 in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.preload.modified.php on line 155"
"Notice: Only variables should be assigned by reference in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.html.modified.php on line 280"
"Notice: Only variables should be assigned by reference in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.html.modified.php on line 225"
"Warning: Undefined property: stdClass::$order_addresses_fields in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.html.modified.php on line 234"
"Warning: foreach() argument must be of type array|object, null given in /home/kahworld/www/sat/media/com_hikashop/mail/order_creation_notification.html.modified.php on line 234"

I see (from above) that the email overrides are separate from the template views. And I know that some of the emails were changed 5-6 years ago and haven't been updated since. Some of them date back to Hikashop 2.2.3 or earlier. So, I suspect that the problems I'm having come from outdated code in the emails.

Other than saving all the old email code separately, removing the customization in Hikashop to apply the latest code and then re-applying any relevant custom sections - Is there any quick way to update the latest code with the earlier customization?

Thanks for any help you can give!
Gary Marsh

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347580

Hi,

Indeed it comes from the overrides. I don't see a quick way to do that. You'll have to do the modifications manually. Now, you can download both the original and the override files from the /media/com_hikashop/mail/ folder via FTP and use a tool like winmerge to compare both and do the merge more easily than manually comparing them with notepad.

The following user(s) said Thank You: gmarsh

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #347598

Thanks for the response, Nicolas!
I will work with the files & get back to you if I have other questions about the coding.
Gary Marsh

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum