With Google wanting higher resolution images in the feed for use on YouTube ads etc I wanted to include the zoom image instead of the smaller product image, however this meant stripping out the path from the ZoomImage0 variable as Sellerdeck have no raw image variable available for Zoom images.
I have wrapped the ZoomImage0 variable in a piece of php to strip the path leaving the raw image filename, then added this inside a couple of conditions, now the result is that if a ZoomImage0 exists this will be used in the Google feed, if its empty the feed will default to the standard product image, to use simply replace everything inside the image tag (<g:image_link>---</g:image_link>) within the Google product feed layout (Design/Library/Layouts/XML Feeds/Google Product Feed Layout) with the following:
*As always backup the layout first.
The above could also be used to add a list of Zoom Images to your feed to supply multiple pictures to Google, just change the ZoomImage0 to ZoomImage1, 2, 3 etc, however you would need to wrap each extra image in a Block so that it only gave an output if another image was available, for example:
Also it is vital that each ZoomImage variable you use has encoding set to Perl.
I have wrapped the ZoomImage0 variable in a piece of php to strip the path leaving the raw image filename, then added this inside a couple of conditions, now the result is that if a ZoomImage0 exists this will be used in the Google feed, if its empty the feed will default to the standard product image, to use simply replace everything inside the image tag (<g:image_link>---</g:image_link>) within the Google product feed layout (Design/Library/Layouts/XML Feeds/Google Product Feed Layout) with the following:
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsBaseHREFStandard%22%20%2f%3e" ><actinic:variable name="CatalogURL" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsBaseHREFSSL%22%20%2f%3e" ><actinic:variable name="SSLCatalogURL" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22ZoomImage0%22%20%2f%3e%20%3d%3d%20%22%22"><actinic:variable name="ProductImageFileNameRaw" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22ZoomImage0%22%20%2f%3e%20%21%3d%20%22%22"><actinic:block php="true" >$file_path = "<actinic:variable encoding="perl" name="ZoomImage0" />"; $image_name = basename($file_path); echo $image_name;</actinic:block></actinic:block>
The above could also be used to add a list of Zoom Images to your feed to supply multiple pictures to Google, just change the ZoomImage0 to ZoomImage1, 2, 3 etc, however you would need to wrap each extra image in a Block so that it only gave an output if another image was available, for example:
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22ZoomImage1%22%20%2f%3e%20%21%3d%20%22%22"><g:additional_image_link><actinic:block if="%3cactinic%3avariable%20name%3d%22IsBaseHREFStandard%22%20%2f%3e" ><actinic:variable name="CatalogURL" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsBaseHREFSSL%22%20%2f%3e" ><actinic:variable name="SSLCatalogURL" /></actinic:block><actinic:block php="true" >$file_path = "<actinic:variable encoding="perl" name="ZoomImage1" />"; $image_name = basename($file_path); echo $image_name;</actinic:block></g:additional_image_link></actinic:block>
Comment