Skip Navigation

[Resolved] Hi, I need assistance to set up a custom search on my site.

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 18 replies, has 3 voices.

Last updated by Waqar 5 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#1127989

Tell us what you are trying to do? Set up custom search

Is there any documentation that you are following? Read them all, you should have just kept them in Chinese. Completely confusing and full of holes.

Is there a similar example that we can see? When the site is online can see again.

What is the link to your site? motorfind.co.uk (site will be down for a while)

#1128059

I understand that you already tried the DOC?
I gonna share it again, in case there is some missing:
https://toolset.com/documentation/user-guides/front-page-filters/ (General Setup)
https://toolset.com/documentation/getting-started-with-toolset/filter-content-lists-and-add-custom-search/ (Custom Search particular)
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/ (Custom Search Advanced settings)

However, we could also provide a module, with a simple setup of a Custom Search, let's say a Post type, a Field and a search by that field on a View?
If you agree I can set up one for you and share by Google, for example.
Modules are elaborated here:
https://toolset.com/documentation/user-guides/using-toolset-module-manager/

Would this be helpful to get started with the Custom search project?
The module would only include the "raw" structure of a simple custom search on a custom post type with a field.
You can then see how it's made and "repeat" that.

Let us know if that would work?

#1129297

Hi

Thank you for your replies.

Basically I have created a used car website. motorfind.co.uk

I'm current using Ajax Search Pro by WPDreams as the main text search option.

Results are rendered on a 25 per page basis.

The above plugin also has custom field filtering setup.

However, the above plugin does not offer the Ajax loading feature for sub categories as your one does.

Whereas in this day day and age it should be pretty standard.

Anyway, to put the plan as simply as possible.

I would like to keep the current search bar as it is.

Then have Toolset Views filtering underneath setup for filtering custom fields. (Fuel, Price, Trans, Co2, Etc...)

My concern is how to display results that will match the ''current'' ad results page?

I've been trying to figure your plugin out but with little to no success.

Just really don't understand how to set it up. Nor the exact correlation between each shortcode generator.

Then there's the output method. I just can't see how they match up.

Lastly, I hard coded all of the website myself so I do have pretty sound basics in most areas.

But can't seem to grasp your plugin so would genuinely appreciate your help in getting it setup.

I believe it can work well with the current search bar and your filters instead of relevannsi.

Please feel free to snoop around and excuse the mess, still have lots of cleaning to do.

If you need anything please feel free.

Kind regards,

Robert

#1129616

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thanks for writing back and sorry to learn that you're having difficulty in setting up our plugins.

To learn about the features and set up of our plugins, we offer a free demo library at:
https://discover-wp.com/

You can create demo websites there and explore how different features are used in pre-built referenced sites:
https://discover-wp.com/site-templates/

For example, the "Real estate site" makes use of search filters to show results with AJAX loading, similar to what you're planning to achieve:
hidden link

I'll recommend deploying a demo website with this reference site, which will give you a working example to explore how its views and search filters are configured.

You mentioned your main concern is to how to display results, filtered through the search parameters. This will require creating a View, with necessary filters, as explained in this guide:
https://toolset.com/documentation/user-guides/front-page-filters/

Toolset offers its own search form for filters. To make your search form created through a third-party plugin work with the Toolset view, custom programming will be needed. Custom programming work is beyond the scope of our support, but you can consider contacting one of our certified consultants from this link:
https://toolset.com/contractors/

If you have any specific questions or concerns related to how that reference website is setup or any step mentioned in our documentation, you're welcome to write to us anytime. Please do share the link to a website where you tried to use a particular feature, along with the followed steps.

Note: As per our support policy ( https://toolset.com/toolset-support-policy/ ), only one question or issue can be addressed in each ticket, so please remember to file a new ticket for each question.

I hope this helps! Please let us know if you need any further assistance.

regards,
Waqar

#1130544

Hi

I'm not interested in a training site.

I've read all that garbage already.

I need real help to set up the filters and and explained the process correctly.

So if you could please put someone in touch who knows what they're talking about and will genuinely help it will be greatly appreciated.

Regards,

Robert

#1130664

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

I can deploy custom search and filters similar to your website, on one of my demo websites and then share its link and detailed instructions on how it was set up with you.

If this sounds like a good option, I can have these ready by Monday.

Please let me know if this will help in making things more clear.

regards,
Waqar

#1130677

Hi

Ok, thank you.

Can you please show how I can direct results to the original results page template?

Plus my site was completely custom coded so how would I add the filtering and results page code via .php?

As in everything was coded directly in the .php files and no backend end wordpress editor functions were used.

Thank you

#1132038

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thanks for confirming that and our Toolset plugins are designed to eliminate/minimize the need to work with PHP code, directly.

I'll share the completed instructions and a working demo for the search results page with filters, as soon as it ready, ideally within the next 24 hours.

Thank you for your patience.

regards,
Waqar

#1132074

Thank you Waqar.

Look forward to seeing it in action.

Regards,

Robert

#1133958

Hi

What's the situation with this ?

It's been over 3 days.

Regards

#1134052

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thank you for waiting while I worked on the demo website and I apologize for the delay in getting back to you.

The demo website is ready and can be accessed at:
hidden link

It is a fairly basic setup that matches filter fields used on your motorfind.co.uk website. Search filters and results are using built-in features available in Toolset plugins and no custom PHP code was involved in its making.

The snapshot/clone of the website can be downloaded from this link:
hidden link

This snapshot was created using the Duplicator plugin ( http://wordpress.org/plugins/duplicator/ ) and you'll find the instructions on how to deploy this snapshot on your own server, in this video:
hidden link

Access details for the snapshot's admin access after it has been deployed:
Username: MFadmin
Password: MFadminMFadminMFadmin

My recommendation would be to first deploy this snapshot on your server and then read through the steps explained below. With a live example and back-end access, you'll get a better understanding.

To make the website, I worked with the following components:

1. Custom post types:

Three custom post types were used:

a). Listings: These will hold the actual listings for each car entry.

b). Car Companies: These will hold individual car manufacturers which will be used for the "Make" filter.

