Skip to main content

Error calling Image thumbnail in Google Products XML

More
3 years 10 months ago - 3 years 10 months ago #346546 by yanliom
-- 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:
Code:
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:
Code:
$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: 3 years 10 months ago by yanliom.

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

More
3 years 10 months ago #346547 by nicolas
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.

More
3 years 10 months ago #346567 by yanliom
Thank you Nicolas!

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

Time to create page: 0.221 seconds
Powered by Kunena Forum