WooCommerce 2.1.X Endpoints vs Shortcodes

Since WC 2.1, some shortcodes in WooCommerce have been removed and replaced by endpoints. That means that some shortcodes aren’t valid anymore. Basically if you go to WooCommerce > Settings > Accounts tab, you will be able to view and edit endpoints values. Let’s say your “my account” page slug is “my-account”, then all pages will be reachable using this structure:

http://mysite.com/my-account/endpoint.

For the logout page it would be http://mysite.com/my-account/customer-logout

Available endpoints

woocommerce-endpoints

So, why did we choose to replace shortcodes by endpoints?

Well, WooCommerce is used by many non technical persons that can easily break it. In former WooCommerce versions, you had to create pages, create a link between those pages and WooCommerce settings, and add shortcodes to the newly created pages. That was too much, and too many risk to break the site. Now endpoints, give a really simple way to deal with custom urls and WooCommerce pages, without the risk of having a page without a shortcode that wouldn’t display anything.

How to add WooCommerce specific URLs to the WordPress menu

To add WooCommerce pages URLs to your WordPress main menu, simply go to Appearance > Menus in the WordPress main menu:

appearance-menus

Then click on the links section:

menus-links

And finally add custom URLs using the “my account” page slug and the endpoints values, and hit the add to menu button:

custom-url

About the author

Remi Hey! My name is Rémi Corson, I'm a French WordPress Developer, I code stuff and I write from time to time ;-) Buy a coffee
Show your support

Related Posts

31 comments

  1. pietbos:

    I don’t understand, doesn’t the Codex article you linked to say that the link then becomes: permalink/?foo=bar ?

    That would mean that your example would show: http://mysite.com/?my-account=customer-logout

    I’m sure it works, but how is that better than before?

  2. […] WooCommerce 2.1.X Endpoints vs Shortcodes by Rémi Corson […]

  3. […] WooCommerce 2.1.X Endpoints vs Shortcodes One of our support technicians Remi has explained the difference between WooCommerce 2.1 endpoints and how pages like pay, thanks and logout where handled in previous versions. […]

  4. LordLiverpool:

    Hi Remi

    Firstly thanks for the article. But I am still confused.

    The webpage http://develop.woothemes.com/woocommerce/2014/02/solving-common-issues-after-updating-to-woocommerce-2-1/ brought me here.

    I upgraded from WooCommerce 2.0 to WooCommerce 2.1.2 and now some of my pages have stopped working. i.e. Change Password, Edit My Address. They were working in the previous version. What happening now is the [shortcodes] are being shown on the front end rather than the forms.

    I read your article twice and I am still none the wiser. I tried blindly altering my permalinks to the default and then back again but it made no difference.

    I don’t understand what I have to do to get these pages to work???

    Can you please help???

    Thanks very much.

    • ann98:

      Lord Liverpool, I can assist you here! I spent a long time scratching my head over this before I found this article.

      If you head back to Remi’s article, from the point appearance, menus – you will need to set up a menu with custom links! I did this and have a user menu set in the top-menu area. Unfortunately I haven’t been able to get any login/register plugins to work with these endpoints (I tried 6 different plugins), but that may just be my lack of wordpress experience. However, for the most part the top menu is almost working as I expect – the /view-order endpoint is showing rather a lot more than the orders though, but I’m expecting to hear back from Woo any minute now..

  5. rahy:

    I used the shortcode to display the change and reset/lost password in a tab (one tab for change password and another tab for reset password). With the endpoints, how do I do that?

  6. oliver:

    Hello Remi,

    I just want to ask you about Woo-commerce. I want to take user input at the time of add product to cart as we are taking product id, quantity and resign to to purchase the product.

    Waiting for your response.

  7. rahy:

    Hi Remi,
    How do we display a page via endpoints if not using the menu?
    With shortcode we can make the shortcoded page as part of another page.
    If can’t, I think there is still an advantage (to user) to have the shortcodes.

  8. retroriff:

    Hi, what is now the conditional logic to know if we our current page is an endpoint? Is this working?

    if(is_wc_endpoint_url(“order-received”)) echo “yes”;

    Thanks.

  9. anuj:

    thank you for the lovely post, it has help me resolve lot of issue after the update.
    Couldyou please let me know how to get a page/link for change password.
    I cant see any endpoint for change password .

  10. ahmedmasud:

    Well fudge, the thing is WooCommerce endpoints don’t always work. In particular we have some serious ajax magic that enables loading of local content. Now we have to write special functions just to support this endpoint stuff.

  11. tmz4444:

    Hi Remi.
    I need my Thank You page to NOT be on HTTPS, so it can have an affiliate tracking “conversion pixel” which is called on a non-secure URL. But the ThankYou page is really just an EndPoint now — an alternate version of the Checkout page. So how can my Checkout page be HTTPS but my ThankYou page NOT be on HTTPS?

  12. Shasta Consulting:

    Hi Remi,
    The product check out end point in settings shows order-received, but when the 404 error returns after a successful purchase, the bad url shows: “ordered-received”. When I take the “ed” out of the bad url and enter that, the problem is corrected, and it then comes up with the order status page, which is correct.

    What I don’t know how to do is find the piece of code or setting that contains those extra letters. Can you please lead me to the place where I can go correct that syntax?
    Thanks!
    George

  13. luc:

    Hi Remi,

    I was just wondering, I want to have an extra page for ‘recent orders’. Is this possible with a custom endpoint?

    Thanks!

  14. RHazelrigg:

    so do I have to add “/endpoint” to each page?

  15. tolginho:

    You can simply enable WooCommerce Endpoints menu items by activating it’s menu list from screen options instead of using custom links.

Leave a Reply