News:

Support the VirtueMart project and become a member

Main Menu

How to add price range in advanced search?

Started by rupesh, February 03, 2012, 12:09:21 PM

Previous topic - Next topic

rupesh

VirtueMart 2.0
Joomla 1.7

I am in the process of implementing virtuemart - I want to include in the advanced search functionality price search ie if a client want search for items price range xx - yy.
Pls assist on what i need to adjust in the any other file. I have tried adjusting as per below and its not working.

$db =& JFactory::getDBO();

$query ='SELECT pr.virtuemart_product_id ,PE.product_name ,PE.product_s_desc ,pr.product_price FROM #__virtuemart_product_prices AS pr ';
$query.='LEFT JOIN  #__virtuemart_products_en_gb as PE on pr.`virtuemart_product_id` = PE.`virtuemart_product_id` ';
$query .='WHERE pr.product_price <50 ';
$query .= 'ORDER BY PE.product_name ';
//var_dump($query);

   
$db->setQuery($query);
$rows = $db->loadObjectList();
         
var_dump($rows);
die;
how to fetch values for product price i.e xx-yy , i think we have to used <form>

Thanks
rupesh

rupesh

any body idea !!

i'm attaching the extended price range module for J1.5 and vm less than 2.0 ! so what i want is same module for VM2 and joomla 1.7 :'(?


thanks
rupesh.

[attachment cleanup by admin]

rupesh

after working on it finally i have devloped price range module for vm2 ! but still thinks that any thing is missing!
Please help if i'm missing anything!
Thanks,
rupesh

[attachment cleanup by admin]

rupesh

hi sir, i'm devloping a module for price range so i want to track a final price of the products but when i saw into the database table jos_virtuemart_product_prices "
It is storing actual "cost price" instead of final price! So where does the final price for the product is stored in vm2 database?  :o

[attachment cleanup by admin]

MarcoDings

somewhere else i see the statement that the final price is NOT stored. Instead it is calculated "on demand".
afik this does not work out of the box and needs some caching mechanism to work.

balai

Yes the final price is calculated taking into consideration taxes, discounts and any other rule applied for a price, so the query need to be much more complex than just a between.

We will integrate the price filtering in the custom filters extension but it needs some time to finish and be stable

rupesh

Thanks for your reply sir!
But " where final price is  stored?" so that we can devlop a Price range module based on Final Price of the products!
and write queries taking consideration into Final Price of the products!
Thanking You,
rupesh

balai

If you want it only for your own use, you can write a query with some "OR" taking into consideration the price rules applied in your site.
e.g. When the user writes 50 you can subtract the 20% VAT and search for the base price.

If you intent to develop that for general use, you have to take into consideration every single thing that can define the final price, so the query becomes more complex and with much more "ORs"


rupesh

Thanks balai sir  for your reply !
I wrote this query which based on the product price :

$query ='SELECT pr.virtuemart_product_id ,PE.product_name ,PE.product_s_desc ,pr.product_price ,pm.virtuemart_media_id ,vm.file_url_thumb FROM #__virtuemart_product_prices AS pr ';
$query.='LEFT JOIN  #__virtuemart_products_en_gb as PE on pr.`virtuemart_product_id` = PE.`virtuemart_product_id` ';
$query.='LEFT JOIN  #__virtuemart_product_medias as pm on pr.`virtuemart_product_id` = pm.`virtuemart_media_id` ';
$query.='LEFT JOIN  #__virtuemart_medias as vm on pm.`virtuemart_media_id` = vm.`virtuemart_media_id` ';
$query .='WHERE pr.product_price > '.$_REQUEST['price_start'].' AND '.'pr.product_price < '.$_REQUEST['price_end'];

Can you plz modify this query so that it can consider Tax calculation ??
So the product is search based on price range including Tax and other rules also?

Thanks once again for your consideration!
Rupesh

lipes

Hi all. it's possible (or not) to call the Product Final Price.. ??

I am trying to find a way to add the very important Product Final Price in the Product List Column .. -> Administration page..
http://forum.virtuemart.net/index.php?topic=102281.0

Can someone help here, please ?!

Thanks!!


VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

balai

i think that at the start you have to take each product seperately and check which are the calculation rules applied to it. Getting the calculation rules for each product you can calculate the final price.

lipes

VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

lipes

rupesh: did you include the Products Price in Joomla advanced Search (com_search) ?!
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

rupesh

Quote from: lipes on May 10, 2012, 03:55:03 AM
rupesh: did you include the Products Price in Joomla advanced Search (com_search) ?!
hey lipes,
untill now i tried to developed a price range module but without considerations of  tax and calculations rule!
see this
http://flyingcollections.com/index.php/price-range

but i'm trying to modify it by taking into consideration tax and calculation rules in future
i'm attaching my module here !
see attachment

[attachment cleanup by admin]

abugroup

After install your module my page become blank other that ur input fields but not even search any result  :-[