Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #4521618
search results
Open

Comments

  • yara started the conversation

     when i search something in search bar, the products appear but without their prices. i need the prices to show. and why are the images like this half the image is not visible?

    Attached files:  soledad ticket image search bar.png

  •  3,058
    PenciDesign replied

    Hi,

    The issue is that this search bar is designed for normal posts, not for products, so it cannot display product prices. Product prices and other product details will only appear when searching through the WooCommerce/Product Search form.

    Regards,
    PenciDesign. 

  • yara replied

    SO HOW DO I FIX IT? CAN YOU FIX IT FOR ME IF I PROVIDE YOU WITH LOGINS PLEASE

  •  3,058
    PenciDesign replied

    Hi,

    You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/

    function penci_search_only_posts( $query ) {
        // Run only on frontend main search query
        if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
            $query->set( 'post_type', 'post' );
        }
        return $query;
    }
    add_action( 'pre_get_posts', 'penci_search_only_posts' );
    

    Regards,
    PenciDesign.

  •   yara replied privately
  •  3,058
    PenciDesign replied

    Hi,

    I’ve added this code to your site. Please check it.

    Regards,
    PenciDesign.

  • yara replied

    hello again, i searched using the search box but its still not working the right way

  •  3,058
    PenciDesign replied

    Hi,

    I’ve updated the code. Please check it.

    Regards,
    PenciDesign.

  • yara replied

    now when i search for something it says " item not found"

  •  3,058
    PenciDesign replied

    Hi,

    The search results are now showing posts only. Product post types are excluded and will appear only when you search using the WooCommerce search.

    Here is an example: https://toycenterleb.com/?s=home

    Regards,
    PenciDesign.

  • yara replied

    yes you already told me this, and i asked how to fix it, how do i make the search by woo-commerce so that people can search products and find them instead of blogs. 

  •  3,058
    PenciDesign replied

    Hi,

    I’ve modified the search function on your site. The search results will now show product items only on the WooCommerce template.

    Please clear all the browser caches and check again.

    Regards,
    PenciDesign.