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

    (@algolplus)

    Hello

    I don’t see easy way, it requies some programming. Will you be able to do it ?

    Thread Starter paourissi

    (@paourissi)

    I will try. Can provide me with a snippet?

    Plugin Author algol.plus

    (@algolplus)

    add new key via >Setup Fields>Add Field
    fill this key(as array) inside hook with $order->get_id()
    add_action( "woe_summary_products_add_item", $key, $product_item, $order, $item ){
    },10,4);

    rebuild $_SESSION[‘woe_summary_products’] inside hook (repeat product line for each order_id )
    add_action( 'woe_summary_before_output' , function(){
    });

    Thread Starter paourissi

    (@paourissi)

    Its more complicated that i thought. Is it possible describe it with more details?

    Thank you.

    Plugin Author algol.plus

    (@algolplus)

    I will spend same time as I will program it .

    So add key “summary_report_order_id”

    USe this code

    add_action( "woe_summary_products_add_item", function( $key, $product_item, $order, $item ){
    $field = "summary_report_order_id";
    if( empty( $_SESSION["woe_summary_products"][$key][$field]))
    $_SESSION["woe_summary_products"][$key][$field] = array();
    $_SESSION["woe_summary_products"][$key][$field][] = $order->get_id();
    },10,4);
    add_action( 'woe_summary_before_output' , function(){
    $new_rows = array();
    foreach($_SESSION["woe_summary_products"] as $data) {
    foreach($data["summary_report_order_id"] as $idx=>$order_id){
    $new_row= $data;
    if($idx>0)
    foreach($new_row as $k=>$v) $new_row[$k]="";
    $new_row["summary_report_order_id"] = $order_id;
    $new_rows[] = $new_row;
    }
    }
    $_SESSION["woe_summary_products"] =$new_rows;
    });

    Thread Starter paourissi

    (@paourissi)

    Works great. Thank you so much

    Plugin Author algol.plus

    (@algolplus)

    You’re welcome

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.