Skip to main content

Get image thumbnail in Google products xml

More
6 years 4 weeks ago #323451 by yanliom
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:
Code:
$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?
Code:
$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.

More
6 years 4 weeks ago #323456 by nicolas
Hi,

No, I think you want to do instead:
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";

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

Time to create page: 0.129 seconds
Powered by Kunena Forum