Skip to content
Bhav S. asked 2 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 2 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="https://www.amazon.co.uk/Blue-Yeti-USB-Microphone-Silver/dp/B002VA464S" 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 2 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 2 years ago

I logged in, I saw this in your CSS: https://i.imgur.com/OZB9inK.png

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 H. Staff replied 2 years ago

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

Dave Hilditch Staff answered 2 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).

https://i.imgur.com/jnt0qHN.png

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

https://i.imgur.com/YTb4XAz.png

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:

https://www.wpintense.com/knowledgebase/how-to-scrape-prices-from-html-attributes/

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

https://i.imgur.com/gigzRcX.png

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:

//meta[@itemprop="og:price:amount"]/@content

Dave H. Staff replied 2 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


CYBERFUNDAY 40% discount coupon extended to Friday 9th December + join our Discord community and read the rules for an extra 20% discount coupon.