• Resolved tdsm

    (@tdsm)


    Hi,

    We save a gallery of images using ACF gallery field for each product. I’d love to get each of these images to appear as a <g:additional_image_link>.

    Firstly, can you explain how the ‘Additional image 1’, ‘Additional image 2’ etc. are generated? Is it just generated from images uploaded to the product?

    I thought that perhaps there’d be filters in your codebase that we could use to adapt the attribute value but I can’t see any. This would be really useful.

    Imagine if the following filter was available;

    
    // For each attribute
    $attribute = apply_filters('woo_product_feed_attribute', $attribute, $product, $feed);
    
    // or even more specifically
    $attribute = apply_filters('woo_product_feed_attribute_' . $name, $attribute, $product, $feed);
    

    In our case, we could hook into the additional_image_link attribute and pass the image URLs from the gallery.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Thanks for using our plugin and reaching out to us.

    The <g:additional_image_link> fields can be added the field mapping section of our plugin by hitting the orange “+ add field mapping” button. That will result in extra field mapping rows to appear. In the left drop-downs you can then select the additional image fields, in the right drop-downs you than need to select the AFC custom field names that hold your images.

    It will then look something like this:
    https://www.dropbox.com/s/l7tefim81ycompc/additional-images2.png?dl=0
    In the example above our AFC are named “Additional image 1 to 4”, in your case they will be named differently.

    Hope this helps?

    Thread Starter tdsm

    (@tdsm)

    Thanks for the quick reply, but it doesn’t really answer my question I’m afraid.

    I’m interested about whether it’s possible as a developer to hook into the feed at any point in order to override the attribute values. I realise that I could create custom fields in ACF and assign to each ‘Additional image’ but the other part of my question was specifically about where the default additional image links are pulled from.

    Firstly, can you explain how the ‘Additional image 1’, ‘Additional image 2’ etc. are generated? Is it just generated from images uploaded to the product?

    I’m interested about whether it’s possible as a developer to hook into the feed at any point in order to override the attribute values

    –> Unfortunately that is not possible.

    The other part of my question was specifically about where the default additional image links are pulled from.

    –> Additional images are not being pulled from anywhere by default. They can be linked to any attribute you want, such as the ACF field. Default they are not being added to the feed.

    Thread Starter tdsm

    (@tdsm)

    Ahhh, ignore me! I’ve just realised that the product gallery field is actually part of WooCommerce which is providing these 10 additional image fields for me out of the box!

    Check, that is correct ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom fields mapping – ACF gallery and g:additional_image_link’ is closed to new replies.