function get($id, $default = null) { static $cachedElements = array(); if ($id == 'reset_cache') { $cachedElements = array(); return true; } if ((int) $id == 0) { return true; } if (!isset($cachedElements[$id])) { $cachedElements[$id] = parent::get($id); if ($cachedElements[$id]) { $this->addAlias($cachedElements[$id]); } } if (!is_object($cachedElements[$id])) { return $cachedElements[$id]; } $copy = new stdClass(); foreach (get_object_vars($cachedElements[$id]) as $key => $val) { $copy->{$key} = $val; } return $copy; }
function get($cid = 0, $default = '') { if (!empty($cid)) { $widget = parent::get($cid); if (!empty($widget->widget_params)) { $widget->widget_params = unserialize($widget->widget_params); if (!empty($widget->widget_params->status)) { $widget->widget_params->status = explode(',', $widget->widget_params->status); } } return $widget; } $filters = array(); $filters[] = 'widget_published=1'; hikashop_addACLFilters($filters, 'widget_access'); $filters = implode(' AND ', $filters); $query = 'SELECT * FROM ' . hikashop_table('widget') . ' WHERE ' . $filters . ' ORDER BY widget_ordering ASC'; $this->database->setQuery($query); $widgets = $this->database->loadObjectList(); if (!empty($widgets)) { foreach ($widgets as $k => $widget) { if (!empty($widget->widget_params)) { $widgets[$k]->widget_params = unserialize($widget->widget_params); if (!empty($widgets[$k]->widget_params->status)) { $widgets[$k]->widget_params->status = explode(',', $widgets[$k]->widget_params->status); } } } } return $widgets; }
function get($id, $default = '') { $result = parent::get($id); if (!empty($result->plugin_params)) { $result->plugin_params = unserialize($result->plugin_params); } return $result; }
function get($element, $default = '') { if (is_numeric($element)) { $data = parent::get($element); } else { $db = JFactory::getDBO(); $query = 'SELECT * FROM ' . hikashop_table('currency') . ' WHERE currency_code = ' . $db->Quote($element); $db->setQuery($query); $data = $db->loadObject(); } $this->checkLocale($data); return $data; }
function get($cid = 0, $default = '') { $element = parent::get($cid, $default); if ($element) { $class = hikashop_get('class.product'); $product = $class->get($element->product_id); if ($product) { foreach (get_object_vars($product) as $k => $v) { $element->{$k} = $v; } } } return $element; }
function get($element, $withimage = false) { if (in_array($element, array('product', 'status', 'tax', 'manufacturer'))) { $this->getMainElement($element); } if (empty($element)) { return null; } if ($withimage) { $query = 'SELECT a.*,b.* FROM ' . hikashop_table(end($this->tables)) . ' AS a LEFT JOIN ' . hikashop_table('file') . ' AS b ON a.category_id = b.file_ref_id AND b.file_type = \'category\' WHERE a.category_id = ' . (int) $element . ' LIMIT 1'; $this->database->setQuery($query); return $this->database->loadObject(); } return parent::get($element); }
function get($id, $default = '') { $obj = parent::get($id); $config =& hikashop_config(); if (is_null($obj)) { $obj = new stdClass(); } if (!empty($obj->id)) { $obj->hikashop_params = $config->get('menu_' . $obj->id, null); } if (empty($obj->hikashop_params)) { $obj->hikashop_params = $config->get('default_params', null); } $this->loadParams($obj); return $obj; }
function get($id, $default = '') { static $cachedElements = array(); if ($id == 'reset_cache') { $cachedElements = array(); } if (!isset($cachedElements[$id])) { $result = parent::get($id, $default); if (!empty($result->payment_params)) { $result->payment_params = unserialize($result->payment_params); } $cachedElements[$id] = $result; } return $cachedElements[$id]; }
function loadOrderNotification(&$order, $type = 'order_status_notification') { if (empty($order->order_user_id) || empty($order->order_status)) { $dbOrder = parent::get($order->order_id); $order->order_user_id = @$dbOrder->order_user_id; if (empty($order->order_status)) { $order->order_status = @$dbOrder->order_status; } } if (empty($order->customer) || @$order->customer->user_id != $order->order_user_id) { $userClass = hikashop_get('class.user'); $order->customer = $userClass->get($order->order_user_id); } $this->orderNumber($order); global $Itemid; $url = ''; if (!empty($Itemid)) { $url = '&Itemid=' . $Itemid; } if (isset($order->url_itemid)) { $url = (!empty($order->url_itemid) ? '&Itemid=' : '') . $order->url_itemid; } $order->order_url = hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=show&cid[]=' . $order->order_id . $url); $app = JFactory::getApplication(); if (!isset($order->mail_status)) { if (isset($order->order_status)) { if ($app->isAdmin()) { $locale = $this->loadLocale($order); if (!empty($order->order_current_locale) && $order->order_current_locale != $locale) { $translationHelper = hikashop_get('helper.translation'); if ($translationHelper->isMulti(true, false)) { $lgid = $translationHelper->getId($locale); $trans_table = 'jf_content'; if ($translationHelper->falang) { $trans_table = 'falang_content'; } $query = 'SELECT b.value ' . ' FROM ' . hikashop_table('category') . ' AS a ' . ' LEFT JOIN ' . hikashop_table($trans_table, false) . ' AS b ON (a.category_id = b.reference_id AND b.reference_table = \'hikashop_category\' AND b.reference_field = \'category_name\' AND b.published = 1 AND language_id = ' . $lgid . ') ' . ' WHERE a.category_type=\'status\' AND a.category_name=' . $this->database->Quote($order->order_status); $this->database->setQuery($query); $result = $this->database->loadResult(); if (!empty($result)) { $order->mail_status = $result; } } } elseif (!empty($order->value)) { $order->mail_status = $order->value; } } else { $query = 'SELECT * FROM ' . hikashop_table('category') . ' WHERE category_type=\'status\' AND category_name=' . $this->database->Quote($order->order_status); $this->database->setQuery($query); $status = $this->database->loadObject(); if (!empty($status->category_name) && $status->category_name != $order->order_status) { $order->mail_status = $status->category_name; } } if (empty($order->mail_status)) { $val = str_replace(' ', '_', strtoupper($order->order_status)); $trans = JText::_($val); if ($val == $trans) { $order->mail_status = $order->order_status; } else { $order->mail_status = $trans; } } } else { $order->mail_status = ''; } } $mail_status = $order->mail_status; $mailClass = hikashop_get('class.mail'); $order->mail = $mailClass->get($type, $order); $order->mail_status = $mail_status; $order->mail->subject = JText::sprintf($order->mail->subject, $order->order_number, $mail_status, HIKASHOP_LIVE); if (!empty($order->customer->user_email)) { $order->mail->dst_email =& $order->customer->user_email; } else { $order->mail->dst_email = ''; } if (!empty($order->customer->name)) { $order->mail->dst_name =& $order->customer->name; } else { $order->mail->dst_name = ''; } $this->loadBackLocale(); }
function getField($fieldid, $type = '') { if (is_numeric($fieldid)) { $element = parent::get($fieldid); } else { $this->database->setQuery('SELECT * FROM ' . hikashop_table('field') . ' WHERE field_table=' . $this->database->Quote($type) . ' AND field_namekey=' . $this->database->Quote($fieldid)); $element = $this->database->loadObject(); } $fields = array($element); $data = null; $this->prepareFields($fields, $data, $fields[0]->field_type, '', true); return $fields[0]; }
function get($id, $default = null) { $element = parent::get($id); if ($element) { $this->prepare($element); } return $element; }
function get($id, $default = null) { $result = parent::get($id); $result->limit_status = explode(',', $result->limit_status); return $result; }
function get($id, $type = 'product', $content = 'main', $infos = array()) { return parent::get($id); }
function get($order_product_id, $default = null) { $result = parent::get($order_product_id); if (!empty($result->order_product_tax_info)) { $result->order_product_tax_info = unserialize($result->order_product_tax_info); } return $result; }
function get($id, $default = '') { $result = parent::get($id); $this->loadParams($result); return $result; }