Author Topic: Products filters  (Read 5195 times)

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Products filters
« on: July 16, 2013, 15:33:48 pm »

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products filters
« Reply #1 on: July 16, 2013, 16:02:45 pm »
Is native there and there is also a trigger that you can use your own search plugin. and it is there since November 2010 or so.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Re: Products filters
« Reply #2 on: July 16, 2013, 16:34:23 pm »
offtop
How this problem can be solved in virtuemart?

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1398
Re: Products filters
« Reply #3 on: July 16, 2013, 17:05:50 pm »

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Re: Products filters
« Reply #4 on: July 16, 2013, 17:30:55 pm »
Why don't you try one of the existing filtering extensions
http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search
Why pay for something you can do yourself? :)
PS. for this money I can buy Hika Buisnes)

offtop
What simplest method to organize the filter at the price?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products filters
« Reply #5 on: July 16, 2013, 18:10:53 pm »
http://virtuext.com/de/herunterladen/vx-extendedsearch-fuer-virtuemart-2-0.html for 15 euro hikashop business?

Of course you can write it yourself, IF you can. Even I can clearly write it myself, I would buy one, spares a lot money.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1398
Re: Products filters
« Reply #6 on: July 17, 2013, 12:34:52 pm »

offtop
What simplest method to organize the filter at the price?
[/quote]

Its not simple at all. The final price usually is a result of multiple variants like the VAT percentage, Currency rates and discounts.
I assume that the hikashop's solution is just searching to the base price as it just joining 1 table.

Also if you want to create a professional shop without investing either 1 penny, i don't think that the result will be very satisfying.

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Re: Products filters
« Reply #7 on: July 17, 2013, 15:12:59 pm »
http://virtuext.com/de/herunterladen/vx-extendedsearch-fuer-virtuemart-2-0.html for 15 euro hikashop business?
Certainly not, but One Page Checkout (I already made it) is still necessary to me, it will cost 15 + 50 = 65 euro. :) It already at least Hika Essential which includes all these functions.
Let's not argue, an essence not in it.

I assume that the hikashop's solution is just searching to the base price as it just joining 1 table.

No, it is possible to connect any number of tables and conditions.

Also if you want to create a professional shop without investing either 1 penny, i don't think that the result will be very satisfying.
don't think that I am a miser, I work as the developer and to me don't give additional money for implementation.
I consider to pay from the pocket in case of a salary of 350 euro per month inappropriate.

Let speak on a subject, I only offered improving option for vm. If no, then no.

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Re: Products filters
« Reply #8 on: July 22, 2013, 10:58:35 am »
Is native there and there is also a trigger that you can use your own search plugin. and it is there since November 2010 or so.

to add the same functionality to virtuemart enough add these code
Code: [Select]
// filter plugin trigger
JPluginHelper::importPlugin('search');
$dispatcher = JDispatcher::getInstance();
$plgDisplay = $dispatcher->trigger('plgVmProductListingLoad',array(&$select, &$joinedTables, &$whereString, &$groupBy, &$orderBy, &$filter_order_Dir, &$nbrReturnProducts) );

in the file:
Code: [Select]
administrator\components\com_virtuemart\models\product.phpbefor exeSortSearchListQuery
Code: [Select]
$product_ids = $this->exeSortSearchListQuery (2, $select, $joinedTables, $whereString, $groupBy, $orderBy, $this->filter_order_Dir, $nbrReturnProducts);

 then anyone can easily write a search/filter plugin like:
Code: [Select]
class plgSearchVmFilter extends JPlugin
{
    function plgVmProductListingLoad($select, $joinedTables, $whereString, $groupBy, $orderBy, $filter_order_Dir, $nbrReturnProducts)
    {
if (JRequest::getVar('filter',false))  {
$max_price = JRequest::getInt('price_max',0);
$min_price = JRequest::getInt('price_min',0);

// Price filter
if ($max_price) {
$joinedTables .= 'LEFT JOIN `#__virtuemart_product_prices` as z ON z.`virtuemart_product_id` = p.`virtuemart_product_id`';
$whereString .= 'AND z.`product_price` < '.$max_price.' AND z.`product_price` > '.$min_price;
}
}
    }
}
[/size]
please add this feature in new versions or write why it is not possible.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products filters
« Reply #9 on: July 22, 2013, 15:40:04 pm »
Because this trigger IS already there? as I said at begin. Native virtuemart is even searching for customfields, so I really wonder.

Code: [Select]
useCore = TRUE;
if ($this->searchplugin !== 0) {
//reset generic filters ! Why? the plugin can do it, if it wishes it.
// if ($this->keyword ==='') $where=array();
JPluginHelper::importPlugin ('vmcustom');
$dispatcher = JDispatcher::getInstance ();
$PluginJoinTables = array();
$ret = $dispatcher->trigger ('plgVmAddToSearch', array(&$where, &$PluginJoinTables, $this->searchplugin));
foreach ($ret as $r) {
if (!$r) {
$useCore = FALSE;
}
}
}
I think it is there since more than a year.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

joomlavod

  • Beginner
  • *
  • Posts: 7
  • VirtueMart Version: 2.0.22a
Re: Products filters
« Reply #10 on: July 23, 2013, 10:09:12 am »
Because this trigger IS already there? as I said at begin. Native virtuemart is even searching for customfields, so I really wonder.
I saw this triger, BUT, whether I can use this triger what to add conditions of a choice of products as in an example below?
Code: [Select]
        $joinedTables .= 'LEFT JOIN `#__virtuemart_product_prices` as z ON z.`virtuemart_product_id` = p.`virtuemart_product_id`';
$whereString .= 'AND z.`product_price` < '.$max_price.' AND z.`product_price` > '.$min_price;

I suspect that the response - No, if I am mistaken,please give an example of change of parameters of plgVmAddToSearch.