Linux 软件免费装

WooCommerce Cart PDF

开发者 dkjensen
seattlewebco
davidperez
cloudcatch
exstheme
更新时间 2024年12月18日 04:52
PHP版本: 8.0.0 及以上
WordPress版本: 6.7
版权: GPLv3 or later
版权网址: 版权信息

标签

下载

2.2.0 2.1.1 2.10.0 2.9.0 2.1.6 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 1.0.5 2.5.0 2.6.0 2.4.0 2.7.0 2.0.1 2.1.7 1.0.2 2.0.2 2.1.3 2.1.5 2.8.0 3.0.0 3.0.2 3.1.0 1.0.3 1.0.4 2.3.0 3.0.1 2.1.2 2.1.4 2.3.1 2.0.0 2.2.1 2.2.2 2.2.3 2.9.1 2.9.2 2.9.3 2.9.4

详情介绍:

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. Features

安装:

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

屏幕截图:

  • Customizer settings

升级注意事项:

2.0.0
  • PDF generation library changed from Dompdf to mPDF
  • Requires PHP >= 5.6.0

常见问题:

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( '\WCCartPDF\Mpdf\Output\Destination' ) ) { $dest = \WCCartPDF\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() ) { 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 );

Product images are not showing on PDF

Try adding the following to your wp-config.php file: define( 'WC_CART_PDF_THUMBNAIL_COMPATIBILITY', true );

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.

更新日志:

3.1.1