VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: reddevil on July 27, 2012, 16:28:54 PM

Title: filter of products for virtuemart 2.0
Post by: reddevil on July 27, 2012, 16:28:54 PM
hi,

My site has pagination and if if it weren't, it wouldn't be problems.

I want to create filter by price.

In "/components/com_virtuemart/views/category/tmpl|default.php"

i wrote :"
<form method="post" >
<p>From: <input type="text" name="fromprice" /></p>
<p>To: <input type="text" name="toprice" /></p>
<p><input type="submit" /></p>
</form>
"

and now I don't know how to bind my result with pagination ((

i found the file where sql-query builds "/administrator/components/com_virtuemart/models|product.php"

but i don't know how to write my sql-query for filtering the price

i wrote "$where[] = ' `#__virtuemart_product_prices`.`product_price`= "777.00000" ';"

but it doesn't work

Please Help((
Title: Re: filter of products for virtuemart 2.0
Post by: balai on July 30, 2012, 09:48:29 AM
Hi

Its not very easy to create a reliable price filter.
The way you are trying to do it, it will retirn products based on the base price. And the price you enter in the filter will be different to the prices of the returned products (final prices).
You have to take care of the prices in multiple currencies, the price overrides and the shop's taxes.

There is already an extension which offers an advanced price filtering.
http://breakdesigns.net/extensions/custom-filters