WooCommerce important page url

Below there is some needed woocommerce page url , which are frequently used to develop any woocommerce website.

The WooCommercer important page url are

 

Shop Url

$shopUrl = get_permalink( woocommerce_get_page_id( ‘shop’ ) );

Cart Url

global $woocommerce;
$aUrl = $woocommerce->cart->get_cart_url();

 

Checkout Url

global $woocommerce;

$aUrl = $woocommerce->cart->get_checkout_url();

 

Account Url

$aAccountPageId = get_option( ‘woocommerce_myaccount_page_id’ );
$aUrl = get_permalink( $aAccountPageId );

 

Logout URL

This example will generate a WordPress logout URL that brings the user back to the Account area of the site:

$myaccount_page_id = get_option( ‘woocommerce_myaccount_page_id’ );

if ( $myaccount_page_id ) {

$logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );

if ( get_option( ‘woocommerce_force_ssl_checkout’ ) == ‘yes’ )
$logout_url = str_replace( ‘http:’, ‘https:’, $logout_url );
}

 

I hope that the woocommerce page url will help you in your development.

Share The Post On -

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.