Forums › Forums › Search & Filter Pro › Woocommerce integration
Tagged: echo do shortcode, results, Template, woocommerce
- This topic has 17 replies, 3 voices, and was last updated 9 years, 6 months ago by Ross.
-
Anonymous(Private) December 20, 2014 at 10:41 pm #9336
Dear support,
I have a working WooCommerce setup filled with products. It took me a while to get all the styling done. However Woocommerce is limited in search capabilities so that’s the reason why I bought search and filter Pro.
As far as I understood i should deselect Ajax and use a page template. Mine is (relative to the theme directory) /woocommerce/archive-product.php. I think it cannot find it because it sticks to the default results.php which is located in {themedir}/search-filter/results.php.
What am I doing wrong?
Ross Moderator(Private) December 21, 2014 at 1:52 pm #9353Hey Janno – please update to the latest version – the way you are modifying teh template is for when using a shortcode, but it doesn’t seem like this is what you are doing…
The latest version has some UI fixes which should make things clearer – if you’re still having problems let me know.
Thanks
Anonymous(Private) January 7, 2015 at 4:11 pm #9895Hi Ross,
back from holidays I updated the plugin and tested the integration. Maybe I’m doing something wrong, please help me with the correct way to use your plugin.
I created a new page, inserted the [searchandfilter id=”2726″]. In Settings I selected ‘As an archive page’, ‘Use a custom template for results’ and entered the filename: /woocommerce/archive-product.php
Under Ajax: I checked Load results using Ajax.
Search is working. However, my lay-out is not consistent with the Woocommerce output of the search results.
What must I do to get them the same?
Best regards, Janno
Anonymous(Private) January 7, 2015 at 5:01 pm #9896Extra info:
If you go to http://vanka.magicservices.nl/?s=ketjap%20gekruid&post_type=product Woocommerce will show you 3 products in a correct lay-out.
If you search voor ‘Ketjap Gekruid’ on page http://vanka.magicservices.nl/producten2/ your plugin is using woocommerce/archive-product.php but the layout is different: the products are not listed next to each other. The URL is then: http://vanka.magicservices.nl/producten/?s=Ketjap%20gekruid
Please help, I’m running out of time on a strict deadline for next friday afternoon.
Best regards, Janno
Ross Moderator(Private) January 7, 2015 at 11:55 pm #9924Hey Janno
Can you give me a run down of your settings?
I had another user report that he needed
is_search
to be set to true in order to display products properly usingproduct-archive.php
in his theme – I added an option, goto theadvanced
tab in thesettings & defaults
box…Tick “force is_search to always be true” – let me know if that helps?
If not the next question is, is it actually using product archive? Have you tried customising the results or putting some text in the template to see if it is actually being loaded by this plugin for your results?
Thanks
Anonymous(Private) January 8, 2015 at 10:52 am #9929Hi Ross,
I checked force is_search always be true (it was not set before). But no difference. I added a H2 tag to archive-product.php and it is shown in the results. So it’s definitely loading the template.
Do you need login credentials to WordPress and FTP?
Best regards, Janno
Ross Moderator(Private) January 8, 2015 at 1:04 pm #9931Hey Janno
I would say this is a theme specific issue and not a plugin issue. I generally do not provide support for customising your theme template files – as these are more to do with your theme than the plugin – for example you can use this template anywhere in your theme (that is not the product archive) and I’m sure you would find similar results/problems.
However, that being said, the first thing to do with this kind of problem is check what the differences are between these two pages.
So I had a quick look at the source of the both the pages – although very similar there is one big difference.
If you take a look at the opening body tag you will notice the woocommerce page formatted in a grid has the class
woocommerce-page
and the results page does not.I added it via the dom inspector to http://vanka.magicservices.nl/producten and the grid works ๐
So there are two approaches to fixing this – the first – edit your css rules so the grid classes are also applied to the Search & Filter results page…
or
Add this class to the body tag on your results page ๐ This option is easier and only requires copying and pasting some code into
functions.php
:add_filter('body_class','add_body_class_to_search_filter'); function add_body_class_to_search_filter($classes) { global $sf_form_data; if ($sf_form_data->is_valid_form()) { $classes[] = "woocommerce-page"; } // return the $classes array return $classes; }
Hope that helps!
-
AuthorPosts