public function beforeMailPrepare(&$mail, &$mailer, &$do) { $mail_name = $mail->mail_name; if (isset($mail->hikaserial) && !empty($mail->hikaserial)) { $mail_name = 'serial.' . $mail_name; if (empty($mail->attachments)) { $shopMailClass = hikamarket::get('shop.class.mail'); $mail->attachments = $shopMailClass->loadAttachments($mail_name); } } }
function _getVendorInfo() { static $vendor = null; if ($vendor !== null) { return $vendor; } $app = JFactory::getApplication(); $vendor_id = (int) hikashop_getCID('vendor_id'); $menus = $app->getMenu(); $menu = $menus->getActive(); if (empty($menu) && !empty($Itemid)) { $menus->setActive($Itemid); $menu = $menus->getItem($Itemid); } if (empty($vendor_id) && is_object($menu) && !empty($menu->params)) { jimport('joomla.html.parameter'); $params = new JParameter($menu->params); $vendor_id = $params->get('vendor_id'); } $vendor = false; if (!empty($vendor_id)) { $vendorClass = hikamarket::get('class.vendor'); $vendor = $vendorClass->get($vendor_id); } return $vendor; }