• Resolved nasirovemin

    (@nasirovemin)


    Im a customer of wp all import about 5 years.
    Couple days ago i purchased wpallexport plugin for creating feeds.
    Im facing with a problem below; my scenario;
    -I have a woocommerce store with variation products.
    -I have 3 images for each products; one for featured image others for gallery.
    PROBLEM:
    when i was trying to export feed only variation (Only export product variations),
    cvs column with image url comes empty?
    but when I added image to a variation, then it shows only 1 image of product. but im not now happy with that, however i need to show all 3 images, (Export attached images with seperator DOES not work!!)

    QUESTION?
    I want to export products feed include only variations (I have size variation) and images of product.
    sample feed attached.

    pls help?

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

    (@wpallimport)

    Hi @nasirovemin

    It sounds like your variations don’t have any images. Do the images only exist on the parent level (parent featured image and product gallery)? If so, you’d have to use a custom PHP function to include them on the variation level: https://www.wpallimport.com/tour/export-developer-friendly/.

    Here’s an example function that you can modify as needed:

    function my_get_images( $parent_id = 0 ) {
    	if ( empty( $parent_id ) ) return;
    	
    	$parent = wc_get_product( $parent_id );
    	if ( empty( $parent ) ) return;
    	
    	$images = array();
    	$images[] = wp_get_attachment_url( $parent->get_image_id() );
    	
    	$gallery = $parent->get_gallery_image_ids();
    	if ( ! empty( $gallery ) ) {
    	    foreach ( $gallery as $img ) {
                    $images[] = wp_get_attachment_url( $img );
                }
            }
        
        return ( ! empty( $images ) ) ? implode( ",", $images ) : null;
    }

    This function should be used on the “Parent Product ID” field (you can change the column name).

    Plugin Author WP All Import

    (@wpallimport)

    @nasirovemin I’m marking this as resolved since we haven’t heard back. Please feel free to follow up here if you’re having the same issue. Anyone else, please open a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WPAllExport – Export attached images with seperator DOES not work!’ is closed to new replies.