David Jensen
Forum Replies Created
-
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] make visible to certain (logged in) user rolesCan you try this conditional statement instead (checking role instead of capabilities)
if ( is_user_logged_in() && in_array( 'trade-resale', (array) wp_get_current_user()->roles, true ) )I think the shortcode is a great idea, will consider that for a future release!
Great, that bugged me as well, thanks for reminding me to revisit 🙂
Forum: Plugins
In reply to: [Splide Carousel Block] Woocommerce support?You can drop individual WooCommerce product blocks inside each slide yes, but this Carousel block does not behave like a query loop if you are looking for a query carousel.
Ahh I figured it out! I just released an update (1.9.0), which should make it so when clicking the pencil icon from the plugin sidebar, it automatically opens up the modal block settings for edit.
Let me know if this resolves the issue for you!
When you click the modal icon, to reveal all modals on page, and then click a modal to edit, can you then switch back to the document / block settings by clicking the icon next to Publish / Update to then reveal the settings? Ideally how I would like it to behave, is upon clicking edit modal from that sidebar, it automatically opens the settings, but I couldn’t figure a way to do that in the past. I can take a look again, but you said you modified the code directly, I would be interested to see your approach and perhaps we get that merged into the plugin. Here is the Github repo:
https://github.com/CloudCatch/light-modal-block
I like your suggestion, but I’ll have to find a hook or similar to trigger opening the settings panel, as i mentioned above I did not know how to do that but if you do I would appreciate you sharing, I’ll also look into it again as it’s been a while.
thanks for the feedback!
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Images on pdf are distorted@jd9737 Great. We allow customization of the PDF for such cases, glad you could get that resolved.
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Images on pdf are distorted@jd9737 Could you define the following in wp-config.php on a staging environment to output the PDF as HTML, and troubleshoot potential CSS affecting the PDF?
define( 'WC_CART_PDF_DEBUG', true );After defining that, generate a PDF and inspect the HTML for any CSS that might be distorting the image.
@enriqueeds Could you try following the troubleshooting images not loading guide and see if these possible solutions fix the issue for you?
https://github.com/dkjensen/wc-cart-pdf/wiki/Troubleshooting-images-not-loading
Hi @enriqueeds
It looks like you might be using the new WooCommerce Cart Blocks. If that is the case, you will want to edit your cart page, and should see the Cart Block. This should be a normal page but it could also be within the Full Site Editor under Appearance > Editor.
On that screen, edit the cart block, and underneath the proceed to checkout button, add a new block, and search for the “Cart PDF Button” block. Add that block and drag it where you would like it to live.
You may also see that [wc_cart_pdf_button] shortcode which you can remove from the block editor.
Let me know if this helps or not
Forum: Plugins
In reply to: [Splide Carousel Block] Error when try to set responsive breakpoints@emmek Thanks for calling this out, I am able to reproduce. I will try and release a fix for this tomorrow!
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Where can i change e-mail subject and text@jongerius Does the snippet plugin let you specify whether the PHP runs on frontend/backend/everywhere? If so try everywhere. You could also try increasing the priority the hook runs by changing the 10 value in the code snippets, e.g.:
add_filter( 'wc_cart_pdf_modal_email_subject', function( $subject, $customer ) {
return 'Here is your custom cart PDF!';
}, 500, 2 );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
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?
- PDF generation happens in the