wc_get_cart_url()
Gets the url to the cart page.
Uses: wc_get_page_permalink()
Hooks from the function
Return
String
. Url to cart page
Usage
wc_get_cart_url();
Examples
#1 Display a link to the shopping cart
<a class="cart-link" href="<?php echo esc_url( wc_get_cart_url() ); ?>"> View cart </a>
Changelog
Since 2.5.0 | Introduced. |
wc_get_cart_url() wc get cart url code WC 7.5.1
function wc_get_cart_url() { return apply_filters( 'woocommerce_get_cart_url', wc_get_page_permalink( 'cart' ) ); }