• Resolved tiwelle

    (@tiwelle)


    Hello,
    Is it possible to get WooCommerce Checkout Add-Ons fields exported as row (like product) ?
    Thank you ! Great plugin by the way !

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

    (@algolplus)

    hello

    Could you send me this plugin (it’s not free) ? as .zip file to [email protected] ?

    Please, attach screenshot of your fields too ( at page “Checkout Add-Ons Editor” ).

    Thread Starter tiwelle

    (@tiwelle)

    It’s done.
    I hope you’ll find a solution ??
    Thank you,
    Manue

    Plugin Author algol.plus

    (@algolplus)

    hi Manue

    try add following code to functions.php

    add_filter( "woe_fetch_order_products", "woe_add_checkout_fields",10,5);
    function woe_add_checkout_fields( $products, $order, $labels, $format, $static_vals ) {
    	$order_add_ons    = wc_checkout_add_ons()->get_order_add_ons( $order->id );
    	foreach($order_add_ons  as $item) {
    		$label = $item["checkout_label"]? $item["checkout_label"] : $item["name"];
    		$options = maybe_unserialize($item["normalized_value"]);
    		// multiselect  is array
    		if(is_array($options))
    			$options = join(", ",$options);
    		//fill only name 
    		$new_product = array("name" => $label." : ". $options);
    		$products[] = $new_product;
    	}
    	return $products;
    }
    
    Thread Starter tiwelle

    (@tiwelle)

    You’re like a code god ! Thank you !

    I do have another question for you.
    Let’s say we have 4 lines in 1 order (3 products and 1 extra cost). Is it possible to get this twice, with in 1 block price without tax, and 1 block price with tax (so we have 8 lines) ?

    Plugin Author algol.plus

    (@algolplus)

    yes, but I need sample file again

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Export WooCommerce Checkout Add-Ons as row’ is closed to new replies.