• Resolved bigrat95

    (@bigrat95)


    Is there a way I can display the original price on the order details page without the coupon reduction? We have to add (39.34 + 13.11 = 52.45) to get the original amount. This happens to discounted orders only.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This would likely be possible with a custom template for the order details page, with a display of only the pre-discount line item info.

    We highly recommend contacting one of the services on our Customizations page if you are not familiar enough with PHP to do this on your own. (https://woocommerce.com/customizations/)

    Thread Starter bigrat95

    (@bigrat95)

    I found a simple snippet of code to add in the Functions.php

    
      //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 );

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘woocmmerce price display’ is closed to new replies.