woocommerce_store_api_cart_select_shipping_rate

ACTION woocommerce\src\StoreApi\Routes\V1\CartSelectShippingRate.php (ligne 108) github
Fires an action after a shipping method has been chosen for package(s) via the Store API. This allows extensions to perform addition actions after a shipping method has been chosen, but before the cart totals are recalculated.

Paramètres

Entrée :
$package_id, $rate_id, $request
Sortie :
@param string|null $package_id The sanitized ID of the package being updated. Null if all packages are being updated.
@param string $rate_id The sanitized chosen rate ID for the package.
@param \WP_REST_Request $request Full details about the request.

Utilisation

// Ajouter une fonction au hook action 'woocommerce_store_api_cart_select_shipping_rate'
add_action('woocommerce_store_api_cart_select_shipping_rate', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($package_id, $rate_id, $request) {
    // Votre code ici
    error_log('Hook woocommerce_store_api_cart_select_shipping_rate déclenché');
}

Actualités

Chargement des actualités...