KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: barcode on October 06, 2010, 04:04:14 pm

Title: Sorting products by price including tax
Post by: barcode on October 06, 2010, 04:04:14 pm
Hi there,

I just tried to get my products sorted by price incl the tax but found no way to do that.

String sortByPrice = DataDescConstants.ORDER_BY_PRICE_ASCENDING;
dataDescriptor.setOrderBy(sortByPrice);

Only gives me ordered products without the tax but I use different tax classes for products which
leads to badly sorted products showing the price including the taxes.

Is there a switch I missed or does KK simply don't support this scenario?

Thanks for help.
Title: Re: Sorting products by price including tax
Post by: trevor on October 06, 2010, 07:48:12 pm
It uses the price within the database to do the sort, since databases are efficient at sorting products. Normally this isn't a problem because customers tend to sort by price once they have narrowed down the type of product they are searching for, so the same tax class is used for these products. I can think of two ways to solve your problem.




Title: Re: Sorting products by price including tax
Post by: barcode on October 12, 2010, 12:29:20 pm
Allright, I implemented the first way, works so far but my heart bleeds because of the performance lost...

Would be nice to see if the next KK version has support for sorting prices inluding the tax.

To way 2: I feared that I miss to update the COSTUM1 field somewhere and show a wrong price to the customer, a catastrophe for a shop in my opinion.

So far.

Barcode
Title: Re: Sorting products by price including tax
Post by: trevor on October 12, 2010, 12:49:19 pm
Regarding 2, you should only uses the custom field to sort the prices. The prices displayed would still come from the same place. In this way if you make a mistake, the worst thing that can happen is that the sort is wrong.