Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Last active August 27, 2020 08:09
Show Gist options
  • Select an option

  • Save hedqvist/0a84205457bdc19b4a925a33ff9f135a to your computer and use it in GitHub Desktop.

Select an option

Save hedqvist/0a84205457bdc19b4a925a33ff9f135a to your computer and use it in GitHub Desktop.
Unifaun - Small Labels for PUE
<?php
/**
* @snippet WooCommerce - Sets size of shippinglabel to 107x72 (thermo-brev3)
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 4.4.0
*/
function redlight_unifaun_pacsoft_pdf_label( $pdf_config, $order ) {
if( 'Brev i posten' === $order->get_shipping_method() || 'Fri frakt' === $order->get_shipping_method() || 'Free delivery' === $order->get_shipping_method() || 'Postage' === $order->get_shipping_method() ){
$pdf_config['target1Media'] = 'thermo-brev3';
}
return $pdf_config;
}
add_filter('ac_wc_unifaun_shipment_pdf_config_data', 'redlight_unifaun_pacsoft_pdf_label', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment