Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Select A5 paper size for packing slips

  • Resolved Paul

    (@paul-wolters)


    Dear Ewout,

    First of all, I would like to thank you for creating this amazing plugin! The setup is really easy and the integration with WooCommerce is perfect.

    I have two simple questions/requests regarding the paper size option.

    1) I would like to have the option to choose A5 format as well.

    2) Currently, if you select a paper size in the backend, it affects both documents (invoices and packing slips). I think it would be a great option if you can setup the paper size for each document separately.

    Why? Many webshops sell small products and prefer to use small boxes for shipping. Therefore they usually use A5 packing slips (and A4 invoices).

    Kind regards,

    Paul.

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ewout

    (@pomegranate)

    Hi Paul,
    Thanks for the suggestion. I need to look into this because it could cause template imcompatibilities. If it means I have to make a separate A5 template it’s going to take more time. I’ll let you know when I have more information.

    Plugin Author Ewout

    (@pomegranate)

    Hi Paul,
    If you download the development version of the plugin from the Developers section here, you can enable a5 with the following code in your theme’s functions.php:

    add_filter( 'wpo_wcpdf_paper_format', 'wcpdf_a5_packing_slips', 10, 2 );
    function wcpdf_a5_packing_slips($paper_format, $template_type) {
    	if ($template_type == 'packing-slip') {
    		$paper_format = 'a5';
    	}
    
    	return $paper_format;
    }

    I haven’t included this in the general settings yet, because it’s not compatible with the templates out of the box and it takes some tweaking to get that fixed.

    I have also put in a filter for paper orientation in case anyone needs it:

    add_filter( 'wpo_wcpdf_paper_orientation', 'wcpdf_landscape', 10, 2 );
    function wcpdf_landscape($paper_orientation, $template_type) {
    	// use $template type ( 'invoice' or 'packing-slip') to set paper oriention for only one document type.
    	$paper_orientation = 'landscape';
    	return $paper_orientation;
    }

    These filters will be included in the next plugin update.

    Paul

    (@paul-wolters)

    Hi Ewout,

    Thanks for your support!

    Look great.

    Plugin Author Ewout

    (@pomegranate)

    Great! Let me know if you have any questions or other suggestions. I’d really appreciate it if you leave me a review.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Select A5 paper size for packing slips’ is closed to new replies.