WooCommerce Cart PDF


Adds ability for users and guests to download their WooCommerce cart as PDF. Useful for many cases such as if a user needs a quote before completing purchase.


  • Full PDF template customization
  • Send copy of each generated cart PDF to admin
  • Capture customer / guest information from checkout and display on generated PDF


  • Preview of an example PDF generated from the WooCommerce Cart
  • Customizer settings


  1. Upload plugin and then activate
  2. Ensure WooCommerce is installed and activated as well


How to view or open PDF instead of download?

Add the following code snippet to your themes functions.php:

function child_theme_wc_cart_pdf_destination( $dest ) {
    if ( class_exists( '\Mpdf\Output\Destination' ) ) {
        $dest = \Mpdf\Output\Destination::INLINE;

    return $dest;
add_filter( 'wc_cart_pdf_destination', 'child_theme_wc_cart_pdf_destination' );

How to require user to be logged in to download cart as PDF?

Add the following code snippet to your themes functions.php:

* Remove the default download cart button
remove_action( 'woocommerce_proceed_to_checkout', 'wc_cart_pdf_button', 21 );

* Replace the default download cart button with our own logic to display a login notice for guests
function child_theme_wc_cart_pdf_button() {
    if( ! is_cart() || WC()->cart->is_empty() ) {

    if ( is_user_logged_in() ) :

    <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'cart-pdf' => '1' ), wc_get_cart_url() ), 'cart-pdf' ) );?>" class="cart-pdf-button button" target="_blank">
        <?php esc_html_e( 'Download Cart as PDF', 'wc-cart-pdf' ); ?>

    <?php else : ?>

    <p><a href="<?php echo get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ); ?>" class="cart-pdf-login"><?php esc_html_e( 'Please login to download your cart as a PDF', 'wc-cart-pdf' ); ?></a></p>

add_action( 'woocommerce_proceed_to_checkout', 'child_theme_wc_cart_pdf_button', 21 );

Product images are not showing on PDF

Try adding the following to your wp-config.php file:


How can I customize the PDF template?

Copy the PDF template from the plugin folder wc-cart-pdf/templates/cart-table.php into your child theme folder child-theme/woocommerce/wc-cart-pdf/cart-table.php.

From there you can modify the PDF template in your child theme.


31 de marzo de 2022
Very handy plugin and easy to use, simple interface and works with no errors. Thank you!
11 de septiembre de 2021
This plugin does what it says without any hassle and I got the quick and best support from the plugin author, so thanks for that.
29 de julio de 2021
Works out-of-the-box, but is easy to configure and customize trough various hooks and filters one can change it's behavior, add data into the pdf file (such as customer ID and Name, special instructions to customer, email settings and more). There are many suggestions in the FAQ's and in the support forum to achieve this kind of things. Outstanding work!
Leer todas las 17 reseñas

Colaboradores y desarrolladores

«WooCommerce Cart PDF» es un software de código abierto. Las siguientes personas han colaborado con este plugin.


«WooCommerce Cart PDF» ha sido traducido a 5 idiomas locales. Gracias a los traductores por sus contribuciones.

Traduce «WooCommerce Cart PDF» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

* Improve multilingual capabilities
* Add customizer control to open PDF in new tab

* Update compatibility

* Update compatibility

* Fix capture customer not working properly for logged in users

* Add customizer option to display unique generated PDF number on PDF

* Disable lazy loading product thumbnails by default
* Add define( 'WC_CART_PDF_THUMBNAIL_COMPATIBILITY', true ); to wp-config.php in an attempt to fix product thumbnails not loading

* Fix logo rendering on cart table PDF template

* Fix capture customer feature to only capture certain checkout fields

* Customizer option to show Download Cart as PDF button on checkout
* Ability to capture customer and guest information from checkout and display on PDF

* Add language translation file
* Stylesheet changes

* Add compatibility with Gravity PDF plugin

* Send admin email as HTML

* Ability to send an emailed copy of generated PDF to admin
* Add date to PDF
* Add customer details to PDF

* Update compatibility tag
* Two new hooks to modify PDF output

* WordPress 5.4 compatibility
* Add support for coupons displaying on PDF
* Add minimum PHP requirements admin notice and prevent loading if not satisfied
* Minor styling update to PDF

* Added compatibility with Visual Products Configurator
* Perform WC cart calculate_totals() method prior to generating PDF
* Added customizer setting to modify download cart as PDF button label

* Fix composer dependencies

* Update compatibility

* Fix product thumbnails too large

* Change PDF library from Dompdf to mPDF
* Add support for RTL languages

* Fix CSS for language support
* Default font to Noto Sans for language support
* Update Dompdf

* Add PDF template actions hooks wc_cart_pdf_before_template and wc_cart_pdf_after_template

* Add customizer option to change PDF header logo, width and alignment
* Adjustments to default widths and styling of PDF cart table
* Bug fix: Expand {site_title} variable placeholder in PDF footer text

* Tested up to WordPress 5.1
* Add wc_cart_pdf_stream_options filter for stream options

* Add compatibility with TM Extra Product Options
* Add ability to override PDF template and CSS through the theme folder woocommerce/wc-cart-pdf/
* Add filter to change PDF filename
* Add shipping and taxes to PDF
* Add WooCommerce error notice if nonce is invalid
* Add action hook before PDF is generated

* Initial plugin release