Add Live Ajax Search In WordPress without plugins [10]

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 21

  • @Nima-Norouzi
    @Nima-Norouzi ปีที่แล้ว

    Hi there, thanks for this tutorial.
    I implemented and it works fine. I’m just curious how can I add the product’s SKU and Price to be shown for each product as well? At the moment it just shows the image and title.
    Thanks، you are right. Because I didn't know how to add more code to it, I asked you. This is very important for Woo websites. 🙏🙏🙏

    • @WPCookie
      @WPCookie  ปีที่แล้ว +1

      Hi Nima.
      Yes, this is possible, but it requires changes in the code. In the future I will make a dedicated video about the search bar for WooCommerce products and I will include all the requests in it.

  • @dmg06
    @dmg06 2 ปีที่แล้ว +1

    is it possible to respect exiting popup screen after click on search result?

    • @WPCookie
      @WPCookie  2 ปีที่แล้ว +1

      Yes, use this code instead:
      goonlinetools.com/snapshot/code/#tf6rfkjxbuntshopsj27
      Please let me know if this code worked for you.

    • @dmg06
      @dmg06 2 ปีที่แล้ว

      @@WPCookie Not worked. Can you please watch the video below what i mean? On my website when i click on select button appear popup modal view. But if i click on your code for an search result it redirect to product page. It's not open as popup modal view.
      th-cam.com/video/vfze95amYXU/w-d-xo.html

  • @ramaslan
    @ramaslan ปีที่แล้ว

    Hi. sorry i asked a lot of questions...When it is empty, clicking on the search bar redirects to the dashboard. How do I know, when clicked while it is empty, the search bar will be directed to the shop page or to the main page?thank you

    • @WPCookie
      @WPCookie  ปีที่แล้ว

      Hello Ram, the search bar itself is not linked anywhere and clicking on the magnifier icon will take you to the default WordPress search page.
      If you mean the "Sorry, nothing found" link then find
      Sorry, nothing found
      and put your desired link instead of #.

  • @ramaslan
    @ramaslan 2 ปีที่แล้ว

    you are a king. i want remove serach button. I don't know coding. how do i delete the button button and get the bar extended. Thank you

    • @WPCookie
      @WPCookie  2 ปีที่แล้ว +1

      Hi, if you don't want the search button, remove the button tag:
      🔍
      By default, the length of the search bar is 600px, if you want to expand it, delete the following style code:
      width: 600px!important;

    • @ramaslan
      @ramaslan 2 ปีที่แล้ว

      @@WPCookie Thank you

    • @ramaslan
      @ramaslan 2 ปีที่แล้ว

      @@WPCookie I want to ask a question. How can I make a price filter without a plugin?

    • @WPCookie
      @WPCookie  2 ปีที่แล้ว +1

      @@ramaslan Go to Appearance-> Widgets and in the Woocommerce Sidebar add a "Filter Products by Price" block.

    • @ramaslan
      @ramaslan 2 ปีที่แล้ว

      @@WPCookie Thank you very much for your reply. How background of the search bar? Now the net is in color and where can I change the background color of the search bar? in the css section or html?I wish you a good day

  • @ramaslan
    @ramaslan ปีที่แล้ว

    hi. i hope everything is going well..i want to ask a question. ajax search looks good but doesn't show categories. so I would like it to search the categories. How do I add it to those codes and show the categories?

    • @WPCookie
      @WPCookie  ปีที่แล้ว +1

      Hey there! I hope you’re doing well. If you’d like to see posts in one or more specific categories in your search results, it’s possible to make a few changes in the code. However, if you’d like the categories themselves to be displayed in your results, that’s a bit more complicated.

    • @ramaslan
      @ramaslan ปีที่แล้ว

      @@WPCookie sir my question is it shows products and posts in search. but it doesn't show categories. Let's say my post is one for animals and the other for humans. While I was doing ajax search, let's say I searched for an animal and the catalog should be displayed. All posts should be about animals when you enter that category.

    • @ramaslan
      @ramaslan ปีที่แล้ว

      @@WPCookie these codes are working perfectly, it just doesn't show the categories.

    • @ahmadhussien1636
      @ahmadhussien1636 ปีที่แล้ว

      @@WPCookie
      $categories = get_the_terms($product_id, 'product_cat'); // استرداد قائمة بكل الفئات التي ينتمي إليها المنتج

  • @jeremiahbarnabas9016
    @jeremiahbarnabas9016 5 หลายเดือนก่อน

    Hi, what if I want to search user roles

  • @ahmadhussien1636
    @ahmadhussien1636 ปีที่แล้ว

    Snippet automatically deactivated due to an error on line 6:
    Cannot redeclare function asearch_func.

    • @WPCookie
      @WPCookie  ปีที่แล้ว +1

      You probably already inserted this code into code snippets plugin, you should delete the previous one.