Forum Replies Created
-
AuthorPosts
-
David
ParticipantFixed!
It was a two-step process.
1) Use the template override method to change the text in the button. So in cart-empty.php, relace the ‘Return to Shop’ string (right near the end) with your chosen text e.g. ‘Return to Events’2) To change the destination URL of the button, use this solution How to change the URL . This involves adding a function to your theme’s functions.php.
David
ParticipantLet’s try that again:
if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } wc_print_notices(); ?> <p class="cart-empty"><?php _e( 'Your cart is currently empty.', 'woocommerce' ) ?></p> <?php do_action( 'woocommerce_cart_is_empty' ); ?> <p class="return-to-shop"><a class="button wc-backward" href="<?php echo apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ); ?>"><?php _e( 'Return To Shop', 'woocommerce' ) ?></a></p>David
ParticipantHi Josh,
OK, so I understand how I can override the Cart template. To be more specific, I need to override the empty cart template which is called cart-empty.php. Unfortunately, it’s more complicated than I thought.
Can anyone point me in the right direction?The code looks like this:
if ( ! defined( ‘ABSPATH’ ) ) {
exit; // Exit if accessed directly
}wc_print_notices();
?>
<p class=”cart-empty”><?php _e( ‘Your cart is currently empty.’, ‘woocommerce’ ) ?></p>
<?php do_action( ‘woocommerce_cart_is_empty’ ); ?>
<p class=”return-to-shop”>“><?php _e( ‘Return To Shop’, ‘woocommerce’ ) ?></p>
-
AuthorPosts
