WordPress WooCommerce get my-account page url

In this post we are going to learn to get myaccount page url of woocommerce , now start step by step

First: get the my account page id by using the code get_option( ‘woocommerce_myaccount_page_id’ );

Second: check if there is any myaccount page id

Third: get the parmalink by passing the myaccount page id through the function get_permalink( $myaccount_page_id )

and you have get the my account page url now you can print that.

Here is the full code

<?php
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if ( $myaccount_page_id ) {
$myaccount_page_url = get_permalink( $myaccount_page_id );
}

?>

Thanks for Reading

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.