Author Topic: VirtueMartCustomFieldRenderer overide in 3.0.12  (Read 3144 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4606
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
VirtueMartCustomFieldRenderer overide in 3.0.12
« on: November 15, 2015, 10:18:01 am »
Hi all,

I need to overide VirtueMartCustomFieldRenderer in a system plugin but currently the new code don't check for exising class in
JOOMLAROOT\administrator\components\com_virtuemart\models\customfields.php  line 780 and 805.

   
Code: [Select]
if(self::$customfieldRenderer){
self::$customfieldRenderer = false;

if (!class_exists ('VmView'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'vmview.php');
$lPath = VmView::getVmSubLayoutPath ('customfield');

if($lPath){
require ($lPath);
} else {
vmdebug('displayProductCustomfieldFE layout not found customfield');
}
}

adding a class_exists with this code:

Code: [Select]
if(self::$customfieldRenderer){
self::$customfieldRenderer = false;
if(!class_exists('VirtueMartCustomFieldRenderer') {
if (!class_exists ('VmView'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'vmview.php');
$lPath = VmView::getVmSubLayoutPath ('customfield');

if($lPath){
require ($lPath);
} else {
vmdebug('displayProductCustomfieldFE layout not found customfield');
}
}
}

Solve the problem with a minimum code change.
Thanks to fix this.

Patrick