Hi, Is it possible to create categories and sub categories in PT
Example:
main category Leads and Collars
Sub category: Leather leads
We also want to show Voucher Codes in a similar way to voucher codes sites with a click to reveal code and open site message, is this something PT are planning to do?
Thanks in advance
Thanks again for your fantastic, speedy response. We'll give it a go and let you know the results. Love PT...!
Hi David
It's Jasons business partner Stuart, nice to meet you.
The code you provided for "click to reveal" above works great, what would I need to add to click to reveal and open the retailer site in new window at the same time, the same as it does on sites like {link saved}
Sorry I am not technical but can maange to copy and paste code in the right place, which I did with the above
{link saved}
Regards
Stuart
Hi Stuart,
The easiest way to make buy now links open in a new window is to look for the following code beginning at line 67 of includes/tapestry.php:
if ($config_useRewrite)
{
return $config_baseHREF."review/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";
}
else
{
return $config_baseHREF."reviews.php?q=".urlencode($product["normalised_name"]);
}
...and REPLACE with:
if ($config_useRewrite)
{
$retval = $config_baseHREF."review/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";
}
else
{
$retval = $config_baseHREF."reviews.php?q=".urlencode($product["normalised_name"]);
}
return $retval." target='_BLANK";
Cheers,
David.
--
PriceTapestry.com
Hi David
Sorry not sure I explained it correctly, we now have a "click to reveal code" which works great and a seperate link for "Vist Store" - what we really want is to have the store open when the "click to reveal code" link is clicked.
Also last night I possted seperate question about having voucher codes and offers with click to reveal on seperate pages to the price comparison, so the answer might be 2 fold form your side?
Thanks again
Stuart
Hi Stuart,
I replied to your other thread a little earlier here, if you want to add links or other JavaScript to the content of the div that is initially hidden but then revealed and need access to the buy URL it can be retrieved using tapestry_buyURL($product)
so to render within a link (new window) use:
<a href='<?php print tapestry_buyURL($product); ?>'>Link Text</a>
Cheers,
David.
--
PriceTapestry.com
I just wanted to add some comments regarding subcategories that you might want to consider. I believe David's approach is good but you need to be prepared in the event you plan on having a lot of feeds, lots of base categories, and using voucher codes. I would say the big downside is that conducting a search across all the installations will require a lot of work on your part. David does have some code to get you started, but presenting meaningful search results across all those installations will be the crux.
Here are some suggestions if you go the multiple installation route.
1. Fully understand every feed you plan on using. Each merchant does things differently, even from the same affiliate provider.
I would start with a single installation. Modify the PT feed fields in advanced.config to include how deep your category structure goes in your feed (ex Category, SubCategory, Product Group). Import all the feeds you plan on using. Run a distinct query on all the category structure for each merchant to understand their hierarchy. Drop that data into a spreadsheet and start planning your implementation. The more feeds you have, especially if they have a lot of products, will exponentially make this harder.
I don't want to discourage you but you need to be prepared.
2. Use git to deploy and change your code over time. If you plan on changing your code over time you must learn how to push code, it will make your life much easier. You don't want to be copying a file change to 10 different installations. I recommend Peepcode Git screencast to learn.
3. Learn MySQL at all costs if you don't already. Two great books are Learning MySQL by Tahaghoghi and MySQL by Dubois.
4. If you have a lot of feeds and installations, voucher codes can be a frustrating process. Best thing to do here is have a dedicated installation you do this in, and then copy the table data across your other installations. If all you installation tables are in the same database this could be done fairly easily with a script that would run after you add/remove/change a voucher code to propagate the changes. I think you could also modify the voucher php to work off of one table, not entirely sure.
Lastly, I would consider where your traffic is coming from and what you are trying to accomplish. For us, a lot of traffic is coming from Google to a specific product page and they are looking for a review. Even internal traffic people know what they are looking for, so sub category structure is really irrelevant. Most people are not searching through subcategories trying to find something, most know already and are trying to find info to solidify their buying decision. Again, it depends on who you are catering too, but I think it's an important thing to consider because you want to spend your time on what matters. For us it will be optimizing our landing pages for conversions and getting people to post reviews.
Cheers, Jon
$> cd /pub
$> more beer
Hi Jon,
Thanks for that!
Cheers,
David.
--
PriceTapestry.com
I have managed to do a multiple installation of price tapestry complete with categories / subcategories and site wide search.
I went down the route of basing my site categories / subcategories exactly the same as Affiliate Windows. I set up categories / subcategories in a mySQL database which directs traffic to the relevant installation of PT. The various installations of PT are hard coded into specific directories I.e. Appliance Spares and Cooking would be 2 separate subfolders of the Appliances folder. Hope I'm making sense here!!! This is one installation of PT ({link saved}) and this is another ({link saved}). At the moment there are 21 individual installations of PT running which cover appliance, clothing and computers. This makes the individual databases quite small so the response time are quick (or at least should be). The only down side is that global filter don't work so each site has to be individually maintained. I'll find a way around that hopefully.
To do the main search I use Affiliate Windows API to get the search results and then using some coding direct the specific product to the relevant category with my site. E.g. => {link saved}
I am still integrating the search results section of the site so at the moment not all categories are searchable. There are also a few other things to be completed like reviews.
I would appreciate any comments / suggestions.
Thanks,
Simon
Hi Simon,
Sounds good!
Assuming that you have resolved the databases only by $config_databaseTablePrefix, it would be straight forward to maintain Global Filters within a single installation and have all others load Global Filters from that one.
To try this, look for the following code beginning at line 431 in includes/admin.php
$sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."' OR filename='' ORDER BY filename,created";
if (database_querySelect($sql,$rows))
...and REPLACE with:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."'";
database_querySelect($sql,$rows1);
$sql = "SELECT * FROM `main_filters` WHERE filename=''";
database_querySelect($sql,$rows2);
$rows = array_merge($rows1,$rows2);
if (count($rows))
...where main_ is the $config_databaseTablePrefix of the installation in which you wish to maintain Global Filters. Don't forget to apply the patch to all installations of course!
Cheers,
David.
--
PriceTapestry.com
Hi David,
As per your suggestion, I am setting up global filters across all my installations. I think the above code has a few typos, can you please confirm for me that it should be like this.
$sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."';
database_querySelect($sql,$rows1);
$sql = "SELECT * FROM `".$config_databaseTablePrefix."main_filters` WHERE filename='".database_safe($admin_importFeed["filename"])."';
database_querySelect($sql,$rows2);
$rows = array_merge($rows1,$rows2);
if (count($rows))
Thanks,
Simon
Hi Simon,
Please try;
$sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."'";
database_querySelect($sql,$rows1);
$sql = "SELECT * FROM `".$config_databaseTablePrefix."main_filters` WHERE filename='".database_safe($admin_importFeed["filename"])."'";
database_querySelect($sql,$rows2);
$rows = array_merge($rows1,$rows2);
if (count($rows))
Cheers,
David.
--
PriceTapestry.com
Hi Jason,
I just followed up to your other post re: categories. Note also that several users have implemented the multiple-installation route for creating a category hierarchy. It's not so much work as it sounds; the latest version allows you to share a common /feeds/ folder; and then it is a case of registering in a particular category installation feeds that are wholly appropriate to that category; and for feeds that cross multiple categories you can then register in each appropriate installation with an associate "Drop Record If Not RegExp" filter to import only the categories required from that feed.
Implementing a "Click to reveal" over the voucher codes should be reasonably straight forward with a little dynamic HTML if you'd like to give that a go. In html/prices.php you'll find the code where the voucher code is displayed at line 14:
<?php if ($product["voucher_code"]) print "<br /><small><nobr>".translate("using voucher code")." <strong>".$product["voucher_code"]."</strong></nobr></small>"; ?>
Try REPLACEing with:
<?php if ($product["voucher_code"]): ?>
<br /><strong>
<span
id='rc<?php print $product["id"]; ?>'
style='colour:blue;cursor:pointer;'
onclick='javascript:
document.getElementById("rc<?php print $product["id"]; ?>").style.display = "none";
document.getElementById("vc<?php print $product["id"]; ?>").style.display = "inline";
'>
Click To Reveal Voucher Code
</span>
<span id='vc<?php print $product["id"]; ?>' style='display:none;'>
<?php print $product["voucher_code"]; ?>
</span>
</strong>
<?php endif; ?>
...should be close...!
Cheers,
David.
--
PriceTapestry.com