setUniqueName('shopper_group_name'); $this->setLoggable(); $this->setLockable(); $this->setTableShortCut('sg'); $varsToPushParam = array('show_prices' => array(0,'int')); foreach(CurrencyDisplay::$priceNames as $field){ $varsToPushParam[$field] = array(1,'int'); $varsToPushParam[$field.'Text'] = array(1,'int'); $varsToPushParam[$field.'Rounding'] = array(-1,'int'); } $this->setParameterable('price_display',$varsToPushParam); } function check(){ if (empty($this->shopper_group_name) ){ vmError('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME'); return false; } else { if(function_exists('mb_strlen') ){ $length = mb_strlen($this->shopper_group_name); } else { $length = strlen($this->shopper_group_name); } if($length>128){ vmError('COM_VIRTUEMART_SHOPPERGROUP_NAME_128'); } } if($this->virtuemart_shoppergroup_id==1 OR $this->virtuemart_shoppergroup_id==2){ if($this->virtuemart_shoppergroup_id==1) { $this->default=2; } else if($this->virtuemart_shoppergroup_id==2) { $this->default=1; } $this->sgrp_additional = 0; $this->shared = 1; $this->virtuemart_vendor_id = 1; //$this->published = 1; } else { $this->default=0; } return parent::check(); } } // pure php no closing tag