Get image thumbnail in Google products xml

  • Posts: 64
  • Thank you received: 1
  • Hikashop Business
3 years 8 months ago #323451

Hello,

in the xml file produced by the Hikashop Google Products Plugin I would like to get the product image thumbnail instead of the original product image.

In the plugin code this is the line which gets the image_link:

$xml .= "\t".'<g:'.$name.'>'.htmlspecialchars($siteAddress.$this->main_uploadFolder_url.$image->file_path).'</g:'.$name.'>'."\n";

Is it correct if I change it to the following to get the product's thumbnail at 500x500?
$img_thumb = $imageHelper->getThumbnail($image->file_path, array(500, 500), array('default' => true));

$xml .= "\t".'<g:'.$name.'>'.htmlspecialchars($siteAddress.$this->main_uploadFolder_url.$image_thumb).'</g:'.$name.'>'."\n";

Thank you in advance,
Yannis

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

  • Posts: 81716
  • Thank you received: 13107
  • MODERATOR
3 years 8 months ago #323456

Hi,

No, I think you want to do instead:

$img_thumb = $imageHelper->getThumbnail($image->file_path, array(500, 500), array('default' => true));

$xml .= "\t".'<g:'.$name.'>'.htmlspecialchars($img_thumb->url).'</g:'.$name.'>'."\n";

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

Time to create page: 0.053 seconds
Powered by Kunena Forum