Support » Plugin: Advanced Order Export For WooCommerce » All products exported with amount sold

  • Hello! My client wants to have every product on the export, with the amount sold next to it. Right now its only set to show the products that have been ordered, but she wants every product on the sheet with a zero next to it if it hasn’t been ordered. Is there a way to do this?

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

    (@algolplus)

    Hello Ashley

    Could you try following code ? Just put it in section “MIsc Settings”.

    But you must modify this code, to fill necessary product columns.
    thanks, Alex

    add_action( 'woe_summary_before_output' , function(){
     $args = array( "limit" => -1, "orderby"=>"name" , "order"=>"ASC");
     foreach(wc_get_products($args) as $product) {
      $pid = $product->get_id();
      if( !isset($_SESSION['woe_summary_products'][$pid]) ) {
       $new_row = array();
       $new_row["name"] = $product->get_name();
       $new_row["sku"] = $product->get_sku();
       // more row here , like $new_row["item_price"] = $product->get_price();
       $new_row["summary_report_total_qty"] = 0;
       $new_row["summary_report_total_amount"] = 0;
       $_SESSION['woe_summary_products'][$pid] = $new_row;
      } 
     } 
    });
Viewing 1 replies (of 1 total)
  • The topic ‘All products exported with amount sold’ is closed to new replies.