WooCommerce - Invoice PDF Template:

WooCommerce Released
25 May, 2021 08:16:44
gerhalligan
Topics: 2
Messages: 9
Hi,

How do you use the Invoice PDF Template field in settings. I have created an invoice template and have set it in this field in settings and I've ticked to show invoices on completed orders but no invoice is attached to the email for completed orders?

I can't find anything on this in the docs, can you explain what this is used for, please?

Thanks,
Ger
25 May, 2021 08:20:40
E2Pdf
Support
Topics: 7
Messages: 3156
Hi,

It must show invoice download button on completed order inside "My Orders" section. If you need to send PDF on completed order email you can just add [e2pdf-attachment id="1"] shortcode to "Additional content" of "Completed Order" email, where 1 is the ID of your E2Pdf Template.

P.S. We are currently working on update for WooCommerce extension which must be released on this - next week, after this we will update docs and will add explanation to this option. Sorry for inconvenice.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
25 May, 2021 08:54:35
gerhalligan
Topics: 2
Messages: 9
Thank you for your quick response.

OK, so that's why I didn't see as we don't really use the My Orders section for customers.

I did try what you suggested and the invoice does get attached but it is missing the order metadata. I'm using this shortcode [e2pdf-wc-order key="item_type" subkey="slug" index="0" order_item_meta="true"] which is labelled as Order Item Meta in the visual mapper.

Can you tell me which shortcode I should be using to return the order meta, please?
25 May, 2021 09:49:35
E2Pdf
Support
Topics: 7
Messages: 3156
Actually if it's simple meta key it must be used for example:

[e2pdf-wc-order key="_order_key" meta="true"]

Where "_order_key" is meta key to retrieve.

If you are using shortcode:

[e2pdf-wc-order key="item_type" subkey="slug" index="0" order_item_meta="true"]

"key" is item type from "wp_woocommerce_order_items" table, and subkey is the key from "wp_woocommerce_order_itemmeta" table, "index" is the index of item type, for example shortcode below will output "product_id":

[e2pdf-wc-order key="line_item" subkey="_product_id" index="0" order_item_meta="true"],

As an alternative it's also possible to use [e2pdf-wc-product] shortcodes inside "Orders" Template, however "Visual Mapper" currently doesn't have it, for example.

[e2pdf-wc-product key="_product_id" order_item_meta="true" index="0"]

or

[e2pdf-wc-product key="post_title" index="0"]

or

[e2pdf-wc-product key="_sku" meta="true" index="0"]

Where "index" is the product id index added to order.

To get "e2pdf-wc-product" shortcodes you can temporary switch template to "Products" instead of "Orders" via "Options" and after mapping just add needed "index" attribute and revert template back to "Orders".

If you are still failing to get needed data, let us know please which exactly data do you need to retrieve? For example "Product name", "Custom Attribute", "Price", Some "custom field" or anything else. It will be very usefull if you connect some screenshots.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
26 May, 2021 13:29:53
gerhalligan
Topics: 2
Messages: 9
Thank you Oleksandr, for providing that info but unfortunately I am unable to get the data I need. I have attached a screen shot of a sample of the gravity form metadata I need to show on the invoice.

This isn't the only product, so the metadata will change. Is it possible to show this info?

Thanks,
Ger
26 May, 2021 13:31:48
gerhalligan
Topics: 2
Messages: 9
Sorry, can you delete the image I just posted above please lol.

The correct one is on this message
27 May, 2021 02:01:48
E2Pdf
Support
Topics: 7
Messages: 3156
If it's it's Gravity Forms it must work as follows:

[e2pdf-wc-product key="_Group Scheme number" order_item_meta="true" index="0"]

[e2pdf-wc-product key="Policy Start Date" order_item_meta="true" index="0"]

[e2pdf-wc-product key="Policy End Date" order_item_meta="true" index="0"]

[e2pdf-wc-product key="Email address" order_item_meta="true" index="0"]

Keep attention please on letters case as it's case sensative.

If it will not work, can you check please via phpMyAdmin in which table this data is saved and which "key" it has? Thank you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
2 June, 2021 00:37:56
gerhalligan
Topics: 2
Messages: 9
Sorry for the delay in responding Oleksandr.

Thank you for your help so far.

I was hoping the invoice could be generic for different gravity form products. I was looking for the same as can be done for items in the cart which can be exported using one shortcode. I'm guessing from your solutions there is no way to extract all of the GF meta data using one shortcode, is that correct?
2 June, 2021 00:52:45
E2Pdf
Support
Topics: 7
Messages: 3156
Hi,

Unfortunately currently yes, it's not possible, however we are preparing update which will add possibility to iterate over products and meta which must solve the current issue. We really hope to release it till the end of this week. So if you are able to wait we will notify you when you can update to test if it will fit your needs or it's need to add some improvement. Sorry for inconvenience.

We remain at your service.


We would really appreciate your feedback at WordPress.org!
2 June, 2021 00:57:16
gerhalligan
Topics: 2
Messages: 9
Oh no, I can definitely wait, that's no problem. It's great that you are already working on it and that'll it'll be ready so soon.
Please do let me know when it is available to test :)

Thanks and have a great day!
10 June, 2021 05:17:23
E2Pdf
Support
Topics: 7
Messages: 3156
Hi,

Sorry for the delay. We finally released RC Version 1.16.00 which has improvements to WooCommerce extension. You can follow this tutorial to update plugin to 1.16.00: https://e2pdf.com/support/desk/how-to-update-plugin-to-rc-release-candidate-version-from-e2pdf-com.

After update it must be come available more shortcodes under "Visual Mapper", [e2pdf-wc-order key="cart"] shortcode (which works the same way as [e2pdf-wc-cart key="cart"], "Auto PDF" feature for "Orders" where you can see how it's organized iteration over products and it's meta data.

Please, let us know if you will face any issues after upgrade or any features that you need and can't find. We are currently working on updating documentation and hope it will be available soon.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
13 June, 2021 01:21:33
gerhalligan
Topics: 2
Messages: 9
Hi Oleksandr,

I have test this and the Cart shortcode you suggested is almost perfect for my use case.
Is it possible to select what columns to show though? You can see from my attachment that the only columns I really need are Product and Price.
With the currently layout my product's description exceeds the page length.

Thanks,
Ger
13 June, 2021 02:50:20
E2Pdf
Support
Topics: 7
Messages: 3156
Hi,

You must be able to use following shortcode:

[e2pdf-wc-order key="cart" show_image="false" show_sku="false" show_quantity="false" show_subtotal="false" show_totals="false"]

It will show only "products" table with "product" and "price". "totals" also will be removed, as it's currently not visible on your screenshot.

To increase "Product" width column, you can use style under "CSS" section:

.e2pdf-wc-cart-products-header-name {
width: 80%;
}

We remain at your service.
We would really appreciate your feedback at WordPress.org!
13 June, 2021 04:36:31
gerhalligan
Topics: 2
Messages: 9
Cool, I was able to mess around with that to get the result I wanted.

Thank you for all your help Oleksandr, much appreciate :)