Created
September 20, 2017 17:38
-
-
Save psaikali/20cc069ed4f1f46e2b53120e51566198 to your computer and use it in GitHub Desktop.
Rediriger la page Panier vers la page Commande dans WooCommerce
This file contains 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 | |
/*** | |
* 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