David Jensen
Forum Replies Created
-
Sure thing
Core Function & Access Control:
- PDF generation happens in the
wc_cart_pdf_process_download()function (lines 112-233 in wc-cart-pdf.php) - Triggered by
?cart-pdf=1query parameter - Access barrier: WordPress nonce verification (line 123-126) – nonces are user-specific and expire, making them unsuitable for guest/public access
- The PDF is generated on-the-fly from
WC()->cartand not persisted
Key Classes/Files:
- Main controller:
wc_cart_pdf_process_download()in wc-cart-pdf.php - Helper functions: helpers.php (customer data retrieval)
- Template rendering: cart-table.php (PDF content)
- Customer handling:
wc_cart_pdf_get_customer()function supports both logged-in users and cookie-based guest data
Available Hooks for Your Implementation
Before PDF Generation:
wc_cart_pdf_before_process(line 161) – Runs before any processing begins; ideal for switching context from cart to orderwc_cart_pdf_mpdf_args(line 137-144) – Modify mPDF configuration
During PDF Generation:
3.wc_cart_pdf_content(line 173) – Filter the HTML content before writing to PDF
4.wc_cart_pdf_mpdf(line 208) – Modify the mPDF object directlyAfter PDF Generation:
5.wc_cart_pdf_output(line 231) – Action after PDF is generated (receives$mpdfobject)
6.wc_cart_pdf_filename(line 222) – Filter the output filename
7.wc_cart_pdf_destination(line 223) – Change output destination (download vs inline)Template Hooks:
8.wc_cart_pdf_before_template(in cart-table.php) – Runs before template renderingForum: Plugins
In reply to: [Light Modal Block] Conflict with multiple modals on 1 pageApologies for the delay. It appears you have 4 modals on this page, the one in the sidebar that’s triggered by the “Grab It” button is ID:
olBpReoFx1t.However I think wp rocket lazy loading might be causing that modal form to render empty
Hi @mktgfidest
So what you’re requesting isn’t easily feasible out of the box, but there are a few filters/actions you can use within the plugin to perhaps accomplish what you are trying to do. I would recommend looking at the plugin code and go from there
https://github.com/dkjensen/wc-cart-pdf/
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Where can i change e-mail subject and text@jongerius Which email are you trying to modify, the one the customer gets or the copy admin email?
Hi @richkent
Try adding this code snippet to your functions.php file to only render the button on checkout when the user is logged in:
/**
* Remove the default button on checkout
*/
remove_action( 'woocommerce_review_order_before_payment', 'wc_cart_pdf_show_checkout' );
/**
* Renders the download cart as PDF button in checkout (requires user to be logged in)
*
* @return void
*/
function wc_cart_pdf_show_checkout_logged_in() {
if ( get_option( 'wc_cart_pdf_show_checkout', false ) && is_user_logged_in() ) {
print '<p class="cart-pdf-button-container">';
wc_cart_pdf_button();
print '</p>';
}
}
add_action( 'woocommerce_review_order_before_payment', 'wc_cart_pdf_show_checkout_logged_in' );Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Where can i change e-mail subject and textHi @jongerius
This plugin is translated in a few languages already, if you wanted to contribute and translate it into Dutch you could do so here: https://translate.wordpress.org/projects/wp-plugins/wc-cart-pdf/
Now there are two emails this plugin triggers, one for the admin and one for the customer. You can customize the subject line and body text of both the customer email and the admin notification email using the filters provided by the plugin. Below are examples you can place in your theme’s
functions.phpfile or in a custom plugin.Change Customer Email Subject
add_filter( 'wc_cart_pdf_modal_email_subject', function( $subject, $customer ) {
return 'Here is your custom cart PDF!'; // New subject line
}, 10, 2 );Change Customer Email Body
add_filter( 'wc_cart_pdf_modal_email_body', function( $body, $customer ) {
return '<p>Hi there! Your PDF is attached. Let us know if you need anything else.</p>';
}, 10, 2 );Change Admin Email Subject
add_filter( 'wc_cart_pdf_admin_copy_subject', function( $subject, $customer ) {
return 'Customer Downloaded a Cart PDF - Custom Subject';
}, 10, 2 );Change Admin Email Body
add_filter( 'wc_cart_pdf_admin_copy_body', function( $body, $customer ) {
return '<p>A customer has downloaded their PDF. Here is your customized message.</p>';
}, 10, 2 );Hope this helps thank you
Forum: Plugins
In reply to: [Light Modal Block] Conflict with multiple modals on 1 pageCan you try clearing cache / wp rocket cache? I’m seeing a few javascript errors like this one from cloudflare turnstile plugin
woocommerce.js?ver=1.2:2 Uncaught TypeError: jQuery is not a function
at woocommerce.js?ver=1.2:2:1Forum: Plugins
In reply to: [Light Modal Block] Conflict with multiple modals on 1 pageI think what is going on, is some of your modals share the same exact ID. If you duplicate a modal on a given page, the plugin detects if it has a duplicate ID and updates it, but if you copy a modal from one page, into a global pattern for example, the plugin cannot see that the ID is already used elsewhere and does not set a new ID.
I just released version 1.8.0 which includes the ability to reset the internal modal ID, however in doing so it will require you to reconfigure the triggers.

Could you try updating the plugin and then changing the IDs on the modals that are not appearing on the appropriate triggers?
Forum: Plugins
In reply to: [Light Modal Block] Please stop videos when the modal is closedHi @avagp
I just released version 1.8.0 which includes the ability to autoplay videos when the modal opens, and will automatically pause them when the modal closes.
Let me know if this satisfies your request!
Forum: Plugins
In reply to: [Light Modal Block] Setting up CSS selectorsDid you somehow create an anchor <a> without a link? By default WordPress should force you to put something in there, whether it’s a # or an actual link.
Either way testing on my end if I wrapped text in an empty anchor like
<a>test</a>the modals trigger.Forum: Plugins
In reply to: [Light Modal Block] There are no modals on this pageCan you check the browser console and see if there are any errors? Also what theme are you using and version of WordPress?
You can test in the intended behavior by clicking the “Test Preview” next to the download button on the landing page of the plugin here: https://wordpress.org/plugins/light-modal-block/
Forum: Plugins
In reply to: [Light Modal Block] Setting up CSS selectors@espointpolish I just updated the documentation on this, let me know if it’s a bit more clear now:
https://light-modal-block.cloudcatch.io/
Forum: Plugins
In reply to: [Light Modal Block] Setting up CSS selectors@espointpolish Did you by chance put set the HTML anchor instead of adding a class? It would indicate so as anchors are HTML IDs which require a prefix of
#instead of.(period)I will adjust the docs so they are more clear though as I agree there is definitely room for improvement. Thanks for the feedback!
Forum: Plugins
In reply to: [Light Modal Block] Not appearing on page loadNo problem!
Forum: Plugins
In reply to: [Light Modal Block] Not appearing on page loadWhat do you have set as the delay? If the delay field is empty, try putting something in there, even 0.
- PDF generation happens in the