Created
October 24, 2018 18:34
-
-
Save nagygabor/64f8d6c675fa26beb4475f9a231c5939 to your computer and use it in GitHub Desktop.
xnagyg_redirect_checkout_add_cart
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
| //https://businessbloomer.com/woocommerce-redirect-checkout-add-cart/ alapján | |
| function xnagyg_redirect_checkout_add_cart( $url ) { | |
| //csak ha van add-to-cart az url-ben GET | |
| if ( empty( $_GET['add-to-cart'] ) || ! is_numeric( $_GET['add-to-cart'] ) ) { | |
| return false; //ne irányítson át | |
| } | |
| $url = get_permalink( get_option( 'woocommerce_checkout_page_id' ) ); //Pénztár oldalra menjen | |
| return $url; | |
| } | |
| add_filter( 'woocommerce_add_to_cart_redirect', 'xnagyg_redirect_checkout_add_cart' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ha egyedi gombbal lett a termék hozzáadva, akkor a pénztárba menjen egyből. Ha termékoldalról adta hozzá, akkor a kosárba kellene mennie.