_tablepkey = 'id'; $this->tableFields = array_keys($this->getTableSQLFields()); $this->varsToPush = array( 'custom_specification_name1'=> array('', 'char'), 'custom_specification_default1'=> array('', 'string'), 'custom_specification_name2'=> array('', 'char'), 'custom_specification_default2'=> array('', 'string'), ); $this->setConfigParameterable('custom_params',$this->varsToPush); // self::$_this = $this; } /** * Create the table for this plugin if it does not yet exist. * @author Val�rie Isaksen */ public function getVmPluginCreateTableSQL() { return $this->createTableSQL('Product Specification Table'); } function getTableSQLFields() { $SQLfields = array( 'id' => 'int(11) unsigned NOT NULL AUTO_INCREMENT', 'virtuemart_product_id' => 'int(11) UNSIGNED DEFAULT NULL', 'virtuemart_custom_id' => 'int(11) UNSIGNED DEFAULT NULL', 'custom_specification_default1' => 'varchar(1024) NOT NULL DEFAULT \'\' ', 'custom_specification_default2' => 'varchar(1024) NOT NULL DEFAULT \'\' ' ); return $SQLfields; } /* * (only to add if you want Searchable Plugin) * * Render the search in category * @ $selectList the list contain all the possible plugin(+customparent_id) * @ &$searchCustomValues The HTML to render as search fields * */ public function plgVmSelectSearchableCustom(&$selectList,&$searchCustomValues,$virtuemart_custom_id) { $db =JFactory::getDBO(); $db->setQuery('SELECT `virtuemart_custom_id`, `custom_title` FROM `#__virtuemart_customs` WHERE `custom_element` ="'.$this->_name.'"'); if ($this->selectList = $db->loadAssocList() ) { foreach ($this->selectList as $selected_custom_id) { if ($virtuemart_custom_id == $selected_custom_id['virtuemart_custom_id']) { $searchCustomValues.=''; } } $selectList = array_merge((array)$this->selectList,$selectList); } return true; } /* * (only to add if you want Searchable Plugin) * * Extend the search in category * @ $where the list contain all the possible plugin(+customparent_id) * @ $PluginJoinTables The plg_name table to join on the search * (in normal case must be = to $this->_name) */ public function plgVmAddToSearch(&$where,&$PluginJoinTables,$custom_id) { if ($keyword = vmRequest::uword('custom_specification_name1', null, ' ')) { $db = JFactory::getDBO(); if ($this->_name != $this->GetNameByCustomId($custom_id)) return; $keyword = '"%' . $db->getEscaped( $keyword, true ) . '%"' ; $where[] = $this->_name .'.`custom_specification_default1` LIKE '.$keyword; $PluginJoinTables[] = $this->_name ; } return true; } // get product param for this plugin on edit function plgVmOnProductEdit($field, $product_id, &$row,&$retValue) { if ($field->custom_element != $this->_name) return ''; // $this->tableFields = array ( 'id', 'virtuemart_custom_id', 'custom_specification_default1', 'custom_specification_default2' ); $this->getCustomParams($field); $this->getPluginCustomData($field, $product_id); // $data = $this->getVmPluginMethod($field->virtuemart_custom_id); // VmTable::bindParameterable($field,$this->_xParams,$this->_varsToPushParam); // $html =' '; $html ='