Philip R
Forum Replies Created
-
This happened after adding a tracking number and marking order completed. Using latest version 1.2.4
You are in Woocommerce > PDF Invoices?
Then once you do that, refresh the General tab on the plug-in, and in Choose your template select your custom template (it will be the name of the folder you created).
I see template-functions.php
in the below mentioned location:
1. /public_html/WordPress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple/template-functions.phpShould I update the code here?
No, don’t do that. Follow the instructions and copy them into a new folder as advised.
You create it yourself. See in the General tab for the plug-in it says: Want to use your own template? Copy all the files from
wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple
to your (child) theme inwp-content/themes/flatsome-child/woocommerce/pdf/yourtemplate
to customize them(I am using a theme called Flatsome)
So make sure you follow those instructions and copy all the files.
Thanks for the update, @pomegranate ! I just swapped it in and it looks good. And I see you already updated your post and replaced “invoice” with “packing-slip”) – thanks!
@majithiaharshil On your invoice (or packing slip in my case), it adds the tracking number right after the tracking method (i.e., FedEx, UPS, etc), in the “Tracking:” section.
@majithiaharshil I put in in the template-functions.php file, which goes in this folder: wp-content > themes > [your child theme] > woocommerce > pdf > [whatever you name your custom setting]
P.S. In case anyone else needs this, I replaced
invoice
in your code withpacking-slip
, since that really where we use it. Our workflow is, once the tracking number is generated with FedEx, etc., we print the label, update the order in WP and then print the packing slip, to match it to the label and ensure the contents are correct. Thanks again.You have done it! Thank you so much for your patience and help with this.
Thanks, @alexmigf. Forgive me, I don’t understand if I should be replacing the earlier code that you sent me, or adding this new code somewhere.
Hi @alexmigf and thanks for your reply.
Almost there. However, no value is shown for
tracking_provider
andtracking_number
. I followed your advice and installed the Woocommerce Store Toolkit plug-in and I found this in the Order Post Meta:_wc_shipment_tracking_items ? 0 ? ? tracking_provider fedex ? ? custom_tracking_provider ? ? custom_tracking_link ? ? tracking_number 770188300645 ? ? date_shipped 1586217600 ? ? tracking_id 45a3b570e48da984f386425dfb69a296
So I guess I just need to know how to access those items since they are not “first-level” (sorry I am not a developer so I don’t know the correct term).
Thanks. So I have used Example 1 to print a delivery date on the packing slip in template-functions.php, which puts the custom field in the correct place.
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_delivery_date', 10, 2 ); function wpo_wcpdf_delivery_date ($template_type, $order) { $document = wcpdf_get_document( $template_type, $order ); if ($template_type == 'packing-slip') { ?> <tr class="delivery-date"> <th>Delivery Date:</th> <td><?php $document->custom_field('delivery_date'); ?></td> </tr> <?php } }
I guess I just don’t know exactly how I should modify this code to use the meta references provided here, so I can replace the delivery date with the tracking provider and tracking number. I know I need to use
tracking_provider
andtracking_number
somehow, I just don’t know what the code needs to look like.Thanks. I finally found it in thesis_185>lib>functions>content.php
I probably am not supposed to modify that file, but I deleted the line
wp_link_pages($lp_args);
and it worked.
If anyone has a more “correct” way to do this by modifying the custom_functions.php file (i.e., with
remove_action
orremove_filter
please let me know.Hello Jeremy,
The code works great, but I don’t know how to remove the original
wp_link_pages()
because I’m using Thesis, so I wind up with duplicate page navigation.Here is the page I am trying it out on.
I had added your function to my custom_functions.php file.
Is there a way to remove
wp_link_pages()
in Thesis 1.8.5?