You are here:  » Reversing The Price Comparison

Support Forum



Reversing The Price Comparison

Submitted by Tricky1 on Thu, 2010-07-22 19:32 in

Hi

The site I'm currently working on requires the 'best price' to be the highest available, can somebody please point me in the right direction to change this, thanks for your help....

Richard

Submitted by support on Thu, 2010-07-22 19:49

Hi Richard,

I know you've been a Price Tapestry user for some time now - is your new site based on the original, or latest distribution (11/09A)?

The code changes are straight forward, but the subtleties vary depending on the version you're running for this site - if you can let me know I'll advise the changes to make...

Cheers,
David.

Submitted by Tricky1 on Fri, 2010-07-23 06:15

Hi David and thanks for getting back to me...

Please assume I am using the latest version as I'm in the early stages of developing the site and would prefer to upgrade, if I could only find how to.

Cheers

Richard

Submitted by support on Fri, 2010-07-23 07:43

Hi Richard,

You can always download the latest version; if you've lost your registration code drop me an email and I'll resend it for you.

Regarding reversing the comparison; firstly in products.php, look for the following within the SQL statement on line 12:

ORDER BY price

...and REPLACE with

ORDER BY price DESC

Other than that; to reverse the sense elsewhere in the script (Featured Products, Search Results and Related Products), perform a Search and Replace of

MIN( price ) AS minPrice, MAX( price ) AS maxPrice

with:

MIN( price ) AS maxPrice, MAX( price ) AS minPrice

in the following files:

products.php
search.php
index.php

That should be all there is to it!

Cheers,
David.

Submitted by Tricky1 on Mon, 2010-07-26 08:40

Thanks David, worked a treat...

Richard