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 - Fortnox plugin by Redlight Media - Set TermsOfPayment depending on payment method via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.2.5 | |
| */ | |
| function redlight_fortnox_payment_method_TermsOfPayment($orderData, $order_id) { | |
| $order = wc_get_order($order_id); | |
| $order_payment_method = $order->get_payment_method(); | |
| switch( $order_payment_method ) { |
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 - Remove and Post_meta rows in Fortnox via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.2.5 | |
| */ | |
| function redlight_fortnox_remove_postmeta($orderData) { | |
| foreach($orderData['Order']['OrderRows'] as $i => $item) { | |
| if(isset($item['AccountNumber']) && $item['AccountNumber'] == 'API_BLANK') |
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 Shipping charges as OrderItem instead of Shipping fee in Fortnox via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.2.5 | |
| */ | |
| function redlight_fortnox_shipping_as_orderLine($orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| // Remove fee from orderData |
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 Klarna Invoice and ordernumber to Fortnox ExternalInvoiceReference1 & ExternalInvoiceReference2 fields | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.2.5 | |
| */ | |
| function redlight_fortnox_klarna_invoice_order_reference( $orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| if($order->get_payment_method() == 'klarna_checkout'){ |
NewerOlder