1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Change to WooCommerce Product Search

Discussion in 'Basic Support Forum' started by Hesja ehf., Jul 26, 2018.

  1. Hesja ehf.

    Hesja ehf. New Member

    Hello

    I'm using the ultimate header and I need to change the search from the standard Divi search to the WooCommerce Product Search. You can do this with a simple change of the header.php in Divi, but that doesn't work since I'm running the ultimate header.

    How do I do this with the ultimate header search?
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade before / after image slider for your Divi site without using any plugins:View Demo
  2. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    Our search coding is in the divi-ultimate-header-plugin.php file.

    You just need to go to Plugins -> Editor -> select Divi Ultimate Header Plugin -> find Add Search & Cart Start -> apply your changes there.
     
  3. Hesja ehf.

    Hesja ehf. New Member

    Hello and thanks for this. But could you give me a code I can use for the Woocommerce Product Search and tell me what to replace it with?
     
    1. PRO MEMBER PERKS Beautifully crafted custom colored 'Industrial' Divi layout for all Pro members:View Demo
  4. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    Look for:
    $du_search_outer = sprintf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',

    Replace with:
    $du_search_outer = sprintf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" /><input type="hidden" name="post_type" value="product" />',
     
  5. Roy Doble

    Roy Doble New Member

    Hello I'd also like to change to search to Woocommerce search. Looked for 'add search and cart' (ctrl F) and can't find it.

    Is it possible to create a module using: Simple Divi Shortcode

    and using the DIVI editor to place the product search there?
     
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Replace the default archive "Older Entries" with beautiful pagination:Learn More
  6. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    You should look for add search & cart, not add search and cart

    Then look the below & replace it. Or you can just search for below & replace it:

    Look for:
    $du_search_outer = sprintf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',

    Replace with:
    $du_search_outer = sprintf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" /><input type="hidden" name="post_type" value="product" />',
    If you wish to add the product search as a module, you can easily achieve that with sidebar module.

    First, go to Appearance > Widgets to create a new widget area & add Product Search widget in it. See screenshot below.

    upload_2019-3-26_23-32-5.png

    Then, you just need to proceed to add the sidebar module & select the new widget area & done. See screenshot below.

    upload_2019-3-26_23-33-53.png
     
  7. Roy Doble

    Roy Doble New Member

    Thanks for the info, I have a product search in the side bar already. Was thinking about having it in the header.

    Failing that, better styling options for the sidebar search
     
    #7 Roy Doble, Mar 27, 2019
    Last edited: Mar 27, 2019
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Replace the default archive "Older Entries" with beautiful pagination:Learn More
  8. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    Yup. There's no styling options for that. You will need custom CSS to style it.
     
  9. Roy Doble

    Roy Doble New Member

    OK found the code, and changed it. Product search in the top bar didn't work, but it does on the menu which is fine. Thanks
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade floating button design for your Divi site without using any plugins:View Demo