You are here:  » Price comparison table only


Price comparison table only

Submitted by Fuzzy on Tue, 2015-02-10 03:54 in

A hopefully not to difficult question.

I am using Wordpress as the base and require only a comparison table instead of the standard pto search and the virtual integration that it brings.

My Wordpress setup.

Products are taxonomies and currently I have the pto product shortcode mapped to the taxonomy meta - for example lets say the Product is Xbox One.

pto search would bring in listings fine.

pto product would bring in nothing as there is no product named Xbox One - there are products with the terms "xbox one" in it however, i.e "Xbox One Pro Pack".

This is probably due to pto product requiring an exact match in order to display anything.

Is it possible to relax this in order to bring in results that include the term "Xbox one" not just those terms? The full term of the product will need to be matched however.

Am I going about this the right way or would you suggest a better way of achieving this?

Submitted by support on Tue, 2015-02-10 09:03

Hello Fuzzy,

Sure - it sounds like you should just be able to use the prices shortcode, e.g.

[pto prices="Product Name"]

Now, if your product pages are being created by a standard template, and the page title matches the product name exactly, there is a very simple mod that can make the shortcodes use the page title as the product name.

If you want to give this a go, edit pto.php and look for the following code at line 404:

  switch($k)

...and REPLACE with:

  $v = str_replace("%THE_TITLE%",the_title("","",FALSE),$v);
  switch($k)

With that in place, all your product posts require is

[pto prices="%THE_TITLE%"]

If your product page titles don't match exactly the product names in your Price Tapestry database you can always use Product Mapping to rename them easily.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Fuzzy on Wed, 2015-02-11 13:14

Thanks for that David.

I actually did exactly what you suggested but by using a variable in my wordpress taxonomy template i.e echo do_shortcode('[pto prices="'.$current_prod.'"]') which also works great.

I mapped the products as suggested and got them to show as you can see here: {link saved}

Both results are from 2 different feeds - the only ones I have set up this far.

The only other thing I need to do is show more than 1 product from each merchant and it should be good to go - possibly with this sort of layout if feasible (not sure if this table code will display):

<table class="table table-striped">
<thead>
<tr>
<th>MERCHANT</th>
<th>PRODUCT NAME</th>
<th>PRICE</th>
<th>VISIT</th>
</tr>
</thead>
<tbody>
<tr>
<td>Shop1</td>
<td>A Game for PS4</td>
<td>$44</td>
<td>Visit</td>
</tr>
<tr>
<td></td>
<td>A Game for XBOX1</td>
<td>$43</td>
<td>Visit</td>
</tr>
<tr>
<td>Shop2</td>
<td>A Game for PS4</td>
<td>$44</td>
<td>Visit</td>
</tr>
</tbody>
</table>

Submitted by support on Wed, 2015-02-11 13:30

Hi Fuzzy,

If you have mapped different formats of the same game to the same Product Name using Product Mapping e.g. Master Product Name:

Game Name

... and Alternatives:

=Game Name PS4
=Game Name XBOX1

...where both happen to be from the same merchant, then, as you may be seeing only the first instance will be imported because Merchant + Product Name must be unique within the Price Tapestry products table.

Removing the duplicate prevention on the Price Tapestry can be done simply by dropping the dupe_filter key on the pt_products table. The following dbmod.php script will achieve this - run once from your Price Tapestry installation folder, delete the file from your server, and then re-import all feeds:

<?php
  
require("includes/common.php");
  
$sql "DROP INDEX dupe_filter ON `".$config_databaseTablePrefix."products`";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Fuzzy on Wed, 2015-02-11 13:58

Works great, exactly the format I was after - so much faster than any wordpress powered solution.

Submitted by Fuzzy on Fri, 2016-02-19 07:50

Last question on this topic though not sure how to do it with the above current setup - if it is even possible.

My current wordpress template assigns the above altered pto price table as my bootstrap powered price tracker dropdown.

Example here: {link saved}

Under Community Submissions I would also like to add Ebay listings as a separate entity - possibly even Amazon though I am not sure if this would even be possible.

The pto prices shortcode doesn't bring in ebay listings at all and pto search doesn't appear to be filterable by merchant if they require the ebay or amazon api.

Hope this makes sense.

Cheers.

Submitted by support on Sat, 2016-02-20 10:04

Hi Fuzzy,

It's straight forward to add a shortcode specifically for pulling in the results from the specified API module. To have a go at this, edit pto.php and look for the following code at line 450:

        case "search":

...and REPLACE with:

        case "api":
          $parts = explode(":",$v);
          $api = $parts[0];
          $pto_q = $parts[1];
          $html .= pto_api($api);
          break;
        case "search":

With that in place, in your product pages you can pull in API results as follows;

for Amazon;

[pto api="amazon:Product Name"]

and for eBay;

[pto api="ebay:Product Name"]

Dynamically create the "Product Name" part exactly as you are doing so in;

[pto prices="Product Name"]

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Fuzzy on Thu, 2016-02-25 00:47

Fantastic!

Thanks again David.