Skip to content

Instantly share code, notes, and snippets.

@psaikali
Created September 20, 2017 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psaikali/20cc069ed4f1f46e2b53120e51566198 to your computer and use it in GitHub Desktop.
Save psaikali/20cc069ed4f1f46e2b53120e51566198 to your computer and use it in GitHub Desktop.
Rediriger la page Panier vers la page Commande dans WooCommerce
<?php
/***
* Rediriger la page Panier directement vers la page Commande dans WooCommerce
*/
function msk_wc_redirect_cart_to_checkout() {
if (is_cart() && !WC()->cart->is_empty()) {
wp_redirect(wc_get_checkout_url());
exit;
}
}
add_action('template_redirect', 'msk_wc_redirect_cart_to_checkout');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment