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 - Hämta lagersaldo från en specifik lagerplats | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.8 | |
| */ | |
| function redlight_fortnox_warehouse_stock_point_amount ( $DisposableQuantity, $WC_Product, $fortnox_article ) { | |
| $articleNumber = $WC_Product->get_meta( '_obj_fortnox_article_number', true ); | |
| //Vår Lagerplats | |
| $stockpoint = 'LAGER'; |
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 ) { | |
| $line['value'] = $item->get_subtotal() - $item->get_subtotal_tax(); | |
| 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 -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 ) { | |
| $line['value'] = $product->get_price(); | |
| 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 - Adds Dimensions to Schenker Parcel | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.3 | |
| */ | |
| function redlight_unifaun_dimensions( $shipment, $order) { | |
| if( 'AIRMEE' === $shipment['service']['id'] ){ | |
| foreach( $shipment['parcels'] as $i => $parcel ) { | |
| $shipment['parcels'][$i]['length'] = 150; |
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 | |
| function redlight_overnight_barcode_scanner_wc_barcode( $template_type, $order ) { | |
| if(function_exists('WC_Order_Barcodes')){ | |
| echo '<style type="text/css">.barcode>img{max-width:100%;max-height:100%;}</style>'; | |
| echo '<div class="barcode" style="width:250px;text-align: center;">'; | |
| echo WC_Order_Barcodes()->display_barcode($order->get_id(),$order->get_order_number(),'',true); | |
| echo '</div>'; | |
| } | |
| } |
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_varubrev_covid19( $shipment, $order ) { | |
| // Only PUA | |
| if( 'PUA' === $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 - Adds ADDON to Shipment | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.0.1 | |
| */ | |
| function redlight_unifaun_varubrev_corona( $shipment, $order ) { | |
| // Only PUA and 'Varubrev - Lämnas vid dörr' | |
| if( 'PUA' === $shipment['service']['id'] && 'Varubrev - Lämnas vid dörr' === $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 - Adds ADDON to Shipment | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.0.1 | |
| */ | |
| function redlight_unifaun_budbee_pod( $shipment, $order ) { | |
| // Only Budbee Flex | |
| if( 'BUDBEEDLVEVN ' === $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 - Fortnox - Dont sync customers, ever | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.8.0 | |
| */ | |
| add_filter( 'obj_fortnox_sync_guest_user', '__return_false' ); | |
| add_filter( 'obj_fortnox_sync_user', '__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 custom field to Fortnox via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.2 | |
| */ | |
| function redlight_fortnox_pnr_guest_customer( $customer, $order_id ) { | |
| $organisationsnummer = get_post_meta($order_id, 'organisationsnummer', true); | |
| if(!empty($organisationsnummer)){ |