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 - Dont cancel payments | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.2.0 | |
| */ | |
| add_filter( 'redlight_swish_ecommerce_cancel_payment', '__return_false' ); |
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 - Add Ordermeta to field in Fortnox | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_fortnox_doorcode( $orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| $doorcode = $order->get_meta('_doorcode', true); | |
| if($doorcode){ | |
| $orderData['Order']['Remarks'] .= "\r\n"."Portkod: ".$doorcode; |
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 ADDON to Shipment | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.0.1 | |
| */ | |
| function redlight_unifaun_bring_notification( $shipment, $order ) { | |
| // Only BCSEDSTD and 'PAKET MED HEMLEVERANS' | |
| if( 'BCSEDSTD' === $shipment['service']['id'] && 'PAKET MED HEMLEVERANS' === $order->get_shipping_method()){ | |
| $shipment['service']['addons'][] = array( |
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 Add Shipping charges as OrderItem instead of Shipping fee in Fortnox | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.1.0 | |
| */ | |
| function redlight_fortnox_shipping_as_order_item($orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| // Remove fee from orderData | |
| if(isset($orderData['Order']['Freight'])){ |
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 - Book Pickup | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_unifaun_pickup_booking( $shipment, $order ) { | |
| $shipment['service']['pickupBooking'] = true; | |
| 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 -Fortnox - Mark order as not-completed | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_fortnox_order_notcompleted( $orderData, $order_id) { | |
| //$order = new WC_Order($order_id); | |
| $orderData['Order']['NotCompleted'] = 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 - Adds ADDON to Shipment | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_unifaun_dhl_green( $shipment, $order ) { | |
| // Only APC service ID (DHL Parcel Connect) | |
| if( 'APC' === $shipment['service']['id'] ){ | |
| $shipment['service']['addons'][] = array( |
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 declarantDate to todays Date | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_customs_date( $customsDeclaration, $shipment, $order_id) { | |
| $customsDeclaration['declarantDate'] = date('Y-m-d'); | |
| return $customsDeclaration; |
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 GrossWeight equal to NetWeight | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_customs_line_grossweight( $line, $shipment, $order, $product, $item ) { | |
| $line['grossWeight'] = $line['netWeight']; | |
| return $line; |
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 - Set favorite | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_favorite( $shipment, $order ) { | |
| $shipment['favorite'] = 'min favorit'; | |
| return $shipment; |