Send Admin email for different product(s)

WooCommerce
11 February, 2022 10:57:16
steadicam
Topics: 1
Messages: 11
Hello, I have a PDF-X already setup connected to Orders (all) and it works fine.

1st question:

I have a few products (Product A, Product B, Product C) that I have a special PDF-Y setup for that I want to have sent when ordered, this PDF only needs to be sent when these products are ordered (even in same order). I have tried using the [e2pdf-attachment id="4" dataset="product id#"] but can't get it to work?

2nd question:

How do we get the PDF to auto add a page if say the cart has many products (using Auto-PDF connected to woocommerce order) in it and won't fit on the single page?

Thank you for your time!

11 February, 2022 11:40:04
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

1. Does your E2Pdf Template with ID: 4 connected to "WooCommerce" -> "Products" or "WooCommerce" -> "Orders"?

If to "WooCOmmerce" -> "Orders" it must be used as:

[e2pdf-attachment id="4" product_ids="product id"]

* multiple products can be set via comma: [e2pdf-attachment id="4" product_ids="1,2,3,4"]

If it still will not work - let us know please version of E2Pdf, attach please some screenshots with setup: E2Pdf Template connection, how and where [e2pdf-attachment] shortcode added.

2. To continue content on next page you need to:
- Get the ID of "HTML" object which must be extended.
- Create another page with new "HTML" object
- Set "Parent" to the ID of main "HTML" object + "Hide Page (if empty)" option. If you will need to create more pages - it must be used same setup: "Parent" to the ID of main "HTML" object + "Hide Page (if empty)" option.

Screenshots attached.
We would really appreciate your feedback at WordPress.org!
11 February, 2022 12:32:58
steadicam
Topics: 1
Messages: 11
Hello E2PDF,
Thank you for that help! It worked, now for that special PDF it is filling a template with certain variations, is there a way if say the customer orders 2 or 3 of these items with differemt variations of the same product to have that special PDF get filled as many times?
11 February, 2022 12:46:35
E2Pdf
Support
Topics: 7
Messages: 3177
Can you please clarify:

Do you have connection to "WooCommerce" -> "Orders"?

Do you need single PDF which will contain multiple variations ordered data or do you need multiple PDFs for each variation ordered?

P.S. It will be useful if you will also attach screenshot of current E2Pdf Template so we can see which shortcodes / structure is currently used inside. You can mark message "Private" so only support can see your message.


We would really appreciate your feedback at WordPress.org!
11 February, 2022 23:55:20
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

To generate multiple PDFs you need to set connection to "WooCommerce" -> "Variations" (if you need to generate multiple PDFs for multiple ordered variable products). Screenshot attached.

[e2pdf-wc-order] shortcodes inside template will remain the same. The difference will be in using [e2pdf-wc-product] inside E2Pdf Template as it will not be required to use "index" attribute. And shortcode inside mail action will remain the same: [e2pdf-attachment id="4" product_ids="main_product_id"]

We have demo with same behaviour: https://demo.e2pdf.com/product/variable-product/. If it will be ordered 2 different variations you will get 2 different PDFs for that product.

P.S. It's also recommended to use latest RC version for WooCommerce integration as it has some improvements: https://e2pdf.com/support/desk/how-to-update-plugin-to-rc-release-candidate-version-from-e2pdf-com

Let us know please if the solution will work you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
12 February, 2022 13:55:29
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

If you order 2 variable products it must generate and attach 2 PDF attachments. Do you use latest RC version? If you are using [e2pdf-attachment] inside "Additional Content" of mail message it will just generate PDF attachments. It's independent from other shortcodes and instances. PDFs doesn't saved by default on server and generated in real-time, when shortcode fired.

"Does it add to the original PDF, do I need to put more pages in the PDF?"

Sorry, can you please clarify? What do you mean by add to the original PDF? If E2Pdf Template connected to "WooCommerce" -> "Variations" - it can contains WooCommerce Order Data + Separate data for ordered single variable product. If E2Pdf Template connected to "WooCommerce" -> "Orders" then it can contains multiple products ordered data.

As about screenshot of your E2Pdf Template connected to "WooCommerce" -> "Orders", it looks like custom fields plugins which you are using outputs it exactly as you see, so it's need to see which is the original output to understand if it's possible to remove new lines.

If possible, can you please create separate "textarea", put there the same code which you have inside "HTML" object and export data via "E2Pdf" -> "Export" with "Flatten" option set to "No". Screenshots attached. After this attach please generated PDF to next message.

As alternative you can submit support ticket with access details to WP Admin Dashboard here: https://e2pdf.com/support/request so we can login and make needed checks and let you know for possible solutions.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
12 February, 2022 16:20:26
steadicam
Topics: 1
Messages: 11
Hi

Well I was putting [e2pdf-attachment id="4"] not just [e2pdf-attachment]! So it works it gives me 2 PDF's but here is another problem, the color choices I am using are not really variations they are just choices, I will have to figure that out.

See attachment for the other "textarea" issue
13 February, 2022 00:02:58
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

New lines generated by "p" tags, so we suspect that you have inside "HTML" section shortcode part as:

<div class="formatted-meta-data">[e2pdf-wc-product key="get_formatted_meta_data" index="[e2pdf-foreach-index]" path="[e2pdf-foreach-key-1].display_key"]: [e2pdf-wc-product key="get_formatted_meta_data" index="[e2pdf-foreach-index]" path="[e2pdf-foreach-key-1].display_value"]</div>

Try Replace it with:

