Sentence on change of a code of a kernel (customfields plugins)

Started by usovdm, April 01, 2012, 12:45:29 PM

Previous topic - Next topic

usovdm

VM 2.0.2

1.

\administrator\components\com_virtuemart\plugins\vmcustomplugin.php

Line 152:
   function storePluginInternalDataProduct

was:
   $values['id'] = $id

replace on:
   $values['id'] = $id ? $id : 0;

why: 1 product, 3 NEW fields of the one plugin. One NEW record in a plugin table saved only.

2.

\administrator\components\com_virtuemart\models\product.php

Line 390:

was:
if ($this->searchplugin!==0) {
if (!empty( $PluginJoinTables) ) {
$plgName = $PluginJoinTables[0] ;
$joinedTables .= ' LEFT JOIN `#__virtuemart_product_custom_plg_'.$plgName.'` as '.$plgName.' ON '.$plgName.'.`virtuemart_product_id` = p.`virtuemart_product_id` ' ;
}
}


replace on:
if ($this->searchplugin!==0) {
  if (count( $PluginJoinTables)>0) {
foreach($PluginJoinTables as $v){
  $plgName = $v[0] ;
  $plgOn = isset($v[1]) ? $v[1] : $v[0];
  $joinedTables .= ' LEFT JOIN `#__virtuemart_product_custom_plg_'.$plgName.'` as '.$plgOn.' ON '.$plgOn.'.`virtuemart_product_id` = p.`virtuemart_product_id` ' ;
}
  }
}

   
why: 1 product. Search by 3 fields of the one plugin (include multiple values). Example:
/component/virtuemart/?search=true&view=category&custom_parent_id=16&custom_value[16][]=v1&custom_value[16][]=v2&custom_parent_id=18&custom_value[18][]=v3&custom_value[18][]=v4&custom_parent_id=17&custom_value[17][]=v5
, where customfields with id (16,17,18) are by one plugin type

Demo (left side filter): http://demo.jgen.ru (meanwhile only in Russian)

The plugin + module is in a development stage. After testing and the translation into English I will publish here.

Milbo

Hmm, I cant add your second idea, because we changed it meanwhile, please adjust it to the new version 2.0.3 latest. Sounds interesting, no question. But maybe not needed anylonger (just not completly in that part of code).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

usovdm

UP
2.0.4 already released :) item 2 (from first post) on the former is actual.

And...

3.

File: \administrator\components\com_virtuemart\plugins\vmcustomplugin.php

Version: 2.0.4; Line 152: insert line:
$dispatcher->trigger('plgVmAddToSearchOption',array(&$where,&$joinCategory,&$joinMf,&$joinPrice,&$joinShopper));
why: To give to a customfields plugin control of flags. Example: search at the price from 0 to 999 or category_id... with customfields values