Website Building » WooCommerce » How Do I Change My WooCommerce Cart URL?

How Do I Change My WooCommerce Cart URL?

Last updated on January 15, 2023 @ 6:46 pm

If you’re running a WooCommerce store, it’s important to have a consistent and user-friendly URL for your cart page. By default, the URL for your cart page is set to /cart/, but you can change this in the WooCommerce settings. To do so, go to WooCommerce > Settings > Advanced > Page setup and change the Cart Page setting to the desired URL.

It’s also important to make sure that your cart page is styled correctly. You can do this by adding the following code to your functions.php file:

PRO TIP: If you are planning to change your WooCommerce cart URL, it is important to be aware of the potential consequences. This can affect your store’s functionality and cause issues with checkout. Be sure to test your store thoroughly after making any changes to ensure everything is working as expected.
function wc_custom_cart_page_css() {
    echo '<style type="text/css">';
    echo '.woocommerce-cart {';
        echo 'background: #fff;';
        echo 'padding: 30px;';
    echo '}';
    echo '.woocommerce-cart table.cart {';
        echo 'border: 1px solid #eee;';
    echo '}';
    echo '.cart th, .cart td {';
        echo 'padding: 10px;';
        echo 'border: 1px solid #eee;';
    echo '}';
    // etc..
    echo '</style>'; } 
add_action( 'wp_head', 'wc_custom_cart_page_css' );

This will ensure that your cart page has a consistent look and feel with the rest of your site.

Conclusion: In order to change your WooCommerce cart URL, you need to go to WooCommerce > Settings > Advanced > Page setup and change the Cart Page setting to the desired URL. You can also style your cart page by adding code to your functions.php file.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.