woocommerce_shipping_packages

FILTER woocommerce\includes\class-wc-shipping.php (ligne 275) github
Allow packages to be reorganized after calculating the shipping. This filter can be used to apply some extra manipulation after the shipping costs are calculated for the packages but before WooCommerce does anything with them. A good example of usage is to merge the shipping methods for multiple packages for marketplaces.

Paramètres

Entrée :
$this->packages
Sortie :
@param array $packages The array of packages after shipping costs are calculated.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_shipping_packages'
add_filter('woocommerce_shipping_packages', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($this->packages) {
    // Modifier la valeur
    return $this->packages;
}

Actualités

Chargement des actualités...