Announcement

Collapse
No announcement yet.

Image Paths in New Data Feed

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

    Image Paths in New Data Feed

    Hi, In the new data feed template for product images we're not getting the full image path, only after /mm5/. I tried to hard code the base url in the feed template but then products that don't have extra images have a broken path (makes google shopping unhappy). How can we include the full path as we do in Weiland's template data feed to the main image and then the full path to the extra images when an extra image exists? Thank you...

    #2
    You can use something like this:

    Code:
    <mvt:if expr="NOT ISNULL l.settings:record:customfield:main">
        <mvt:assign name="g.full_image_path" value="g.domain:base_url $ l.settings:record:customfield:main" />
    <mvt:else>
        <mvt:assign name="g.full_image_path" value="''" />
    </mvt:if>
    Then you can use &mvt:global:full_image_path; wherever you want the full path to display
    Last edited by Brennan; 10-21-16, 08:24 AM.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Another alternative is to configure this using the Feed Rules in Google Merchant Center. Its pretty easy to set up, at least for your main image and one additional image. But while Google Shopping Feed supports multiple Additional Image Links, they don't differentiate them. They just have you use multiple Additional Image columns so trying to configure multiple Additional Image Columns doesn't seem to work in the Merchant Center Feed Rules, only the main image and one additional image.

      The above code works well for getting the full url of the main image generated by the Miva feed. It appears a separate conditional would need to be in place for each additional photo in the feed as well or is there a way to get a single conditional to work for all images?

      Which brings up the question of why isn't this configured to generate the full url out of the box considering this is a feed module? Just curious, it would make it much easier to configure, especially for multiple Additional Images and its already generating the full url for the &mvt:record:url; field.

      Comment


        #4
        Originally posted by mikel View Post

        Which brings up the question of why isn't this configured to generate the full url out of the box considering this is a feed module? Just curious, it would make it much easier to configure, especially for multiple Additional Images and its already generating the full url for the &mvt:record:url; field.
        One guess would be because some sites use a CDN network to serve resources like images...but that's just a guess.

        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          I'm wondering if there was ever an update for handling additional images in shopping feed with with full image path? And, if not, and still using Brennan's solution above how do I code for "record:customfield:ei2", "record:customfield:ei3", etc?

          Mike

          Comment


            #6
            The solution above still works and is needed to get the full path. As for other image types, replace "main" with other image type codes to output the other image type paths.
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment


              #7
              Hi, I tried this in both the header template and the top of Iterator template before the row series.

              <mvt:if expr="NOT ISNULL l.settings:record:customfield:ei2">
              <mvt:assign name="g.full_image_path" value="g.domain:base_url $ l.settings:record:customfield:ei2" />
              <mvt:else>
              <mvt:assign name="g.full_image_path" value="''" />
              </mvt:if>


              with: "&mvt:record:customfield:ei2;" in the Iterator template row but I'm not getting the base in the path. What did I do wrong?
              Last edited by mjstonez; 11-18-24, 01:44 PM.

              Comment

              Working...
              X