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 # infront of ordernumber, add this to "YourOrderNumber" in Fortnox | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 8.0.2 | |
| */ | |
| function redlight_fortnox_order_ordernumber_prefix( $orderData, $order_id) { | |
| $order = wc_get_order($order_id); | |
| $orderData['Order']['YourOrderNumber'] = $order->get_meta('_custom_order_number', true); | |
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 PhoneNumber to Phone2 field in Fortnox | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.8.0 | |
| */ | |
| function redlight_fortnox_order_both_phone_fields( $orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| $orderData['Order']['Phone2'] = $order->get_billing_phone(); | |
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 - Sets date difference from Orderdate to display return label button | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.8.0 | |
| */ | |
| function redlight_unifaun_return_label_date_diff( $diff ) { | |
| return 60; | |
| } |
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 - Sets customer note as reference in Unifaun | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.7.0 | |
| */ | |
| function redlight_unifaun_customer_note_as_reference( $shipment, $order ) { | |
| if(!empty( $order->get_customer_note() ) ){ | |
| $shipment['senderReference'] = $order->get_customer_note(); | |
| } |
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 | |
| add_action('woocommerce_order_status_changed', array($this, 'redlight_custom_update_woocommerce_order_status'), 10, 3); | |
| /** | |
| * @snippet WooCommerce - Fortnox plugin by Redlight Media - Sync order on "on-hold" | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.7.0 | |
| */ | |
| public function redlight_custom_update_woocommerce_order_status($order_id, $old_status, $new_status) { | |
| if ('on-hold' == $new_status): | |
| // cCheck if this order should be created as offer |
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 - Sets custom reference in Unifaun | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.7.0 | |
| */ | |
| function redlight_unifaun_reference( $shipment, $order ) { | |
| $shipment['senderReference'] = 'TOP-' . $order->get_order_number(); | |
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 - Custom Logic for YITH Request a Quote | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.6.2 | |
| */ | |
| function redlight_fortnox_ywraq( $is_offer, $order_id ) { | |
| $order = new WC_Order($order_id); | |
| if( 'yes' === $order->get_meta('ywraq_raq',true) ){ | |
| $is_offer = true; |
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 - Sets size of shippinglabel to 107x190 (thermo-190) | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.3 | |
| */ | |
| function redlight_unifaun_pacsoft_pdf_label( $pdf_config, $order ) { | |
| $pdf_config['target1Media'] = 'thermo-190'; | |
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 - Swish Ecommerce by Redlight Media - Justera meddelande i betalningsförfrågan till att endast innehåll ordernummer | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.6.2 | |
| */ | |
| function redlight_swish_ecommerce_paymentrequest_message_ordernumber ( $message, $order ) { | |
| $message = $order->get_order_number(); | |
| return $message; | |
| } |
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 - Adds Default weight to parcel | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.3 | |
| */ | |
| function redlight_unifaun_minimum_weight( $shipment, $order) { | |
| foreach( $shipment['parcels'] as $i => $parcel ) { | |
| if( $shipment['parcels'][$i]['weight'] < 0.150 ){ | |
| $shipment['parcels'][$i]['weight'] = 0.150; |