How to set up the search comparison widget

There are two widgets in Price Comparison Pro – the standard ‘price comparison’ table that you can add through shortcodes on any page, or on each WooCommerce product detail page. With WooCommerce, that means you need to have each product added along with alternative URLs for each product to populate the price comparison table.

We created the search comparison widget to make things quicker and easier to get started. All you need to do is provide search URLs for your target affiliate sites and the widget will take care of the rest.

There is very little configuration required with the search comparison widget. For example, there is no need to configure CSS or xPath selectors because it’s quite easy to spot the search results on a search page and figure out where the prices and the images are.

What is a search URL

The search URLs required by the search comparison widget are any URL that is in your browser after you have performed a search on their site. Here are some examples for ‘BMW’:


Note: When generating your search URLs, it’s important you use keyword search. That’s the only type of search that the search comparison widget will work with.

For example, see the image below – don’t select the dropdowns for BMW and then expect search comparison to work, unless you are creating a search comparison widget specifically for BMWs and then you want keyword search within all the BMWs.

Search Comparison Page Options

The first step is to figure out what kind of search comparison you are going to create. Are you creating something that will search ALL of your target websites or are you creating something that only searches ‘dog toys’. This is important, because if – for example – you include a department store in your search results, then you should narrow your search results down to the dog toys category before performing your keyword search to generate your search URL.

With some sites, you will need to perform your keyword search first and then narrow the category to get the correct search URL.

Here’s an example from FoundThru of a site-wide search URL vs a dog-toys restricted search URL (I’m searching for ‘chicken’):


Dog-toy category specific:

Notice how the placement of the search keyword has altered slightly. Which search type you choose depends on your use-case – if you have a site specific to dog toys, it makes sense to use the 2nd version above, if your site allows users to search EVERYTHING from your target sites then the first version is what you need.

Once you have your search URL for your target sites, visit wp-admin -> Price Comparison Pro -> Search Comparison and set up your websites.

Configuring your websites for Search Comparison

The bare minimum you need are:

  • Website name
  • Search URL

We’ll cover the others later.

For the search URL, take the URLs you generated earlier and replace the text you searched for with the {productname}. So, using our two examples, they would become:


The search comparison widget automatically figures out if it needs to HTML encode the product name depending on whether it is in a parameter or in the URL.

The Website Name you choose is for your reference only – if you are creating multiple search widgets against a single site inside different categories, then you’ll have to create multiple entries for that site to configure each Search URL. Here’s how it looks when I add the site-wide and the dog-toy-specific search URLs for FoundThru.

Adding Search Comparison to a single page

This is your most likely starting point. The search comparison widget has a couple of display options – either full screen, similar to normal searches, or a ‘related products’ widget which can be automatically added to every product-detail page on your site. If it’s added to woocommerce pages, the product name for that product detail page is what will be used for the search.

The full page search shortcode takes this form:

[pcpro_searchcomparison websites=”name1,name2,name3…” display=”searchform” buttontext=”GO” placeholder=”Search…”]

You don’t have to pre-populate the productname – just leave that blank if you wish. So, our dog-toys search would be like this, just searching against 1 site:

[pcpro_searchcomparison websites=”foundthrudogtoys” display=”searchform” buttontext=”GO” placeholder=”Search…”]

So, then when I visit the page where I added this shortcode and search for ‘beef’ I get this page:

Note: The broken placeholder is where the icon for FoundThru would appear if I’d configured it. I’ll clean this up a little later.


Did this article answer your question?

Leave a Reply

Your email address will not be published. Required fields are marked *

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.