<div class="formatted-meta-data">[e2pdf-wc-product key="get_formatted_meta_data" index="[e2pdf-foreach-index]" path="[e2pdf-foreach-key-1].display_key"]: [e2pdf-format-output filter="replace,strip_tags" search="<\/li><li>" replace=", "][e2pdf-wc-product key="get_formatted_meta_data" index="[e2pdf-foreach-index]" path="[e2pdf-foreach-key-1].display_value"][/e2pdf-format-output]</div>

It must make output without additional lines as:

Connector: Mini XLR comes w/4 pin female XLR adapter
Send PDF: sendpdf
Would you like to personalize your headset?: Yes (+$5.00)

----------------------

The color choices I am using are not really variations they are just choices, I will have to figure that out.

- Which shortcodes do you use inside PDF to output that information?
We would really appreciate your feedback at WordPress.org!
13 February, 2022 06:48:38
steadicam
Topics: 1
Messages: 11
Hi,

Okay great the the HTML code works a treat see 1st screenshot https://prnt.sc/26v2viq

Now for the color choices, it is generating the 2 pdfs (template connected to variations) but with just 1 of the color choices see screen shots:

https://prnt.sc/26v2vwr

https://prnt.sc/26v2w67

Here is the shortcode used for each side:

left ear: [e2pdf-wc-order key="line_item" subkey="Left Ear Bud Color" index="0" order_item_meta="true"]

https://prnt.sc/26v2qab

right ear: [e2pdf-wc-order key="line_item" subkey="Right Ear Bud Color" index="0" order_item_meta="true"]

https://prnt.sc/26v2qro

This is what the cart looks like:

https://prnt.sc/26v2wqa

Again thank you for your OUTSTANDING support!
13 February, 2022 06:54:22
steadicam
Topics: 1
Messages: 11
sorry here are images:
13 February, 2022 08:44:18
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

It's need to replace shortcodes as:

From: [e2pdf-wc-order key="line_item" subkey="Left Ear Bud Color" index="0" order_item_meta="true"]
To: [e2pdf-wc-product key="Left Ear Bud Color" order_item_meta="true"]

From: [e2pdf-wc-order key="line_item" subkey="Right Ear Bud Color" index="0" order_item_meta="true"]
To: [e2pdf-wc-product key="Right Ear Bud Color" order_item_meta="true"]

P.S. The shortcode which you are using will output always order item meta data from 1st ordered product and it's valid if you need to output that data inside E2Pdf Template connected to "WooCommerce" -> "Orders" only.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
13 February, 2022 09:44:11
steadicam
Topics: 1
Messages: 11
Well you guys ROCK! it all works as I have imagined!!! Thank you very much, your support is great and very efficient and fast!

On another related note is there any way to have a button of some sort attached to the order itself in admin panel to generate these pdfs on demand, after order is placed and the pdfs were not generated or sent via email? Or have them generated and put in a folder? I know you have said in this post that they are not generated or saved I'm just asking if it's possible.

Again, cant thank you enough!!
14 February, 2022 01:00:50
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

Unfortunately this feature is still under development, however you can try to use PHP snippet to output PDF download link:

https://codeshare.io/loQEdB

Code must be added in your theme functions.php or as PHP Snippet.

It's need to replace:
1344 - to your Product ID (Parent ID)
231 - to E2Pdf Template ID

We remain at your service.
We would really appreciate your feedback at WordPress.org!
16 February, 2022 09:22:35
steadicam
Topics: 1
Messages: 11
Hello

Thank you for that code snippet, how would I modify that to include all products?
17 February, 2022 00:31:15
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

Updated code snippet: https://codeshare.io/6pDEeO

It must show PDF download link for all variations.

If you will need to use it also with "simple" products:
remove // before echo 'PDF: ' . do_shortcode.... and replace "232" to E2Pdf Template ID connected to "WooCommerce" -> "Products".

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 February, 2022 05:35:45
steadicam
Topics: 1
Messages: 11
Hi

Thank you for that code, so it works sort of (see attachments, only creates for variable product not simple) ....I just need to have the link for a PDF of the whole order (see attachment)

Thank you again for your excellent support, help and information!
17 February, 2022 06:21:37
E2Pdf
Support
Topics: 7
Messages: 3177
Hi,

Just to clarify:
Template connected to "WooCommerce" -> "Orders" - can output ORDER + Multiple Products Information
Template connected to "WooCommerce" -> "Variations" - can output SINGLE VARIATION PRODUCT Information
Template connected to "WooCommerce" -> "Products" - can output SINGLE SIMPLE PRODUCT Information

If you need to add PDF download link which is connected to "WooCommerce" -> "Orders":

For Variation PDFs you need to use code: https://codeshare.io/6pDEeO
* 231 must be replaced to the ID of E2Pdf Template which connected to "WooCommerce" -> "Variations"

For Orders PDF you need to use code: https://codeshare.io/wn0vm9
* 230 must be replaced to the ID of E2Pdf Template which connected to "WooCommerce" -> "Orders". It will be showed as on attached screenshot.

----------------------------------------------------

If you need SINGLE simple product information PDF as with Variation:

- Duplicate current E2Pdf Template connected to "WooCommerce" -> "Variations", and change connection to "WooCommerce" -> "Prodcuts" via "Options".

- Use code: https://codeshare.io/oQv3Ar

At the end you will have 2 similar templates but:
- 1st will be connected to "WooCommerce" -> "Variations"
- 2nd will be connected to "WooCommerce" -> "Products"

* 231 must be replaced with the ID of E2Pdf Template connected to "WooCommerce" -> "Variations"
* 232 must be replaced with the ID of E2Pdf Template connected to "WooCommerce" -> "Products"

-------------------------------------------------

We remain at your service.


We would really appreciate your feedback at WordPress.org!
17 February, 2022 08:08:59
steadicam
Topics: 1
Messages: 11
YES!!! Thank you again!