Website Building » WooCommerce » How Do I Change the View Cart Link in WooCommerce?

How Do I Change the View Cart Link in WooCommerce?

Last updated on October 1, 2022 @ 11:34 pm

If you’re using WooCommerce to sell products on your WordPress site, you may want to change the “View Cart” link text to something else. By default, this link appears in the header area of your site, next to the “Cart” icon.

PRO TIP: If you are not a developer, or are not comfortable with code, do not attempt to change the view cart link in WooCommerce. This can break your site if done incorrectly.

Changing the “View Cart” link text is a relatively simple process, and can be done with just a few lines of code. In this article, we’ll show you how to change the “View Cart” link text in WooCommerce.

Here’s how to change the “View Cart” link text in WooCommerce:

1. Log into your WordPress site and go to the Dashboard.
2.

On the Dashboard, hover over the Appearance menu item and click on Editor.
3. On the Edit Themes page, locate and open the file called header.php.
4. Find the line of code that says “echo sprintf( _n( ‘%d item’, ‘%d items’, WC()->cart->get_cart_contents_count(), ‘textdomain’ ), WC()->cart->get_cart_contents_count() );?> – cart->get_cart_total(); ?>” and replace it with the following:

cart->get_cart_contents_count(), ‘textdomain’ ), WC()->cart->get_cart_contents_count() );?> – cart->get_cart_total(); ?>

5. Save your changes and close the file.

That’s all there is to it! You have successfully changed the “View Cart” link text in WooCommerce.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.