Last active
March 20, 2021 02:37
-
-
Save rynaldos-zz/a1b901e1b98eef3646fa07c6465db6de to your computer and use it in GitHub Desktop.
[WooCommerce 3.0] Add "go back" button on single product page
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
add_action( 'woocommerce_after_add_to_cart_button', 'my_function_sample', 10 ); | |
function my_function_sample() { | |
global $product; | |
echo ' <button type="button" onclick="history.back();"> Go back </button> '; | |
} | |
// Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If i want the onclick event to send me back to shop how do i code it?
Thanks