Created
June 30, 2022 09:52
-
-
Save hedqvist/d9cfb8ffa277146fe3ba7931ece06ccc to your computer and use it in GitHub Desktop.
PostNord - Change default Weight
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 Default Weight per article to 250g (weight is returned in kilograms) | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 6.0.0 | |
*/ | |
function redlight_postnord_default_weight( $default_weight ) { | |
$default_weight = 0.250; | |
return $default_weight; | |
} | |
add_filter('redlight_wcpns_shipment_product_default_weight', 'redlight_postnord_default_weight' ); | |
add_filter('redlight_wcpns_shipment_product_customs_invoice_default_weight', 'redlight_postnord_default_weight' ); | |
add_filter('redlight_wcpns_shipment_product_cn22_default_weight', 'redlight_postnord_default_weight' ); | |
add_filter('redlight_wcpns_shipment_product_cn23_default_weight', 'redlight_postnord_default_weight' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment