• Resolved gerard04

    (@gerard04)


    I have this plugin and it to put when you want to receive these product I saw it appears at the invoice at the bottom of the part where it say VAt, subtotal… but i want to move i have been trying to move it but it moves all the zone where it tells the vat an the subotal its like the same item

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @gerard04,

    1. Can you send a screenshot of an invoice to see where is the field? It would be great if you can highlight it.
    2. Can you tell me where do you want to display the field?
    3. Are you using a custom template?
    Thread Starter gerard04

    (@gerard04)

    Yes i am using a custom template.
    image of the invoice

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please share the code of your custom template using pastebin.com or another similar service?

    Thread Starter gerard04

    (@gerard04)

    Plugin Contributor kluver

    (@kluver)

    Hi @gerard04,

    It looks like the Woo Delivery plugin is storing the delivery data in the total rows for some reason. You can hide them in the totals table on your PDFs and add them to the order data table via the following code snippet:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_add_woo_delivery_data', 10, 2 );
    function wpo_wcpdf_add_woo_delivery_data( $template_type, $order ) {
    	$document = wcpdf_get_document( $template_type, $order );
    	$delivery_data = array( 'delivery_date', 'delivery_time', 'pickup_date', 'pickup_time' );
    	foreach( $document->get_woocommerce_totals() as $key => $total ) {
    		if ( in_array( $key, $delivery_data ) ) {
    			?>
    			<tr class="woo-delivery">
    				<th><?php echo $total['label']; ?></th>
    				<td><?php echo $total['value']; ?></td>
    			</tr>
    			<style>table.totals tr.<?php echo $key; ?> { display: none; }</style>
    			<?php
    		}
    	}
    }

    This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets or functions.php before please read this: How to use filters

    Thread Starter gerard04

    (@gerard04)

    Lots of thanks that worked perfectly. Nice help

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @gerard04,

    I’m glad to know that the code @kluver sent you worked!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I need help editin the invoice’ is closed to new replies.