get woocommerce Lien de la page de mon compte
5 réponses
- votes
-
- 2016-01-04
Vouspouvez obtenir l'URL demon compte WooCommerce comme ci-dessous
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account',''); ?>"><?php _e('My Account',''); ?></a>
Vouspouvezmaintenant l'insérer également dans lemodèle de courrier électronique de commandeterminé.
<h2> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account',''); ?>">Go to your account page for review</a> </h2> <a href="http://animax.cf/product/happy-ninja/#reviews"> <img src="http://animax.cf/wp-content/uploads/2015/12/product-reviews.png" alt="Product Rating"> </a>
You can get the WooCommerce my-account URL as below
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account',''); ?>"><?php _e('My Account',''); ?></a>
Now you can insert this in completed order mail template too.
<h2> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account',''); ?>">Go to your account page for review</a> </h2> <a href="http://animax.cf/product/happy-ninja/#reviews"> <img src="http://animax.cf/wp-content/uploads/2015/12/product-reviews.png" alt="Product Rating"> </a>
-
Enfait,je suis débutanten phpet wordpress.Alors,mercibeaucoup WPTC-Troop.Actually i am beginner in php and wordpress. So, thank you very much WPTC-Troop.
- 0
- 2016-01-04
- Ans
-
Au lieu d'utiliser `get_option`et`get_permalink`,utilisez simplement lafonction de WCpour ceci: `wc_get_page_permalink ('myaccount')`Instead of using `get_option` and `get_permalink`, just use WC's function for this: `wc_get_page_permalink( 'myaccount' )`
- 11
- 2017-10-31
- David
-
- 2018-05-07
Lafonction wc_get_page_id woocommerce vous aidera à créer des URL depages WooCommerce
Exemples d'utilisation:
Mon compte
<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>
Boutique
<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>
woocommerce wc_get_page_id function will help you to create WooCommerce pages URLs
Examples of usage:
My Account
<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>
Shop
<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>
-
- 2019-02-04
Ilexiste un autremoyen de lefaireen utilisant lespoints determinaisonnatifs de WooCommerce (vouspouvez utiliser l'un despoints determinaisonenregistrés avec desplugins WC outiers qui se connectent à WC):
<?php echo esc_url( wc_get_account_endpoint_url( 'edit-account' ) ); ?>
Pour letableau debord,vouspouvez utiliser quelque chose comme ça
<?php echo esc_url( trailingslashit( wc_get_account_endpoint_url( '' ) ) ); ?>
There is another way to do this using the WooCommerce native endpoints (you can use any of the registered endpoints with WC or third-party plugins that hook into WC):
<?php echo esc_url( wc_get_account_endpoint_url( 'edit-account' ) ); ?>
For dashboard you could use something like this
<?php echo esc_url( trailingslashit( wc_get_account_endpoint_url( '' ) ) ); ?>
-
- 2020-06-11
Il renvoie lapage du compteelle-même sanspoints determinaison:
echo wc_get_account_endpoint_url('dashboard');
It returns account page itself without endpoints:
echo wc_get_account_endpoint_url('dashboard');
-
- 2019-07-15
<?php if ( is_front_page() && is_home() ) { // Default homepage echo "Default homepage"; } elseif ( is_front_page()){ echo "Static homepage"; // Static homepage } elseif ( is_home()){ echo "Blog page"; // Blog page } elseif ( is_page( 'cart' ) || is_cart()){ echo "cart"; // Blog page } elseif (is_single()){ echo "is_single"; // Blog page } elseif (is_product_category()){ echo "is_product_category"; } else { echo "Everything else"; // Everything else } ?>
<?php if ( is_front_page() && is_home() ) { // Default homepage echo "Default homepage"; } elseif ( is_front_page()){ echo "Static homepage"; // Static homepage } elseif ( is_home()){ echo "Blog page"; // Blog page } elseif ( is_page( 'cart' ) || is_cart()){ echo "cart"; // Blog page } elseif (is_single()){ echo "is_single"; // Blog page } elseif (is_product_category()){ echo "is_product_category"; } else { echo "Everything else"; // Everything else } ?>
-
Veuillez ** [modifier] votre réponse **,et ajouter uneexplication: **pourquoi ** celapourrait-il résoudre leproblème?Please **[edit] your answer**, and add an explanation: **why** could that solve the problem?
- 1
- 2019-07-15
- fuxia
J'essaie d'envoyer une-mail au client après l'achat deproduitset lorsque le client clique sur le lienfourni avec l'e-mailpour évaluer leproduit,il doit rediriger vers le compte du client/lapage demon compte.
J'aimis du code dansfunctions.phppour obtenir l'URL demon compte WooCommerce:
J'aipersonnalisé dans customer-completed-order.php et mis ce code
Je souhaite obtenir l'URL demon compte woocomerce dans le code ci-dessus.comment dois-jefaire cela?