• Resolved lourencolemos

    (@lourencolemos)


    When I am managing my orders, it shows price incl VAT at the very bottom, but what I need is to show prices incl VAT on each product. Now it shows products with price without VAT and then at the bottom final price with VAT.

    Can I somehow set this up?

    When a client makes a purchase and I click on it to see what he bought, I see 4 columns, I see the price of the products he bought, I see the quantity, I see the total price and I see the VAT (IVA in my case).

    Id like to surplus the IVA value to the product price.

    So in my image https://i.imgur.com/ei1EWp7.png the first value of €3.53 it would automatically add the IVA of €0.81 giving me a price of €4.34, which is the price the client paid.

    Is there a way to enable this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • AJ a11n

    (@amandasjackson)

    Hi @lourencolemos

    I’m not sure why you would not want to see the VAT charged as an admin, but currently with WooCommerce core there is not a way to charge tax on products but have it displayed as a single total on the order in the admin area.

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter lourencolemos

    (@lourencolemos)

    Hey Amanda, you can close this as I have found a solution.

    function action_woocommerce_admin_order_item_values( $null, $item, $absint ) {
        $val = ($item['type'] == 'line_item' || $item['type'] == 'shipping') ? $item['total'] + $item['total_tax'] : ' ';
        $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;">Pre?o com IVA</th>';
    };
    add_action( 'woocommerce_admin_order_item_headers', 'action_woocommerce_admin_order_item_headers', 10, 3 );

    This was the code that I used, it added a new column on the backoffice order panel that allows me to see each product price with the price already included. Including order total.

    AJ a11n

    (@amandasjackson)

    Glad to hear it – thanks for letting us know!

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Include VAT when looking at a costumers order.’ is closed to new replies.