Call to a member function getCart() on null when editing user information

  • Posts: 75
  • Thank you received: 7
5 years 2 weeks ago #312881

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.13
-- PHP version -- : 7.2.24
-- Browser(s) name and version -- : Google Chrome Version 78.0.3904.87 (Official Build) (64-bit)
-- Error-message(debug-mod must be tuned on) -- : Call to a member function getCart() on null
/mnt/data/vhosts/casite-584904.cloudaccess.net/httpdocs/administrator/components/com_hikashop/classes/address.php:246

Call stack
# Function Location
1 () JROOT/administrator/components/com_hikashop/classes/address.php:246
2 hikashopAddressClass->save() JROOT/administrator/components/com_hikashop/controllers/user.php:118
3 UserController->saveaddress() JROOT/libraries/src/MVC/Controller/BaseController.php:710
4 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:1976
5 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:72
6 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
7 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
8 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
9 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
10 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51

I haven't had to actually edit the customer information for awhile, so I'm not sure if this issue existed before I upgraded to the latest Hikashop version.

The 'Call to a member function getCart() on null' error appears when I click the OK button after editing the billing or shipping addresses after they are created.

I can create the billing/shipping address with no problems, but I cannot edit an existing one.

I set error reporting to maximum, and I pasted in the info that shows when I try to save an edit.

Thanks for any help.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 2 weeks ago #312894

Hi,

Thank you for the details.
You can change the line:
$checkoutHelper = hikashop_get('class.checkout');
To:
$checkoutHelper = hikashop_get('helper.checkout');
in the file /administrator/components/com_hikashop/classes/address.php and that will fix the problem.
We've added that patch on our end too so you can also download again the install package of HikaShop on our website and install it on yours to get the patch.

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

  • Posts: 75
  • Thank you received: 7
5 years 2 weeks ago #312909

Yes that worked perfectly, thanks!

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

  • Posts: 49
  • Thank you received: 4
4 years 9 months ago #315772

I have the same problem as described in this ticket.
I changed the line as described:
$checkoutHelper = hikashop_get('class.checkout');
To:
$checkoutHelper = hikashop_get('helper.checkout');

There is no error anymore but the modification is not applied.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 9 months ago #315777

Hi,

First, please download the install package of the 4.2.2 on our website and install it on yours. That way, you'll get all the latest patches.
Then please try to reproduce the issue, and if you do, please provide a link with precise instructions for us to be able to reproduce the issue.

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

Time to create page: 0.050 seconds
Powered by Kunena Forum