abent
Forum Replies Created
-
Hi,
We find this solution for the moment (author: 7uc1f3r).
https://stackoverflow.com/questions/61601915/change-return-to-shop-to-return-to-previous-page
———
function action_woocommerce_cart_actions( ) {
// Pass the URL it came from. Expl: https://www.example.com/shop/product-1/
$previous = $_SERVER[‘HTTP_REFERER’];// Get last part from url. Expl: product-1
$last_part = basename( parse_url( $previous, PHP_URL_PATH ) );?>
“>
<?php _e( ‘Return to ‘ . $last_part, ‘woocommerce’ ) ?>
<?php
}
add_action( ‘woocommerce_cart_actions’, ‘action_woocommerce_cart_actions’, 10, 0 );
——————Is there a possibility to hide the button?
Thanks for your reply.
I think this is an interesting option to add. Because, when shopping, it’s more intuitive to go back to the category from where you added the product instead of going back to the root of the shop and redo all the search in the menu tree.thank you again.
Best regards