How to Add Custom Endpoints in WooCommerce? (3 minute hack)

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

Комментарии • 74

  • @engrrajonahmed
    @engrrajonahmed 2 года назад +2

    An underrated channel for WordPress tricks!

  • @ravindug
    @ravindug 2 года назад +1

    Awesome, need more these kind of custom codes stuff

  • @nufrankz
    @nufrankz 4 месяца назад

    Thaaank you! In my case, the "Saving Permalinks" tip worked!

  • @ot_baby
    @ot_baby Год назад

    great tutorial and thanks alot
    Do I need to "Add New" snippet for different endpoints?
    Can't I put all the endpoints in one snippet post?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      You can add it inside one snippet box. Pay attention, if you're adding sepsrate functions, then either way you have to add function names.

    • @yorkshirewebradio7727
      @yorkshirewebradio7727 4 месяца назад

      @@wpsimplehacks can you explain more ive been trying to get this to work but can only add one endpoint that works as i don't know how to add the extra functions, I tried copying and pasting.

  • @yorkshirewebradio7727
    @yorkshirewebradio7727 4 месяца назад

    How do you add more than one endpoint? you can add as many as you like but in your example only support is referenced, for example how do ALSO add content to the wish list as well as support?

    • @wpsimplehacks
      @wpsimplehacks  4 месяца назад

      If you need to add more than one endpoint, then you need to change the function names. If you don’t know how to do that, then past the code to the ChatGPT window and ask it to create you as many additional tabs as you need. Just be sure to write a correct prompt

  • @Hassan_Omer
    @Hassan_Omer 2 года назад

    Thank you very much for doing this tutorial, do you have a video on how to add media to account page e.g in the Download section of the account page ?

  • @makc1
    @makc1 2 года назад

    Very Useful as always!👍👌

  • @josechacon357
    @josechacon357 Год назад

    Hello, thank you very much for your video, I want to add a tab that says: my certificates, and one that says: my groups, I can use the same code and just replace the links right? and to give it an order, that is, to be first; my courses, then my certificates and then my groups.

    • @wpsimplehacks
      @wpsimplehacks  Год назад +1

      Yes, you can, but you need to change function names, otherwise it’ll break your site. Foe example, if the function name is function wpsh_custom_endpoint then another endpoint should be something else (function wpsh_custom_endpoint1 or smth). In a similar way, take a look at all the function names an rename them.

    • @josechacon357
      @josechacon357 Год назад

      @@wpsimplehacks thank you very much, I will do it that way, I also wanted to ask you two questions, 1.- is it possible to create a login button on the Learndash course page? unfortunately, Learndash does not have this important but necessary function, 2.- when using the course grid, there is a button that says continue learning, when you click it, it takes you to the main course page and there you have to click on the lessons again to take you to the focus mode, is there a possibility to redirect a user directly to the focus mode without going through this page?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      It would be wise to ask about it from the plugin support team

  • @adrianforster4956
    @adrianforster4956 2 года назад

    Thanks so much for the excellent videos. I do often wonder how you manage to serve such solid solutions to the challenges I discover, pretty much as I'm having them. 🙌

    • @adrianforster4956
      @adrianforster4956 2 года назад

      quick Qu - how do you rate blocksy & the Jet suite of plugins to deliver a dynamic media download site build? Having steered away previously due to the bloat of elementor, it seems that their Gutenburg features are now ready for business. I've waited for the FSE to happen before committing and now the ecosystem seems to be settling down, I wonder what your thoughts are..? Keen to hear any useful insights and war stories. Thanks again.

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Depends on what you're trying to accomplish. You can create CPT-s without any plugin and Blocksy allows you to output them nicely. I have made a video about it.
      If you need a more complicated solution then Kadence Blocks Pro allows to display dynamic content. I haven't tried Jet engine etc Jet plugins but I've heard they're good.

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Thank you for your kind words 😎

    • @adrianforster4956
      @adrianforster4956 2 года назад

      @@wpsimplehacks Great I'll dig in to that video. Crocco blocks feels like quite a good suite to scale my features as I grow and as I need them - without having to code everything. Does Kadence Blocks Pro play nicely inside Blocksy theme do you know?

    • @adrianforster4956
      @adrianforster4956 2 года назад

      @@wpsimplehacks I thought you had a Finish accent as you remind me of my father-in-law (lol) but I worked you are from Estonia. 🤓Very similar sounding! 🙂

  • @startupmediadk
    @startupmediadk 2 года назад

    Hi. Sorry, it goes a little fast around 2.38. I'm using Elementor. How do i set the shortcode for the contact form there?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Do you have Elemetor pro and you created a contact form with it? If so then create a template with Elementor and it'll give you a shortcode you can use,

  • @lebserhal2290
    @lebserhal2290 8 месяцев назад

    Im getting an error in snippet
    Snippet automatically deactivated due to an error on line 5:
    Cannot redeclare function wpsh_custom_endpoint.

    • @wpsimplehacks
      @wpsimplehacks  7 месяцев назад

      I just rechecked it and it works as promised. Here’s the screenshot: cln.sh/CRyf3JJv
      Do you use this code to create more than one custom endpoints? If so, then you need to change the function name.
      The error message "Cannot redeclare function wpsh_custom_endpoint" typically occurs in WordPress when a function with the same name as an existing function is declared more than once within the same codebase.

  • @Dansen15
    @Dansen15 3 месяца назад

    Underrated goat

  • @WTPleo
    @WTPleo 4 месяца назад

    I don't understand how and where do you design the actual content of the tab?

    • @wpsimplehacks
      @wpsimplehacks  4 месяца назад +1

      The tab content may consist of a shortcode, such as those from your contact form plugin, or plain HTML.

    • @WTPleo
      @WTPleo 4 месяца назад

      @@wpsimplehacks Thank you.

  • @ohmyohmerful
    @ohmyohmerful Год назад

    What should be the problem when I change the slug, it does not display the content I want to shot but instead, it shows the default content I have from the Dashboard.

    • @ohmyohmerful
      @ohmyohmerful Год назад

      "Line 23 contains woocommerce_account_support_endpoint and you need to change it accordingly. That is, if your endpoint slug is your-courses then this line should look woocommerce_account_your-courses_endpoint" --- this part is causing it. When it is a two words slug, it does not shows the content I want.

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Test with the one word slug

  • @pixelnthings
    @pixelnthings 2 года назад

    Great tutorial...I was looking for this...Please create video on custom login, registration, reset password pages...

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Do you mean for Woocommerce?

    • @pixelnthings
      @pixelnthings 2 года назад

      @@wpsimplehacks yes....

    • @yorkshirewebradio7727
      @yorkshirewebradio7727 4 месяца назад

      They dont play well, tbh if you edit all the pages you need for woo, you end up with some messy code and none of the elements work together absolutely seamless without plugins, what i mean is if you have a nice custom my account page and login pages, then you don't want the default wordpress/my account login shown on logout and you want your custom login it works fine if you are signed in as admin it will log you out to your custom page if you are logged in with a customer account regardless of any code you added for this function it still logs you out to the original login page, I believe this can be done with plugins not sure which, but its the usual WordPress loop buy this plugin that needs that plugin, so I guess it depends on how much you need this but its not reliable because no one has done a full tut so its difficult as you end up having to use code from several different tuts for everything to work, ive created my custom login, but like i say its not reliable

  • @ot_baby
    @ot_baby Год назад

    Please how do I display user profile at the top of the my account menu?

  • @JEI-BY
    @JEI-BY Месяц назад

    Hey, how to add on tab, page ID?

    • @wpsimplehacks
      @wpsimplehacks  28 дней назад

      Sorry, I did not understand the question

  • @sebastianpreuer5147
    @sebastianpreuer5147 Год назад

    Thanks for the great video. Is it also possible to add 2 custom endpoints with the script into MY ACCOUNT? I tried it but its seems not to work!

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Yes, you can. You can see me doing it in the video.
      Be sure not to add enpoints using the same function names and slugs.

  • @60_9
    @60_9 2 года назад

    Great work sir, I learned a lot from your videos and still learning
    Can you tech us how to search by name OR SKU?
    defult only support search by name
    I'm using flatsome theme
    Thank you

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      Tehre are plugins that will allow you to do that. For examl,e Relevanssi is one of them.

    • @60_9
      @60_9 2 года назад

      @@wpsimplehacks I will try it, thank you and keep going

  • @xrpalyze4751
    @xrpalyze4751 Год назад

    So can you create a custom endpoint but have the content be a specific page?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Nope, you can't output a regular Wordpress page over there.

    • @xrpalyze4751
      @xrpalyze4751 Год назад

      @@wpsimplehacks Thanks. How do you get content from a page into a custom endpoint?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      As I said in my previous comment: you can’t. :) Endpoint is for custom content (text,, contact forms etc.) If you can figure out how to output your page content with the help of shortcodes, then maybe... But I’m not sure.

    • @xrpalyze4751
      @xrpalyze4751 Год назад

      @@wpsimplehacks Thank you.

    • @saykopikey
      @saykopikey Год назад

      @@wpsimplehacks I was trying exactly the same with the plugin Insert Pages, but unfortunately it only shows the default dashboard content instead of the page content, the shortcode doesnt work.

  • @sproksch87
    @sproksch87 2 года назад

    I love your channel.

  • @clarissafiliciana
    @clarissafiliciana 2 года назад

    Does this only work with Learndash and Fluent?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      Nope. You can add whatever content you wpuld like to add inside this custom endpoint.

    • @clarissafiliciana
      @clarissafiliciana 2 года назад

      I tried using the elementor form shortcode. But when entering the my account. The space remains empty.

  • @kiraktechnicals
    @kiraktechnicals 10 месяцев назад

    How do i add icon before the text

  • @mateen9575
    @mateen9575 2 месяца назад

    i do same but my profile accout is not working same as you show in video

  • @fabiolepera8661
    @fabiolepera8661 2 года назад

    thank you so much