Hi everyone,
I'm pleased to announce that the new distribution, designated 12/10A is now out of beta and is the main download of Price Tapestry available from here.
This is the version now running on the demo site:
The main addition of course is support for discount voucher codes (documentation), enabling you to apply merchant coupon code discounts to price comparison results in real time. The distribution also includes merchant logo support, search performance improvements and a small but significant feature to ensure that page titles are unique across all search result pages.
David
--
PriceTapestry.com
Hi David
What's the best way of updating to this new version? I've done a lot of mods described on this forum within files so if i did a clean install, it would mean finding all the modified code and tbh, i cant remember what the heck i've put where. :D
Do you have a list of what files have been changed in this new release?
Thanks
Hi Keeop/bat,
Thanks for the comments - I'm going to put together a patch and instructions for merging voucher codes and merchant logo support into an existing site - will get that online ASAP for you...
Cheers,
David.
--
PriceTapestry.com
Hi David,
Brilliant, thanks!
They're indeed the main new features but what about the search search speed improvements and unique titles? Are all the search improvements only found in search.php, if so I can sort that one out myself I reckon? Is the title stuff easy to add too? Are there any other little 'tweaks' that we need to get hold of? On the subject of the new search technique, is it the 'SQL_CALC_FOUND_ROWS' that is speeding things up?
Thanks for your help.
Cheers.
Keeop
Hi Keeop,
Yes - SQL_CALC_FOUND_ROWS is the key to the search results speed improvements. It instructs MySQL to calculate the total number of results that would have been returned without the WHERE clause, which can then be obtained by the SELECT FOUND_ROWS() query immediately afterwards. I've posted backport instructions for this and the unique search result page titles in the following threads...
Unique search result page titles
Search result performance improvements
Cheers,
David.
--
PriceTapestry.com
Thanks David, will give this a go.
Cheers.
Keeop
I'd like to offer a few suggestions to people which I think could be considered best practices.
First, I think learning how to use a SCM like Git is really important for keeping track and documenting changes done on your PT installation. Git is one way to reinstall all of your customizations onto a base install of PT that has been upgraded. We are using Git to track changes and push them to our server. There is documentation all over the web on how to install Git on your computer and server, if you are on OS X you already have a version.
I really cannot recommend this screencast on Git enough.
http://peepcode.com/products/git
Second, since you likely aren't already using Git, if you are on OS X I recommend installing XCode if you haven't already and use FileMerge to identify all the changes made to your codebase. There are similar tools available for windows. There are two ways you can do this. The first one is to use the old PT codebase versus your modified code to identify all the changes, and then make those changes to the new PT codebase in your editor. Another way that is slightly more complicated, is to do a codebase compare with your current modified code versus the new PT codebase and merge the changes. I think the first method is likely the more recommended method.
Hope this helps!
Cheers, Jon
$> cd /pub
$> more beer
Hey Jon,
Source control and documentation are indeed a good idea, but it all depends on the project. I have mainly used MS Visual Source Safe in the past and this is great for modular applications and documentation. However, due to the nature of PT I'm not sure if it's quite so viable an approach.
I have lots, and I mean lots, of PT based sites. The first one dating back to PT inception back in 2006. Now I know that the PT script tries to separate out application from presentation, but unless you're using templates or a template engine, such as Smarty, this is never going to realistically happen if you want a good-looking and functional web site. Therefore, with a version upgrade or a mod install, it's not simply a case of overwriting old code with new and using a file compare tool will only get you so far if you need to start digging down in to nested loops to make all the necessary changes.
For instance, the new search functionality. This is great and with a vanilla site you could pretty much just cut and paste. But, let's see, the generic search.php is 12Kb. My latest search.php in my latest project is 19Kb and I have a further search customisation file coming in at 35Kb - there are a lot of extras in these files! This means that no source control or file compare utility is going to help me here - I need to understand the changes and implement them across my code base.
This is where David's expertise comes in. Being the extremely helpful chap he is and thanks to some of the best support I've come across, David can take your customised files, weed out the bits that need changing, and change them, should you require this level of help. Publishing these new 'how-to' guides is also an excellent way of helping users with heavily modded installs, and I hope he can continue to do this where possible.
I personally rely on good (sometimes!) commenting in my PHP scripts and a changelog document to keep track of all the changes I have made, or need to make, across my array of sites. Again, because they are all customised in different ways to suit the niche, rolling out a new mod is not just a case of cutting and pasting code. Of course, this is certainly an area that I am looking in to more and will maybe try and take a more modular approach with new sites and look at implementing a template engine to keep the code separate from the design, but this will need more learning time on my behalf, so I'm not sure if or when that may happen.
I guess what it boils down to is that everyone does things differently and I think this will always be the case with something like PT as it currently stands. The only way to simplify things would be to either go down the template engine route or create something more akin to Wordpress where mods can be installed/removed with a click and the main 'engine' can be updated likewise. Until this happens(!), we're all extremely grateful for David's help and support with regards to PT updates and our existing installations.
Cheers.
Keeop
Thanks for your thoughts and comments, Jon and Keeop.
Cheers,
David.
--
PriceTapestry.com
Hi David. Thank you, i've implemented the search code from the new release. Will you be doing similar threads for the voucher code and merchant logo aspects?
Thanks
Hi bat,
Sure - they're a little more involved but will get them online shortly...
Cheers,
David.
--
PriceTapestry.com
The voucher code addition looks very useful but there are a few things that would be helpful to cover some special situations:
- The ability to list multiple coupons for a single merchant. Don't calculate any into the price, just list them all. (Shoppers may be looking for more than 1 item in which case they may be able to meet a higher minimum spend and get a better coupon.)
- The ability to add coupons without a voucher code. (Some coupons are automatic.)
- The ability to add a URL for a coupon. (Some merchants don't have a voucher code but instead require you to click a special link to activate a coupon.)
Would these things be possible to implement?
Thanks.
Hi biglion,
Thanks for the comments - I'm collating feedback now that more users are working with the voucher codes feature so I'll review the functionality in light of yours and other comments.
Cheers,
David.
--
PriceTapestry.com
Hello,
When I download the script. I tried to download the script in the download area that has the merchant logo's and vouchers. For some reason it only downloads the previous version.
Revision 11/09A
How do I download this?
Thank you
Hi David,
I've been able to successfully transfer all my modifications to the new PT distribution. Do you have a script available that will update a database with the new tables and fields?
$> cd /pub
$> more beer
Hi Mike,
Make sure you're downloading from this page, and also make sure to overwrite the file as it will have the same filename for you regardless of version...
cascadeclimbers,
Sure - i've just emailed you a dbmod script to upgrade the database from 11/09A to 12/10A.
Cheers,
David.
--
PriceTapestry.com
Quick question , regarding the voucher function , i want to display the voucher and the voucher details but dont want the price changed to reflect the voucher
is there an option to do this?
Hi Jonny,
Sure - to prevent the price being adjusted, look for the following code at line 235 of includes/tapestry.php:
$products[$k]["price"] = $product["discount_price"];
...and either comment out or delete that line.
In conjunction with this, you may want to change the text associated with the voucher codes in html/product.php and html/prices.php. Edit these files, and in place of "Using voucher code", maybe change that to something "Discount code available: " for example...
Cheers,
David.
--
PriceTapestry.com
Hi David,
Should I be able to pull merchant logos through to my external Wordpress site or do I need to make some modifications?
I have looked at the source code and no images are being brought in using external.php.
Cheers,
Hamish
Hi Hamish,
It will be the file_exists() code in html/prices.php not looking at the correct location when being called externally. In that file, look for the following code wihtin line 11:
file_exists("logos/".$product["merchant"])
...and REPLACE that with:
file_exists($external_path."logos/".$product["merchant"])
That should do the trick!
Cheers,
David.
--
PriceTapestry.com
Hi David,
That's it, thanks for your help.
Kind ones,
Hamish
Hi David
Thanks for the new release.
I am trying to incorporate my previous url mods to make them lower case
http://www.pricetapestry.com/node/3239
and also trying to see if the category in product url would work as in
http://www.pricetapestry.com/node/3495.
Am I right in thinking you have simplified when and where the product urls are written and by changing tapestry.php, that sorts most of it out compared to the old release where you have to go to search, search results etc ?
Thanks
Ben
Hi Ben,
That's correct - previously wherever product page links were generated there had to be an IF statement based on whether .htaccess/Clean URLs were in use.
This has been replaced by the single tapestry_productHREF() function in includes/tapestry.php that generates the correct URL, which also makes it much easier for non-English language site users to change /product/ to their own language.
Cheers,
David.
--
PriceTapestry.com
Hi David, I would like to know if there is an easy way to upgrade from 11/09A to 12/10A.
You mentioned a while ago, something about a patch you were going to create to do this.
My site has only a few modifications to it, but I can't remember what or where.
Thanks for your excellent support.
best regards
David S S
Hi David,
I can "upgrade" a site manually pretty quickly - if you could .zip together the following from your site and email me the file I'll back port the voucher codes, merchant logos and global filter mods for you..
admin/admin_menu.php
html/atoz.php
html/prices.php
html/product.php
includes/admin.php
includes/tapestry.php
config.php
congig.advanced.php
products.php
merchants.php
Cheers,
David.
--
PriceTapestry.com
Great news David!
It looks like I'm the first one to ask how best to update an existing and heavily customised PT site? Can this be documented in the forums or is it an 'email the files' job? Think you might be a tad busy over the coming weeks with update requests!
Cheers.
Keeop