开发者 |
dkjensen
seattlewebco davidperez cloudcatch exstheme |
---|---|
更新时间 | 2024年12月18日 04:52 |
PHP版本: | 8.0.0 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
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 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.
select.getCustomerData()
undefined under certain scenarios
3.1
\Mpdf
is now \WCCartPDF\Mpdf
2.10.0
woocommerce_email_styles
filter. (Filter removed)
2.9.3
wc_cart_pdf_filename
filter not being applied to admin copy
2.9.2
define( 'WC_CART_PDF_DEBUG', true );
to wp-config.php
2.3.1
define( 'WC_CART_PDF_THUMBNAIL_COMPATIBILITY', true );
to wp-config.php in an attempt to fix product thumbnails not loading
2.1.6
wc_cart_pdf_before_template
and wc_cart_pdf_after_template
1.0.3
wc_cart_pdf_stream_options
filter for stream options
1.0.1