Discounts causing 'Call to a member function get() on null'

  • Posts: 4
  • Thank you received: 0
9 months 5 days ago #353660

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 4.3.3
-- PHP version -- : 8.0
-- Browser(s) name and version -- : Firefox (any)
-- Error-message(debug-mod must be tuned on) -- : Call to a member function get() on null

We have a recently created discount for clients with a total cart value over a certain amount. When any client reaches that amount, the error in the subject is thrown. Logs are below:

From the site:
0
Call to a member function get() on null
Call stack
# Function Location
1 () JROOT/administrator/components/com_hikashop/helpers/paymentplugin.php:96
2 hikashopPaymentPlugin->onPaymentDisplay() JROOT/libraries/src/Plugin/CMSPlugin.php:284
3 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
4 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111
5 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/administrator/components/com_hikashop/classes/payment.php:256
6 hikashopPaymentClass->getPayments() JROOT/administrator/components/com_hikashop/classes/cart.php:1458
7 hikashopCartClass->getFullCart() JROOT/administrator/components/com_hikashop/classes/cart.php:4340
8 hikashopCartClass->getCartProductData() JROOT/components/com_hikashop/views/product/tmpl/show_quantity.php:68
9 include() JROOT/libraries/src/MVC/View/HtmlView.php:410
10 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/administrator/components/com_hikashop/helpers/helper.php:2789
11 hikashopView->loadTemplate() JROOT/components/com_hikashop/views/product/tmpl/quantity.php:128
12 include() JROOT/libraries/src/MVC/View/HtmlView.php:410
13 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/administrator/components/com_hikashop/helpers/helper.php:2789
14 hikashopView->loadTemplate() JROOT/components/com_hikashop/views/product/tmpl/show_default.php:183
15 include() JROOT/libraries/src/MVC/View/HtmlView.php:410
16 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/administrator/components/com_hikashop/helpers/helper.php:2789
17 hikashopView->loadTemplate() JROOT/components/com_hikashop/views/product/tmpl/show.php:97
18 include() JROOT/libraries/src/MVC/View/HtmlView.php:410
19 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/administrator/components/com_hikashop/helpers/helper.php:2789
20 hikashopView->loadTemplate() JROOT/libraries/src/MVC/View/HtmlView.php:203
21 Joomla\CMS\MVC\View\HtmlView->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2744
22 hikashopView->display() JROOT/components/com_hikashop/views/product/view.html.php:29
23 ProductViewProduct->display() JROOT/libraries/src/MVC/Controller/BaseController.php:645
24 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2463
25 hikashopController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2176
26 hikashopController->show() JROOT/libraries/src/MVC/Controller/BaseController.php:678
27 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2441
28 hikashopController->execute() JROOT/components/com_hikashop/hikashop.php:88
29 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
30 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
31 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
32 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
33 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
34 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
35 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
36 require_once() JROOT/index.php:32

From the logs:
==> ./logs/error_log <==
[Mon Jul 24 11:05:25.700945 2023] [proxy_fcgi:error] [pid 6537] [client 8.8.8.8:0] AH01071: Got error 'PHP message: PHP Warning: Undefined property: plgHikashoppaymentBanktransfer::$config in /var/www/vhosts/joomlasite/httpdocs/administrator/components/com_hikashop/helpers/paymentplugin.php on line 96', referer: www.joomlasite/index.php/browse-products

==> ./httpdocs/administrator/logs/everything.php <==
2023-07-24T09:05:26+00:00 CRITICAL 8.8.8.8 error Uncaught Throwable of type Joomla\CMS\Router\Exception\RouteNotFoundException thrown with message "Page not found". Stack trace: #0 [ROOT]/libraries/src/Application/SiteApplication.php(746): Joomla\CMS\Router\Router->parse()
#1 [ROOT]/libraries/src/Application/SiteApplication.php(232): Joomla\CMS\Application\SiteApplication->route()
#2 [ROOT]/libraries/src/Application/CMSApplication.php(293): Joomla\CMS\Application\SiteApplication->doExecute()
#3 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()
#4 [ROOT]/index.php(32): require_once('...')
#5 {main}

paymentplugin.php
95 $total_quantity = 0;
96 $group = (int)$this->config->get('group_options', 0);
97 foreach($order->products as $p) {

Joomla and Hikashop are happy they're up to date. Login details are available for Hikashop support if needed.

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
9 months 5 days ago #353666

Hi,

Thanks for your feedback. We've made a hot patch for it. Download the install package of HikaShop on our website and install it on yours to get the patch.

The following user(s) said Thank You: joes3029

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

  • Posts: 4
  • Thank you received: 0
9 months 5 days ago #353671

That worked like a charm - props to you guys for such a quick turnaround!

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

Time to create page: 0.055 seconds
Powered by Kunena Forum