Announcement

Collapse
No announcement yet.

Use 1st Zoom Image in Google Product Feed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Use 1st Zoom Image in Google Product Feed

    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:

    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>
    *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:

    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>
    Also it is vital that each ZoomImage variable you use has encoding set to Perl.
    Many Thanks
    Lee
    www.mdnsupplies.co.uk
    www.hookandloopfasteners.co.uk

    #2
    We use the zoom images for Google Feed.

    we use Mole Ends feed so you just set the field and upload.
    Regards

    Jason

    Titan Jewellery (Swift Design)
    Zirconium Rings
    Damascus Steel Rings

    Comment

    Working...
    X