- Posts: 66
- Thank you received: 1
Get image thumbnail in Google products xml
6 years 4 weeks ago #323451
by yanliom
Get image thumbnail in Google products xml was created 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:
Is it correct if I change it to the following to get the product's thumbnail at 500x500?
Thank you in advance,
Yannis
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.
6 years 4 weeks ago #323456
by nicolas
Replied by nicolas on topic Get image thumbnail in Google products xml
Hi,
No, I think you want to do instead:
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.178 seconds