• Resolved yashshah1800

    (@yashshah1800)


    How do i show the cost in the table similar to quantity as seen in the code.

    How do i display the cost of each item in the invoice. Plz help asap plz. thank you,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    You can get this with the Premium Templates extension, it’s an option in the price block (of which you can have multiple per item):

    Ewout

    How to do it WITHOUT BUYING (Professional) or Premium Templates extension?

    I presume it could be simple, if only knew the right variable. Something like this?

    <th class=”price”>’); ?><?php _e(‘Price’, ‘wpo_wcpdf</th>

    After a little bit tinkering here is the solution. I just made my own template copying everything from existing

    1. plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/{your template name}/invoice.php
    2. Add new table rows

    	<thead>
    		<tr>
    			<th class="product"><?php _e('Product', 'wpo_wcpdf'); ?></th>
    			<th class="quantity"><?php _e('Quantity', 'wpo_wcpdf'); ?></th>
    			<th class="price"><?php _e('Product price without VAT', 'wpo_wcpdf'); ?></th>
    			<th class="price"><?php _e('Product prices VAT', 'wpo_wcpdf'); ?></th>
    			<th class="price"><?php _e('Price including VAT', 'wpo_wcpdf'); ?></th>
    		</tr>
    	</thead>

    3. Next find <td class=”price”><?php echo $item[‘order_price’]; ?></td> and replace it with

    			<td class="price"><?php echo $item['line_total']; ?></td> <!-- line total (line without VAT/TAX) -->
    			<td class="line-tax"><?php echo $item['line_tax']; ?></td> <!-- line tax (only VAT/TAX) -->
    			<td class="price"><?php echo $item['order_price']; ?></td> <!-- Price total with VAT/TAX (single line) -->

    And that’s all.

    Hope it helps.

    Thread Starter yashshah1800

    (@yashshah1800)

    Thanks, I was able to get it with

    <th class=”cost”><?php _e(‘Cost’, ‘wpo_wcpdf’); ?></th>

    <?php echo $item[‘single_price’]; ?>

    in invoice.php

    Thread Starter yashshah1800

    (@yashshah1800)

    Yes your solution works too.
    How do i display the regular price of the product.

    <?php echo $item[‘line_total’]; ?> gives the sale price of the product. How do i display the regular price?

    Thread Starter yashshah1800

    (@yashshah1800)

    Also How do i display the quantity of the product item? Plz guide. Thank you,

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display Cost of each item?’ is closed to new replies.