Author Topic: Sentence on change of a code of a kernel (customfields plugins)  (Read 1851 times)

usovdm

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 16
VM 2.0.2

1.

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

Line 152:
   function storePluginInternalDataProduct

was:
   
Code: [Select]
$values['id'] = $id
replace on:
   
Code: [Select]
$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:
Code: [Select]
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:
Code: [Select]
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9843
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Sentence on change of a code of a kernel (customfields plugins)
« Reply #1 on: April 01, 2012, 20:34:40 pm »
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).
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

usovdm

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 16
Re: Sentence on change of a code of a kernel (customfields plugins)
« Reply #2 on: April 12, 2012, 19:17:29 pm »
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:
Code: [Select]
$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