Created
August 25, 2022 12:43
-
-
Save hedqvist/d609520dc5c2b2ae438c867af4f7e452 to your computer and use it in GitHub Desktop.
Fortnox - Stock Amount from QuantityInStock instead of DisposableQuantity
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 'i lager' istället för Disponibelt antal | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 6.8.0 | |
*/ | |
function redlight_fortnox_stock_quantity_in_stock ( $DisposableQuantity, $WC_Product, $fortnox_article ) { | |
return $fortnox_article->Article->QuantityInStock; | |
} | |
add_filter('obj_fortnox_product_stock_amount', 'redlight_fortnox_stock_quantity_in_stock', 10,3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment