• Resolved igor7319

    (@igor7319)


    Is it possible to export each product, that is in variable product?
    So if I have variable product Tracksuit that has pants size M and jacket size L, is it possible that I get pants and jacket as separate lines in export instead of one(tracksuit)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hi

    1. open section >Setup Fields>Products and drag field “Product Variation” to export

    2. open section “Misc Settings” and add following PHP code.

    More samples at https://algolplus.com/plugins/code-samples/
    thanks, Alex

    add_filter( "woe_fetch_order_products", function ($products, $order, $labels, $format, $static_vals) {
    	$new_products = array();
    	foreach($products as $product) {
    		$attrs = array_filter( array_map("trim", explode("|", $product['product_variation']) ) );
    		foreach($attrs  as $attr) {
    			$new_product = $product;
    			$new_product['product_variation']  = $attr;
    			$new_products[] = $new_product;
    		}		
    	} 
    	return $new_products;
    } , 10, 5);
    • This reply was modified 6 years, 8 months ago by algol.plus.
    • This reply was modified 6 years, 8 months ago by algol.plus.
    Thread Starter igor7319

    (@igor7319)

    That is just awesome. Thank yopu for your help.

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

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

The topic ‘Export each product in variable products’ is closed to new replies.