Price comparison pro

Bhav S. asked 3 years ago

Not sure how to set this plugin up tried, but not working as expected no idea where to start

3 Answers
Dave Hilditch Staff answered 3 years ago

What have you tried so far?

At it’s most basic, you should be able to create a comparison table on any page by adding this shortcode:

[pricecomparisonpro urls="" displaystyle="panel"]

With the above, you can list multiple URLs separated by commas, and if you want to get paid you can add the affiliateurls parameter and list the affiliate URLs per each product.

If you’re integrating into WooCommerce then you need to add the external and affiliate URLs to each product – either manually or using your import job.

Bhav S. answered 3 years ago

Hi hi I’ve tried what you said and all I get is the pound symbol the price is not displaying. Is there any way you can check just see if I have configured the plug-in properly for it to work.

Dave H. Staff replied 3 years ago

The example you sent me, it looks like it’s correctly grabbing the price but that’s from rather than currys – do you have the currys example you said wasn’t working?

Dave H. Staff replied 3 years ago

I logged in, I saw this in your CSS:

The CSS selector should just be what I said, the # at the beginning means CSS ID whereas the . at the beginning would correctly identify the element based on the CSS class.

Dave Hilditch Staff answered 3 years ago

Ok – here’s the answer for your curry’s example.

Firstly, I visited the example you’d set up, then opened the JavaScript console (F12 or CTRL+SHIFT+I).

I can see straight away that Currys has some anti-scraping CSS in place. See this image:

I had a look at the source code for the page, and at least Currys are nice enough to leave a meta value containing the price. See this article for a guide to scraping those kinds of prices:

In this case with Currys there are 2 meta values we could grab the price from:

So using this XPATH Selector (Note: You need to choose the dropdown to switch this site from CSS to xPath for this to work in pcpro settings) you’ll be able to grab the price:


Dave H. Staff replied 3 years ago

Alternatively, curry’s are changing the HTML on page load, if you view source you’ll see better CSS classes you can use. I found this for regular price for currys:

#product-actions .prd-past-amounts span[data-key=”was-price”], #product-actions .prd-amounts .current

(note there are 2 selectors in there since the regular price will change CSS selectors if there is a sale happening)

and then for sale price you can just use:

#product-actions .prd-amounts .current

Your Answer

Super Speedy Plugins