• Is there a filter I can add in my functions to display the original price on the order details page? We have to add (39.34 + 13.11 = 52.45) to get the original amount. This happens to discounted orders only.

Viewing 1 replies (of 1 total)
  • Thread Starter bigrat95

    (@bigrat95)

    Here is the solution if someone need it.

    
      //Add original price without the discount in the order page
    function action_woocommerce_admin_order_item_values( $null, $item, $absint ) {
        $val = ($item['type'] == 'line_item' || $item['type'] == 'shipping') ? $item['subtotal'] : ' ';
        $valdecimal = wc_format_decimal( $val, $dp='', $trim_zeros );
        ?>
        <td class="item_fcost" data-sort-value="<?php echo $val; ?>">
            <div class="view" style="font-weight: bold; text-align: right; padding-right: 10px;">
                <?php if ($val>0) echo '$'; echo $valdecimal;?>
            </div>
        </td>
        <?php
    };
    add_action( 'woocommerce_admin_order_item_values', 'action_woocommerce_admin_order_item_values', 10, 3 );
    
    function action_woocommerce_admin_order_item_headers( $order ) {
        echo '<th class="item_fcost sortable" data-sort="float" style="text-align: right;">Original Cost</th>';
    };
    add_action( 'woocommerce_admin_order_item_headers', 'action_woocommerce_admin_order_item_headers', 10, 3 );
Viewing 1 replies (of 1 total)
  • The topic ‘display cost wiyhout the coupons reduction in the order details page’ is closed to new replies.