cant show product in article

  • Posts: 104
  • Thank you received: 5
2 years 8 months ago #334545

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.27
-- PHP version -- : 7.2
-- Error-message(debug-mod must be tuned on) -- : 0 Call to a member function getTemplate() on null
/home/perfumesmart/public_html/plugins/system/hikashopproductinsert/hikashopproductinsert.php:378

Hi every body
i want adding products in Joomla's articles. but this error is display:

0 Call to a member function getTemplate() on null
/home/perfumesmart/public_html/plugins/system/hikashopproductinsert/hikashopproductinsert.php:378
the code in line 378 ic
$path = JPATH_THEMES.DS.$app->getTemplate().DS.'system'.DS.$name;
I try default joomla template but error remaining yet. can anyone help please?

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
2 years 8 months ago #334548

Hi,

This error message indicates that the $app variable is not set before in the code. However, if you go up about 200 lines in the same function / file, you'll see this lins near the top of the _processProduct function:
$app = JFactory::getApplication();
I've never seen that line return "null", which your PHP complains about.
So either that line has been removed from that area on your end, or you have a strange problem on your website.
I looked a bit online but I couldn't find really any page talking about JFactory::getApplication returning null, and that's quite normal, as that's almost the main function of Joomla.
So I would rather say that the $app = JFactory::getApplication(); has been removed from the plugin file on your website for some reason.
Or maybe that plugin file was not updated from a really old version of the plugin because of access rights issues on the plugin files. At the beginning of the file, you'll have the version number from which the file comes. If you have HikaShop 4.4.1, it should be the same version number. If you have something else, then you likely have an access rights issue on that file. You'll have to check the permissions there and then run the HikaShop update / install to get the latest version of HikaShop and that file and it should hopefully work fine. Or you could simply add the line $app = JFactory::getApplication(); just before the line of the error, but you might end up with other errors down the line.

The following user(s) said Thank You: levelup

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

  • Posts: 104
  • Thank you received: 5
2 years 8 months ago #334563

thanks for answer. I update to 4.4.3 and problem is solved.
in hikashop 4.4.3 the hikashopproductinsert.php file version is 4.4.1
but its work.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.057 seconds
Powered by Kunena Forum