This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce -Fortnox - Set customers email to Order billing emailing | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_fortnox_order_email_to( $orderData, $order_id) { | |
| $order = wc_get_order($order_id); | |
| $orderData['Order']['EmailInformation']['EmailAddressTo'] = $order->get_billing_email(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| /** | |
| * @snippet WooCommerce - Adds ADDON to Shipment | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_aspo_insurance( $shipment, $order ) { | |
| // Only DHL Service Point | |
| if($order->get_total() < 2000 ){ | |
| return $shipment; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Removes customsDeclaration for EU-countries | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.7.0 | |
| */ | |
| function redlight_unifaun_remove_customs_in_eu( $shipment, $order ) { | |
| $EU_countries = apply_filters( 'woocommerce_eu_vat_number_country_codes', array( | |
| 'AT', | |
| 'BE', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce -Unifaun - Set Customs Line Value | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_customs_line_value( $line, $shipment, $order, $product, $item ) { | |
| //$order = new WC_Order($order_id); | |
| $line['value'] = '400'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce -Unifaun - Set Customs importExportType | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_customs_type( $customsDeclaration, $shipment, $order_id) { | |
| //$order = new WC_Order($order_id); | |
| $customsDeclaration['importExportType'] = 'gift'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Unifaun plugin by Redlight Media - Add Support for WooCommerce Shipment Tracking | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| add_action( 'ac_wc_unifaun_shipment_print_successful_print', 'redlight_postnord_add_tracking', 10, 3 ); | |
| function redlight_postnord_add_tracking($body, $response, $order){ | |
| $provider = 'PostNord Sverige AB'; | |
| if ( isset( $body->pdfs ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Unifaun plugin by Redlight Media - Add default shipping method to orders missing shipping | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.2.0 | |
| */ | |
| add_filter( 'ac_wc_unifaun_order_list_shipping_method_id', 'redlight_unifaun_order_list_method_id', 10, 2); | |
| add_filter( 'ac_wc_unifaun_post_shipment_shipping_method_id', 'redlight_unifaun_order_list_method_id', 10, 2); | |
| add_filter( 'ac_wc_unifaun_post_return_shipment_shipping_method_id', 'redlight_unifaun_order_list_method_id', 10, 2); | |
| function redlight_unifaun_order_list_method_id( $method_id , $order ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Unifaun plugin by Redlight Media - Add Track & Trace url to completed email | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.8.1 | |
| */ | |
| function redlight_add_tracking_url_to_completed_email( $order, $sent_to_admin, $plain_text, $email ) { | |
| if ( $email->id == 'customer_completed_order' ) { | |
| if (function_exists('wcuns')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Fortnox plugin by Redlight Media - (REGISTRED USERS) Set customer Type to Private | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.8.0 | |
| */ | |
| function redlight_custom_customer_type( $customer) { | |
| $customer['Customer']['Type'] = 'PRIVATE'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @snippet WooCommerce - Fortnox plugin by Redlight Media - (GUEST USERS) Set customer Type to Private | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.4.2 | |
| */ | |
| function redlight_fortnox_guest_customer_type( $customer, $order_id ) { | |
| $customer['Customer']['Type'] = 'PRIVATE'; | |
| return $customer; |