xpay✦ Commerce
Directory
WooCommerce plugins
Cart PDF for WooCommerce
Cart PDF for WooCommerce
Adds ability for users and guests to download their WooCommerce cart as PDF
5.0
(25 ratings)Will this break my store?
What the WordPress.org registry says about keeping Cart PDF for WooCommerce running.
Tested to 6.8.6 — 2 branches behind 7.0
A branch or two behind — normal for a plugin between releases.12 months ago
At least 5.9 releases a year since launch. WordPress.org only lists versions still available for download, so the real number may be higher.8.0.0
Your host must be running at least this version.6.2
5
Maintenance & trust
Scored on how Cart PDF for WooCommerce is looked after — not on how many stores run it.
72
out of 100Maintenance
26 / 35WordPress compatibility
14 / 20Support responsiveness
Not enough dataMerchant satisfaction
14 / 15Listing transparency
4 / 10Ratings
5.0
25 ratingsAdds 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.
Features
- Full PDF template customization
- Send copy of each generated cart PDF to admin
- Capture customer / guest information from checkout and display on generated PDF
Add the following code snippet to your themes functions.php:
function child_theme_wc_cart_pdf_destination( $dest ) {
if ( class_exists( '\WCCartPDF\Mpdf\Output\Destination' ) ) {
$dest = \WCCartPDF\Mpdf\Output\Destination::INLINE;
}
return $dest;
}
add_filter( 'wc_cart_pdf_destination', 'child_theme_wc_cart_pdf_destination' );
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() ) {
return;
}
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' ); ?>
</a>
<?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>
<?php
endif;
}
add_action( 'woocommerce_proceed_to_checkout', 'child_theme_wc_cart_pdf_button', 21 );
Try adding the following to your wp-config.php file:
define( 'WC_CART_PDF_THUMBNAIL_COMPATIBILITY', true );
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.
