setUniqueName('vendor_name'); $this->setSlug('vendor_store_name'); //Attention the slug autoname MUST be also in the translatable, if existing $this->setLoggable(); $this->setLockable(); $this->setTranslatable(array( 'vendor_store_name', 'vendor_phone', 'vendor_store_desc', 'vendor_terms_of_service', 'vendor_legal_info', 'vendor_url', 'metadesc', 'metakey', 'customtitle', 'vendor_letter_css', 'vendor_letter_header_html', 'vendor_letter_footer_html', 'vendor_invoice_free1', 'vendor_invoice_free2', 'vendor_mail_free1', 'vendor_mail_free2', 'vendor_mail_css') ); $varsToPushParam = array( 'max_cats_per_product'=>array(-1,'int'), 'max_products'=>array(-1,'int'), 'max_customers'=>array(-1,'int'), 'force_product_pattern'=>array(-1,'int'), 'vendor_min_pov'=>array(0.0,'float'), 'vendor_min_poq'=>array(1,'int'), 'vendor_freeshipment'=>array(0.0,'float'), 'vendor_address_format'=>array('','string'), 'vendor_date_format'=>array('','string'), 'vendor_letter_format'=>array('A4','string'), 'vendor_letter_orientation'=>array('P','string'), 'vendor_letter_margin_top'=>array(55,'int'), 'vendor_letter_margin_left'=>array(25,'int'), 'vendor_letter_margin_right'=>array(25,'int'), 'vendor_letter_margin_bottom'=>array(25,'int'), 'vendor_letter_margin_header'=>array(20,'int'), 'vendor_letter_margin_footer'=>array(20,'int'), 'vendor_letter_font'=>array('helvetica','string'), 'vendor_letter_font_size'=>array(8, 'int'), 'vendor_letter_header_font_size'=>array(7, 'int'), 'vendor_letter_footer_font_size'=>array(6, 'int'), 'vendor_letter_header'=>array(1,'int'), 'vendor_letter_header_line'=>array(1,'int'), 'vendor_letter_header_line_color'=>array("#000000",'string'), 'vendor_letter_header_image'=>array(1,'int'), 'vendor_letter_header_imagesize'=>array(60,'int'), 'vendor_letter_header_cell_height_ratio'=>array(1,'float'), 'vendor_letter_footer'=>array(1,'int'), 'vendor_letter_footer_line'=>array(1,'int'), 'vendor_letter_footer_line_color'=>array("#000000",'string'), 'vendor_letter_footer_cell_height_ratio'=>array(1,'float'), 'vendor_letter_add_tos' => array(0,'int'), 'vendor_letter_add_tos_newpage' => array(1,'int'), 'vendor_letter_for_product_pdf' => array(0,'int'), 'vendor_mail_width' => array(640, 'int'), 'vendor_mail_header' => array(1, 'int'), 'vendor_mail_tos' => array(1, 'int'), 'vendor_mail_logo' => array(1, 'int'), 'vendor_mail_logo_width' => array(200, 'int'), 'vendor_mail_font'=>array('helvetica','string'), 'vendor_mail_header_font_size' => array(11, 'int'), 'vendor_mail_font_size' => array(12, 'int'), 'vendor_mail_footer_font_size' => array(10, 'int') ); $this->setParameterable('vendor_params',$varsToPushParam); $this->setTableShortCut('v'); $this->_genericVendorId = false; } public function check(){ if(!empty($this->virtuemart_vendor_id) and !vmAccess::manager('managevendors')){ $mV = VmModel::getModel('vendor'); $userId = VirtueMartModelVendor::getUserIdByVendorId($this->virtuemart_vendor_id); $userTable = $mV->getTable ('vmusers'); $userTable->load($userId); if(!empty($userTable->virtuemart_vendor_id) and $userTable->virtuemart_vendor_id!=$this->virtuemart_vendor_id){ VmWarn('User does not fit to vendor, storing cancelled'); return false; } } // Store multiple selectlist entries as a ; separated string if(!empty($this->vendor_accepted_currencies) and is_array($this->vendor_accepted_currencies)){ $this->vendor_accepted_currencies = implode (',', $this->vendor_accepted_currencies); } return parent::check(); } } //pure php no closing tag