Artur
June 29, 2020, 10:03pm
1
In Products => PriceLists (I have set to excl vat )
In Channel settings => Channel (I have display incl vat )
Default vat is 25%
No tax item is added to product
For a Product the price is set 2060:- (exl VAT )
Price for the product on page will display correctly 2575:-
When using Litium ProductSearchService it will hit
var priceTagName = _requestModelAccessor.RequestModel.Cart.IncludeVAT ? "-price-incl_vat" : "-price"; // True
var priceTagName = -price-incl_vat
So far so good.
But here comes the interesting part:
var searchResult = searchResponse.Hits
.Select(hit =>
{
var priceTags = hit.Tags
.Where(x => x.Name.EndsWith(priceTagName, StringComparison.OrdinalIgnoreCase))
.Select(x => x.OriginalValue)
.Cast<decimal>()
.DefaultIfEmpty(decimal.MinusOne)
.Min();
return new SortableSearchHit(hit) { Price = priceTags };
})
.ToList();
For the exact product above it will return:
price-incl_vat:000000000000000000002060
Am I assuming wrong here to expect price with VAT (2575)?
I have tried to rebuild product index from BO.
Double checked the price in BO (shows 2060 excl VAT)
Double checked the price in Products.PriceListItem table (shows 2060 excl VAT)
Litium version: 7.2.3
NilsN
July 2, 2020, 12:55pm
2
It sounds like you’re encountering this bug:
Price including VAT Lucene tag not set correctly if base product has no tax class link
This was resolved in Litium 7.3.
Does it work if you add an actual tax class to the base product?
Artur
July 2, 2020, 1:55pm
3
I’l test. Could have sworn that i was searching through the bug lists before posting.
One additional question here. Will it also contain products campaign prices or do we need own implementation?
NilsN
July 2, 2020, 2:10pm
4
In general, campaign prices are not indexed as standard. Campaign prices are calculated as needed.
There’s a scenario where it is though: if you’re using the fixed price action and the belongs-to-a-group condition. There’s a CampaignIndexingProviderPreProcessor
in the Accelerator.
Artur
July 2, 2020, 3:45pm
5
Reason for this is when we example want to search for products between x and y and then also sort the output (lowest price for example)
For this to work we would need as I see it index the campaign price using the PreProcessor and fetch on both and and then sort.
NilsN
July 6, 2020, 12:16pm
6
The challenge is if you’re using campaigns with conditions like order total exceeding X or similar. But if it’s an always-on price reduction with no conditions, it should work.
Just wanted to add that there’s a bug report about price sorting not taking campaign prices into account, so it’s on the product teams radar as well: https://docs.litium.com/support/bugs/bug_details?id=49201
system
Closed
August 3, 2020, 12:26pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.