c). Car Models: These will hold individual car model names which will be used for the "Model" filter.

2. Post relationships:

To have AJAX loading filter for the "Model" field, which is linked to "Make" field, taxonomies can't be used, since they can't be linked together. For this reason, custom post types were used which were then connected with one another, through a one-to-many relationship.

Two post relationships were created:

a). "Car Companies" were linked to "Car Models" through a one-to-many relationship. This means that each car company can have multiple car models, but each car model can only have one car company.

b). A second one-to-many relationship was created between "Car Models" and "Listings". This means that each car model can be used with multiple listings, but each listing can only have a one car model.

3. Custom field group

A new custom field group named "Car Details" was created and set to show only on "Listings" custom post type.

It included custom fields for rest of the filters, namely:
- Fuel
- Mileage
- Price
- Year
- Private or Trade
- Transmission
- Body Type
- Colour

4. Post View

The actual search filters and listings are being displayed on the front-end using a View. It can be created from WP Admin -> Toolset -> Views. When "Add New" button is clicked, a couple of options are shown to best describe the purpose of the view ( screenshot: hidden link ). I selected the option "Display the results using a custom search".

You'll find only one view in the list named "Car Search View", which is showing the list of cars along the search filters on the homepage.

a). On the view's edit screen, I selected "Listings" as a post type to show the list from.
( screenshot: hidden link )

b). The search filters which are shown above the lists were inserted in the "Search and Pagination" section, in the same view.

c). The design or format of how each car list item is shown on the front-end is controlled through the code and fields added in the "Template for this View" section.

5. Showing the created view on the homepage

a). I created a new page named "Home" and selected it as a static Homepage from WP Admin -> Settings -> Reading.

b). On that page's edit screen, I used the "Fields and Views" button, to insert the shortcode to display this view on the page.
( screenshot: hidden link )

My recommendation would be to see how the view, custom post types, custom fields, and post relationships are set up on the demo website and then try to add some new views, to explore and experiment with the different available options.

If you have any specific questions related to any element shown in that demo website, please let me know.

I hope this helps!

regards,
Waqar

#1134861

Hi

Thank you for setting up a demo website.

I really appreciate the effort.

How can I display the examples you made on my website?

The traditional page wordpress editor will not work as all pages were coded directly in .php.

So can I insert your code?

And how can I display my results page?

#1135052

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thanks for writing back and glad that demo website helped.

> How can I display the examples you made on my website?

- To move the structure (i.e. custom post types, post relationships, post field groups, views etc) from one website to another, you can use the "Toolset Module Manager" plugin.

It should be already available on the cloned demo website and you can go to WP Admin -> Toolset -> Modules and create the export file, with the selected items.
( screenshot: hidden link )

Once, you've downloaded the zip file, it can be exported on your website, through the same plugin. You'll go to WP Admin -> Toolset -> Export / Import and select the "Modules" tab.

Note: If you'd also like to import the data elements (e.g. items in car companies, car models and listings), regular WordPress Import / Export feature can be used for that.

> The traditional page wordpress editor will not work as all pages were coded directly in .php.
> So can I insert your code?

- You can embed a view directly into PHP file, using "render_view" function.
( https://toolset.com/documentation/programmer-reference/views-api/#render_view )

For example, to embed a view with the title "Car Search View", you'll use code:


$args = array(
    'title' => 'Car Search View'
);
echo render_view( $args );

> And how can I display my results page?

- How each listing is shown in the view's results can be controlled by the "Template" part in the view.
( screenshot: hidden link )

I couldn't see any listing example on your website ( hidden link ), but if you have a specific format/design in mind to show them, please open a new ticket and share more details (and a screenshot if possible) around how you'd like your results to show and we'll be able to guide accordingly.

regards,
Waqar

#1135666

Hi

Thank you for the update.

Here's the progress so far.

Duplicator site deployed.

Toolset settings exported and imported onto target site: motofind.co.uk

View created to match settings you used on example site.

I tried adding the code to the template page but it broke until it was removed.

$args = array(
'title' => 'Car Search View'
);
echo render_view( $args );

------------------

Conclusion:

Need to insert the filters on the homepage and redirect to the correct type of results too.

Example of results can be viewed here:

hidden link

Regards,

Robert

#1136050

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thanks for the update and glad you're making progress.

When you added the PHP code to show the view, was there any error/warning shown on the screen or in the server's error logs?

Can you please also share a screenshot of exactly in which file and location that code was inserted?

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.