a:1:{s:10:"everywhere";a:1:{i:0;a:12:{s:2:"id";i:5409;s:5:"title";s:16:"Untitled Snippet";s:4:"code";s:956:"add_action( 'woocommerce_cart_totals_after_order_total', 'wtwh_show_total_discount_cart_checkout', 9999 );
add_action( 'woocommerce_review_order_after_order_total', 'wtwh_show_total_discount_cart_checkout', 9999 );
  
function wtwh_show_total_discount_cart_checkout() {   
   $discount_total = 0;  
   foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {         
      $product = $values['data'];
      if ( $product->is_on_sale() ) {
         $regular_price = $product->get_regular_price();
         $sale_price = $product->get_sale_price();
         $discount = ( (float)$regular_price - (float)$sale_price ) * (int)$values['quantity'];
         $discount_total += $discount;
      }
   }          
   if ( $discount_total > 0 ) {
      echo '<tr><th>You Saved</th><td data-title="You Saved">' . wc_price( $discount_total + ($woocommerce->cart->discount_cart + $woocommerce->cart->discount_cart_tax) ) .'</td></tr>';
   }
}";s:9:"code_type";s:3:"php";s:8:"location";s:10:"everywhere";s:11:"auto_insert";i:1;s:13:"insert_number";i:1;s:9:"use_rules";b:0;s:5:"rules";a:0:{}s:8:"priority";i:10;s:14:"location_extra";s:0:"";s:20:"shortcode_attributes";a:0:{}}}}