Author Topic: Bug: Advanced Search by parameters: Currencies  (Read 2627 times)


  • Beginner
  • *
  • Posts: 4
Bug: Advanced Search by parameters: Currencies
« on: October 02, 2008, 18:03:14 pm »
Dear VirtueMart team, I discovered a bug in "Advanced Search by parameters" function. I use VM 1.1.2 running on Joomla 1.0.15.

Let me give an example.
I have 2 products in my shop:
ProductA: Price=250 USD
ProductB: Price=250 RUR (i.e. about 10 USD).
My site is configured to use USD only, i.e. a customer sees ProductA: 250 USD; ProductB: 10 USD
I ran Advanced search by parameters and type "Price >= 200", and VM gives me both products A and B, although I've expected to see only ProductA.

It will be great to see a solution for this bug.

Thank you in advance.


  • Beginner
  • *
  • Posts: 4
Re: Bug: Advanced Search by parameters: Currencies
« Reply #1 on: October 20, 2008, 17:37:52 pm »
Hello guys,
Does anybody use multiple currencies exept me?
I discovered one more bug. If I have two products of two different currencies than VM sorts them By Price without taking their "normalised" prices.


  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Bug: Advanced Search by parameters: Currencies
« Reply #2 on: October 20, 2008, 23:07:25 pm »
Is your currency in this list here:
         <Cube currency='USD' rate='1.3424'/>
         <Cube currency='JPY' rate='136.45'/>
         <Cube currency='BGN' rate='1.9558'/>
         <Cube currency='CZK' rate='24.986'/>
         <Cube currency='DKK' rate='7.4538'/>
         <Cube currency='EEK' rate='15.6466'/>
         <Cube currency='GBP' rate='0.77165'/>
         <Cube currency='HUF' rate='268.27'/>
         <Cube currency='LTL' rate='3.4528'/>
         <Cube currency='LVL' rate='0.7091'/>
         <Cube currency='PLN' rate='3.5766'/>
         <Cube currency='RON' rate='3.6545'/>
         <Cube currency='SEK' rate='9.9190'/>
         <Cube currency='SKK' rate='30.465'/>
         <Cube currency='CHF' rate='1.5299'/>
         <Cube currency='ISK' rate='305.00'/>
         <Cube currency='NOK' rate='8.7870'/>
         <Cube currency='HRK' rate='7.1792'/>
         <Cube currency='RUB' rate='35.2765'/>
         <Cube currency='TRY' rate='2.0331'/>
         <Cube currency='AUD' rate='1.9360'/>
         <Cube currency='BRL' rate='2.8329'/>
         <Cube currency='CAD' rate='1.5900'/>
         <Cube currency='CNY' rate='9.1685'/>
         <Cube currency='HKD' rate='10.4133'/>
         <Cube currency='IDR' rate='13215.93'/>
         <Cube currency='KRW' rate='1768.61'/>
         <Cube currency='MXN' rate='17.1693'/>
         <Cube currency='MYR' rate='4.7279'/>
         <Cube currency='NZD' rate='2.1790'/>
         <Cube currency='PHP' rate='64.300'/>
         <Cube currency='SGD' rate='1.9853'/>
         <Cube currency='THB' rate='46.017'/>
         <Cube currency='ZAR' rate='13.5213'/>
If not, you should add it (please check European Central Bank if it "supports" your currency) and then check configuration regarding accepted currencies.


Erik P

  • Jr. Member
  • **
  • Posts: 114
Re: Bug: Advanced Search by parameters: Currencies
« Reply #3 on: October 22, 2008, 13:13:33 pm »
IMHO, the bug reported here, is really a bug.

The price as the shopper sees it, produced by the script classes/ps_product.show_price(productid), depends on:

-shopper group
-attribute chosen

The advanced search uses html/shop_browse_queries.php, which does take into account the shopper group, but nothing else, and simply operates on the #__{vm}_product_price.product_price field:

ISNULL(product_price) OR product_price".$comp.$get_item_value.

If there is no product price associated with the product, the product will by default show up in the search results. I am not completely sure if that is the way it should be ...

To sum it up, the advanced search will only work if taxrate=0, the display currency is the same as the one in which the price is expressed in #__{vm}_product_price, there are no applicable discounts, and if a particular product attribute does not force the product in/out of the search results.

It may also simply select the wrong record, because it should insist that price_quantity_start=0 or 1. The biggest problems, however, are related to not looking at currency and discount.

Searching by price is "not that simple", given all the possible factors that go into calculating the price. In my impression, adding a few clauses to the sql constructed in html/shop_browse_queries.php, is overly simplistic. Software services. Customizing and fixing Virtuemart installations.