Home › Forums › WoodMart support forum › How to reference variation gallery images in functions.php › Reply To: How to reference variation gallery images in functions.php
May 29, 2020 at 3:05 pm
#199005
testing123
Participant
We use WooCommerce’s Google Product Feed extension which supplies all product information, images, etc to Google, and in the case of variations that have gallery images (not just a main image), the Google feed seems to be receiving images from one big pool based on the parent product. So essentially, each variation is getting ALL the gallery images for every variation, instead of just the gallery images for that specific variation. I’ve included a snippet of the XML (showing two variations) so you can see what that looks like.
<item>
<g:ID>woocommerce_gpf_135944</g:ID>
<g:item_group_id>woocommerce_gpf_135941</g:item_group_id>
<title>
<![CDATA[ Minelab X-TERRA 505 Metal Detector Bundles (Product Bundle: Treasure Bundle) ]]>
</title>
<link>https://sdcomlivedev.wpengine.com/product/minelab-x-terra-505-metal-detector-bundles/?attribute_pa_product-bundle=treasure-bundle</link>
<description>
<![CDATA[ <p>Bundled items included:</p> <ul> <li>Serious Detecting Camo Pouch</li> <li>Nylon digging trowel</li> <li>Pair of dipped digging gloves</li> </ul> ]]>
</description>
<g:image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2019/08/3705-0113-PKSD02ML-001-2.jpg ]]>
</g:image_link>
<g:price>349.00 USD</g:price>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2019/08/3705-0113-2018.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_15.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_35.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_35_battery.jpg ]]>
</g:additional_image_link>
<g:availability>
<![CDATA[ in stock ]]>
</g:availability>
<g:condition>
<![CDATA[ new ]]>
</g:condition>
<g:brand>
<![CDATA[ Minelab ]]>
</g:brand>
<g:product_type>
<![CDATA[ Metal Detectors _ Minelab _ Minelab X-TERRA 505 ]]>
</g:product_type>
<g:google_product_category>
<![CDATA[ 361 ]]>
</g:google_product_category>
<g:size_system>
<![CDATA[ US ]]>
</g:size_system>
<g:adwords_labels>
<![CDATA[ Metal Detectors ]]>
</g:adwords_labels>
<g:min_handling_time>
<![CDATA[ 1 ]]>
</g:min_handling_time>
<g:max_handling_time>
<![CDATA[ 1 ]]>
</g:max_handling_time>
<g:promotion_id>
<![CDATA[ 0 ]]>
</g:promotion_id>
<g:mpn>
<![CDATA[ 3705-0113-test01 ]]>
</g:mpn>
<g:gtin>
<![CDATA[ 811493012957 ]]>
</g:gtin>
<g:shipping_height>
<![CDATA[ 16 cm ]]>
</g:shipping_height>
<g:shipping_width>
<![CDATA[ 30 cm ]]>
</g:shipping_width>
<g:shipping_length>
<![CDATA[ 59 cm ]]>
</g:shipping_length>
<g:shipping_weight>2438.057 g</g:shipping_weight>
</item>
<item>
<g:ID>woocommerce_gpf_135945</g:ID>
<g:item_group_id>woocommerce_gpf_135941</g:item_group_id>
<title>
<![CDATA[ Minelab X-TERRA 505 Metal Detector Bundles (Product Bundle: Adventure Bundle) ]]>
</title>
<link>https://sdcomlivedev.wpengine.com/product/minelab-x-terra-505-metal-detector-bundles/?attribute_pa_product-bundle=adventure-bundle</link>
<description>
<![CDATA[ <p>Includes Serious Detecting metal detector bag, Serious Detecting Camo Pouch, Nylon digging trowel, gloves, and Serious Detecting cap</p> ]]>
</description>
<g:image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2019/08/3705-0113-PKSD02ML-002-1.jpg ]]>
</g:image_link>
<g:price>389.00 USD</g:price>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2019/08/3705-0113-2018.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_15.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_35.jpg ]]>
</g:additional_image_link>
<g:additional_image_link>
<![CDATA[ https://sdcomlivedev.wpengine.com/wp-content/uploads/2020/05/3705-0113_profind_35_battery.jpg ]]>
</g:additional_image_link>
<g:availability>
<![CDATA[ in stock ]]>
</g:availability>
<g:condition>
<![CDATA[ new ]]>
</g:condition>
<g:brand>
<![CDATA[ Minelab ]]>
</g:brand>
<g:product_type>
<![CDATA[ Metal Detectors _ Minelab _ Minelab X-TERRA 505 ]]>
</g:product_type>
<g:google_product_category>
<![CDATA[ 361 ]]>
</g:google_product_category>
<g:size_system>
<![CDATA[ US ]]>
</g:size_system>
<g:adwords_labels>
<![CDATA[ Metal Detectors ]]>
</g:adwords_labels>
<g:min_handling_time>
<![CDATA[ 1 ]]>
</g:min_handling_time>
<g:max_handling_time>
<![CDATA[ 1 ]]>
</g:max_handling_time>
<g:promotion_id>
<![CDATA[ 0 ]]>
</g:promotion_id>
<g:mpn>
<![CDATA[ 3705-0113-test02 ]]>
</g:mpn>
<g:gtin>
<![CDATA[ 811493012957 ]]>
</g:gtin>
<g:shipping_height>
<![CDATA[ 16 cm ]]>
</g:shipping_height>
<g:shipping_width>
<![CDATA[ 30 cm ]]>
</g:shipping_width>
<g:shipping_length>
<![CDATA[ 59 cm ]]>
</g:shipping_length>
<g:shipping_weight>2438.057 g</g:shipping_weight>
</item>