• Resolved edvision

    (@edvision)


    Hi! I have a problem with exporting a custom xml feed.

    I am exporting all the variable products, exporting only the variations.

    I would like to insert the featured image of the parent product in the feed for each variation.

    Is it possible? Thanks a lot

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @edvision,

    I would like to insert the featured image of the parent product in the feed for each variation. Is it possible?

    Yes, you can do that with a custom PHP function in the export. We have information on using PHP functions in custom XML exports at the bottom of this page: https://www.wpallimport.com/documentation/export-wordpress-data-to-custom-xml-feed/.

    The idea would be to pass the Parent Product ID element to the function, then use something like this to fetch its image URL:

    function my_get_image( $parent_id ) {
        if ( $product = wc_get_product( $parent_id ) ) {
            return wp_get_attachment_url( $product->get_image_id() );
        }
    }
    Plugin Author WP All Import

    (@wpallimport)

    Hi @edvision,

    I am marking this thread as resolved since it’s been inactive. Please feel free to open a new topic if you have any other questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Featured Image in Variations feed xml’ is closed to new replies.