Error calling Image thumbnail in Google Products XML

  • Posts: 64
  • Thank you received: 1
  • Hikashop Business
2 years 1 week ago #346546

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.5

Hello,

after updating to Joomla 4 I get an error from an override you proposed some time ago for Google products plugin:

An error has occurred.
0 Call to a member function getThumbnail() on null

The change is on line 436, of the plugin's PHP file.

The altered code is:
$img_thumb = $imageHelper->getThumbnail($image->file_path, array(500, 500), array('default' => true));
$xml .= "\t".'<g:'.$name.'>'.htmlspecialchars($img_thumb->url).'</g:'.$name.'>'."\n";

What change needs to be done?

For reference, this is the URL of the related topic: www.hikashop.com/forum/development/90069...le-products-xml.html

Thank you,
Yannis

Last edit: 2 years 1 week ago by yanliom.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 week ago #346547

Hi,

The modification you had proposed in that other thread was not complete. You had also added before the line:
$imageHelper = hikashop_get('helper.image');
And you didn't add that line again after the migration which is why it doesn't work.

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

  • Posts: 64
  • Thank you received: 1
  • Hikashop Business
2 years 1 week ago #346567

Thank you Nicolas!

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

Time to create page: 0.059 seconds
Powered by Kunena Forum