If you use UC VAT module to show all prices with a VAT, the value saved in database is without the VAT and it is added on display.
For example, you save a product with a price of 100 and vat 20%, it saves 80. User sees 100.
But because this is in database, apachesolr_ubercart ndexes the price without the VAT, making price facet unusable - user sees a product with a price of 100 in a result filtering 20-85 for example.
apachesolr_ubercart should check if there is a VAT module. I can produce a patch but the question is - should we alter the price during index phase (index with a VAT) or during search phase (construct a facet title "price from 50-150" with a real values "price [40 TO 80]" ?)
Comments
Comment #1
meba commentedMaybe we should generalize a bit with price handlers...
Comment #2
meba commentedWhich leads to obvious - alteration should happen during search result phase.
Comment #3
meba commentedFound out that it's impossible to do (or not easy/not-hackish) this during search - we simply don't have all the required information available in 'facet_fields'.
Attaching a patch that does uc_price alteration during indexing phase. Might need update function to force reindexing of products, new file apachesolr_ubercart.install:
Comment #4
nick_vhHmm interesting issue,
Thank you for creating the patch, i'm going to add it after some testing!
Comment #5
nick_vhTested and commited and added to the latest release
Comment #7
nick_vhFixed and closed