Try our conversational search powered by Generative AI!

Faceted PriceRange filtering issue / Currency issue

Vote:
 

Hi,


I'm trying to filter items from my catalog using facets and PriceRangeValue, like in the Enoteca example (my searching engine is Lucene). Should I create a "listprice" meta field in the Commerce Manager like I did for other filters? My other filters (SimpleValue) are properly working but I had to create meta fileds for them (and of course assign them values).

My second issue is that the currency of my products display prices are stuck to "gbp", even if the user I am loged in has a different Preferred Currency (in the Commerce Manager » Customer Management). I also set the Default Currency to another one in the Commerce Manager » Administration » Common Settings. To gather the price of one item I used the "CurrentPrice = entry.ItemAttributes.ListPrice.FormattedPrice" attribute. Am I missing something?


Thanks!

#64003
Dec 06, 2012 16:44
Vote:
 

You can add "listprice" metafield,however by default, the listprice has been indexed as "listpriceusd" field ( with gbp it should be "listpricegbp",... ) in your search index data.

 

 

Regarding the second issue, could you try CurrencyFormatter.FormatCurrency(entry.ItemAttributes.ListPrice, "USD").

#64131
Dec 11, 2012 11:39
Vote:
 

Thanks for your answer. I can not use CurrencyFormatter.FormatCurrency(entry.ItemAttributes.ListPrice, "USD") as first argument must be a decimal, ListPrice is a Price object. If I use ListPrice.FormatedPrice I have a price in £.

For the facets I'm trying to filter by accessing to the already existing metadata "Display Price", how to "bind" this field to my config file and change this currency? (cf. http://img15.hostingpics.net/pics/387071Untitled.png)

I edited my Mediachase.Search.Filters.config file like that:

<SearchConfig version="1.0">
  <SearchFilters>
    <Filter field="listpriceusd">
      <Descriptions defaultLocale="en-us">
        <Description locale="en-us">Price</Description>
      </Descriptions>
      <Values>
        <PriceRangeValue key="under-5" currency="usd" upperbound="5">
          <Descriptions defaultLocale="en-us">
            <Description locale="en-us">Up to $5</Description>
          </Descriptions>
        </PriceRangeValue>
        <PriceRangeValue ke... and so on

Regards

 

#64168
Edited, Dec 11, 2012 22:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.