Hikashop XMap Plugin with Joomla 4

  • Posts: 15
  • Thank you received: 6
  • Hikashop Business
3 years 2 days ago #337263

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 4.0.3

I did not manage to get the latest XMap plugin working with Joomla 4 ( www.hikashop.com/support/documentation/8...ation-with-xmap.html ).

It showed an error message instead of generating the XML sitemap.

I tracked this down to some deprecated function calls. "JArrayHelper" should be replaced by "ArrayHelper".

Did I miss some update for this plugin somewhere else?

See below my modifications.

Add the use clause at the beginning of "com_hikashop.php" within the XMap Hikashop plugin:

use Joomla\Utilities\ArrayHelper;

Then modify the code in function getTreeFct(&$xmap, &$parent, &$params) as follows:
$task = ArrayHelper::getValue($link_vars,'task','');
		$ctrl = ArrayHelper::getValue($link_vars,'ctrl','');
		$itemid = $parent->id;

		if (empty($task))
			$task = ArrayHelper::getValue($link_vars,'layout','');
		if (empty($ctrl))
			$ctrl = ArrayHelper::getValue($link_vars,'view','');
		if (empty($itemid))
			echo 'itemid vide';

First call to XML may take some time, but products are correctly mapped again.

If a Hikashop developer could confirm this bug and update the plugin. It might help others trying to migrate to Joomla 4.

Best regards

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 7 hours ago #337297

Hi,

Thank you for your feedback. We hadn't tested the plugin yet on Joomla 4.
So it's great that you did and you even provided the fix for it.
I checked the code and the fix and it looks good yes.
We'll integrate the changes on our end.

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

Time to create page: 0.050 seconds
Powered by Kunena Forum