コード例 #1
0
ファイル: discount.php プロジェクト: q0821/esportshop
 function copy()
 {
     $discounts = JRequest::getVar('cid', array(), '', 'array');
     $result = true;
     if (!empty($discounts)) {
         $discountClass = hikashop_get('class.discount');
         foreach ($discounts as $discount) {
             $data = $discountClass->get($discount);
             if ($data) {
                 unset($data->discount_id);
                 $data->discount_code = $data->discount_code . '_copy' . rand();
                 if (!$discountClass->save($data)) {
                     $result = false;
                 }
             }
         }
     }
     if ($result) {
         $app = JFactory::getApplication();
         if (!HIKASHOP_J30) {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'), 'success');
         } else {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'));
         }
         return $this->listing();
     }
     return $this->form();
 }
コード例 #2
0
ファイル: menus.php プロジェクト: q0821/esportshop
 function add_module()
 {
     $id = hikashop_getCID('id');
     $menu = hikashop_get('class.menus');
     $menu->attachAssocModule($id);
     $this->edit();
 }
コード例 #3
0
 function load($fields, $id, $sort)
 {
     $this->values = array();
     $this->values[] = JHTML::_('select.option', 'weight', JText::_('PRODUCT_WEIGHT'));
     $this->values[] = JHTML::_('select.option', 'volume', JText::_('PRODUCT_VOLUME'));
     $this->values[] = JHTML::_('select.option', 'height', JText::_('PRODUCT_HEIGHT'));
     $this->values[] = JHTML::_('select.option', 'length', JText::_('PRODUCT_LENGTH'));
     $this->values[] = JHTML::_('select.option', 'width', JText::_('PRODUCT_WIDTH'));
     $this->values[] = JHTML::_('select.option', 'surface', JText::_('PRODUCT_SURFACE'));
     if (empty($id) || $id == 'datafilterfilter_data_cursor') {
         $this->values[] = JHTML::_('select.option', 'b.product_name', JText::_('PRODUCT_NAME'));
         $this->values[] = JHTML::_('select.option', 'price', JText::_('PRICE'));
         $this->values[] = JHTML::_('select.option', 'b.product_average_score', JText::_('RATING'));
         $fieldsClass = hikashop_get('class.field');
         $fields = $fieldsClass->getData('all', 'product');
         if (!empty($fields)) {
             foreach ($fields as $field) {
                 $this->values[] = JHTML::_('select.option', 'b.' . $field->field_namekey, $field->field_realname);
             }
         }
     }
     if ($sort) {
         $this->values[] = JHTML::_('select.option', 'b.product_created', JText::_('CREATION_DATE'));
         $this->values[] = JHTML::_('select.option', 'b.product_sales', JText::_('SALES'));
         $this->values[] = JHTML::_('select.option', 'b.product_modified', JText::_('MODIFICATION_DATE'));
         $this->values[] = JHTML::_('select.option', 'b.product_hit', JText::_('CLICKS'));
     }
     $fieldClass = hikashop_get('class.field');
     if (!empty($fields) && is_array($fields)) {
         foreach ($fields as $field) {
             $this->values[] = JHTML::_('select.option', $field->field_namekey, $field->field_realname);
         }
     }
 }
コード例 #4
0
ファイル: validate_free_order.php プロジェクト: rodhoff/MNW
 public function onAfterOrderCreate(&$order)
 {
     if (empty($order) || empty($order->order_type) || $order->order_type != 'sale' || !isset($order->order_full_price)) {
         return;
     }
     $this->init();
     $send_confirmation = $this->params->get('send_confirmation', 1);
     if (!$send_confirmation && $order->order_status == 'confirmed') {
         $class = hikashop_get('class.cart');
         $class->cleanCartFromSession();
         return;
     }
     if ($send_confirmation && bccomp($order->order_full_price, 0, 5) == 0) {
         $config = hikashop_config();
         $orderObj = new stdClass();
         $orderObj->order_id = (int) $order->order_id;
         $orderObj->order_status = $config->get('order_confirmed_status', 'confirmed');
         $orderObj->history = new stdClass();
         $orderObj->history->history_notified = 1;
         $orderClass = hikashop_get('class.order');
         $orderClass->save($orderObj);
         $class = hikashop_get('class.cart');
         $class->cleanCartFromSession();
     }
 }
コード例 #5
0
ファイル: vote.php プロジェクト: q0821/esportshop
 function save()
 {
     $voteClass = hikashop_get('class.vote');
     if (!count($_POST)) {
         $app = JFactory::getApplication();
         $app->redirect(preg_replace('#ctrl=vote&task=save&[0-9a-z=]+#', '', preg_replace('#/vote/save/[0-9a-z-]+#', '', hikashop_currentURL())), '', 'message', true);
     }
     $element = new stdClass();
     $element->hikashop_vote_type = JRequest::getVar('hikashop_vote_type', 0, 'default', 'string', 0);
     $element->vote_ref_id = JRequest::getVar('hikashop_vote_ref_id', 0, 'default', 'int');
     if (empty($element->vote_ref_id)) {
         $element->vote_ref_id = JRequest::getVar('hikashop_vote_product_id', 0, 'default', 'int');
     }
     $element->user_id = JRequest::getVar('hikashop_vote_user_id', 0, 'default', 'int');
     $element->pseudo_comment = JRequest::getVar('pseudo_comment', 0, 'default', 'string', 0);
     $element->email_comment = JRequest::getVar('email_comment', 0, 'default', 'string', 0);
     $element->vote_type = JRequest::getVar('vote_type', 0, 'default', 'string', 0);
     $element->vote = JRequest::getVar('hikashop_vote', 0, 'default', 'int');
     $element->comment = JRequest::getVar('hikashop_vote_comment', '', '', 'string', JREQUEST_ALLOWRAW);
     // JRequest::getVar('hikashop_vote_comment', 0, 'default', 'string', 0);
     $element->comment = urldecode($element->comment);
     if (!empty($element->comment) || !empty($element->vote) || !empty($element->email_comment) || !empty($element->pseudo_comment) || $element->hikashop_vote_type == 'useful') {
         $voteClass->save($element);
     } else {
         echo '0';
     }
     exit;
 }
コード例 #6
0
ファイル: acymailing.php プロジェクト: q0821/esportshop
 function onAfterOrderUpdate(&$order, &$send_email)
 {
     if (!empty($order->order_id) && !empty($order->order_status)) {
         if (empty($order->order_user_id)) {
             $class = hikashop_get('class.order');
             $old = $class->get($order->order_id);
             $order->order_user_id = $old->order_user_id;
         }
         $userClass = hikashop_get('class.user');
         $user = $userClass->get($order->order_user_id);
         if (!empty($user)) {
             $helper = rtrim(str_replace('/', DS, JPATH_ADMINISTRATOR), DS) . DS . 'components' . DS . 'com_acymailing' . DS . 'helpers' . DS . 'helper.php';
             if (file_exists($helper)) {
                 include_once $helper;
                 if (function_exists('acymailing_get')) {
                     $subClass = acymailing_get('class.subscriber');
                     $sub = $subClass->get($user->email);
                     if (!empty($sub->subid)) {
                         if (file_exists(rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_acymailing' . DS . 'classes' . DS . 'filter.php')) {
                             $filterClass = acymailing_get('class.filter');
                             if ($filterClass) {
                                 $filterClass->subid = $sub->subid;
                                 $filterClass->trigger('hikaorder_' . $order->order_status);
                             }
                         }
                     }
                 }
             }
         }
     }
     return true;
 }
コード例 #7
0
ファイル: affiliate.php プロジェクト: q0821/esportshop
 function store($new = false)
 {
     if (hikashop_getCID('user_id') != hikashop_loadUser()) {
         return false;
     }
     $app = JFactory::getApplication();
     $class = hikashop_get('class.user');
     $class->fields_whitelist = array('user_id', 'user_partner_activated', 'user_partner_email');
     $config =& hikashop_config();
     if ($config->get('allow_currency_selection')) {
         $class->fields_whitelist[] = 'user_currency_id';
     }
     $status = $class->saveForm();
     if ($status) {
         if (!HIKASHOP_J30) {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'), 'success');
         } else {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'));
         }
         if (!$new) {
             JRequest::setVar('cid', $status);
         } else {
             JRequest::setVar('cid', 0);
         }
         JRequest::setVar('fail', null);
     } else {
         $app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
         if (!empty($class->errors)) {
             foreach ($class->errors as $oneError) {
                 $app->enqueueMessage($oneError, 'error');
             }
         }
     }
     return $status;
 }
コード例 #8
0
ファイル: route.php プロジェクト: rodhoff/MNW
 public static function getProductRoute($contentId, $contentCatId, $language)
 {
     list($id, $name) = explode(':', $contentId, 2);
     if (!(include_once rtrim(JPATH_ADMINISTRATOR, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_hikashop' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php')) {
         return;
     }
     $class = hikashop_get('class.product');
     $data = $class->get($id);
     if (empty($link)) {
         $link = 'index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $id . '&name=' . $name;
     }
     $needles = array('layout' => 'listing');
     if (!empty($language) && $language != '*' && JLanguageMultilang::isEnabled()) {
         static::buildLanguageLookup();
         if (isset(static::$lang_lookup[$language])) {
             $link .= '&lang=' . static::$lang_lookup[$language];
             $needles['language'] = $language;
         }
     }
     if ($item = self::lookupItem($needles, 'product')) {
         $link .= '&Itemid=' . $item;
     } elseif (!empty($needles) && ($item = self::lookupItem(array(), 'product'))) {
         $link .= '&Itemid=' . $item;
     }
     $link = hikashop_contentLink($link, $data, false, true);
     return $link;
 }
コード例 #9
0
 function checkOrders($notify = false)
 {
     $db = JFactory::getDBO();
     $config =& hikashop_config();
     $status = $config->get('order_created_status');
     $query = 'SELECT order_id, order_status, order_created FROM ' . hikashop_table('order') . ' WHERE order_type = ' . $db->Quote('sale') . ' AND order_created < ' . (time() - $this->period) . ' AND order_status = ' . $db->Quote($status) . ' ORDER BY order_created ASC LIMIT 0, 20';
     $db->setQuery($query);
     $orders = $db->loadObjectList();
     if (!empty($orders)) {
         $orderClass = hikashop_get('class.order');
         $status = $config->get('cancelled_order_status');
         $statuses = explode(',', $status);
         $status = reset($statuses);
         foreach ($orders as $order) {
             $update = new stdClass();
             $update->order_id = $order->order_id;
             $update->order_status = $status;
             if ($notify) {
                 $update->history = new stdClass();
                 $update->history->history_notified = 1;
             }
             $orderClass->save($update);
         }
     }
     $app = JFactory::getApplication();
     $this->message = 'Orders checked';
     $app->enqueueMessage($this->message);
     return true;
 }
コード例 #10
0
ファイル: breadcrumb.php プロジェクト: rodhoff/MNW
 function display($map, $value, $type = '')
 {
     $class = hikashop_get('class.category');
     $mainCategories = $class->getParents($value);
     $mainHTML = array();
     $ids = array();
     if (!empty($mainCategories)) {
         foreach ($mainCategories as $mainCategory) {
             $ids[] = $mainCategory->category_id;
         }
         $where = array();
         if (!empty($type)) {
             $where = array(' a.category_type IN (' . $class->database->Quote($type) . ',\'root\')');
         }
         $childs = $class->loadAllWithTrans($ids, false, $where, ' ORDER BY a.category_name ASC');
         foreach ($mainCategories as $k => $mainCategory) {
             $values = array();
             $current = 0;
             $values[] = '<option value="' . $mainCategory->category_id . '">' . JText::_('HIKA_NONE') . '</option>';
             foreach ($childs as $child) {
                 if ($child->category_parent_id == $mainCategory->category_id) {
                     $values[] = '<option value="' . $child->category_id . '" ' . (in_array($child->category_id, $ids) ? 'selected="selected" ' : '') . '>' . $child->translation . '</option>';
                 }
             }
             if (count($values) == 1) {
                 continue;
             }
             $mainHTML[] = '<select name="' . $map . '_chooser_' . $k . '" id="' . $map . '_chooser_' . $k . '" class="inputbox" size="1" onchange="document.getElementById(\'' . $map . '\').value=this.value; document.adminForm.submit();">' . "\n" . implode("\n", $values) . "\n" . '</select>';
         }
     }
     return implode('', $mainHTML);
 }
コード例 #11
0
ファイル: pluginoptions.php プロジェクト: q0821/esportshop
 protected function getInput()
 {
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
         return 'This plugin can not work without the Hikashop Component';
     }
     $id = JRequest::getInt('extension_id');
     $plugins = hikashop_get('class.plugins');
     $plugin = $plugins->get($id);
     $name = @$plugin->element;
     if (@$plugin->folder == 'hikashopshipping') {
         $group = 'shipping';
     } elseif (@$plugin->folder == 'hikashop') {
         $group = 'plugin';
     } else {
         $group = 'payment';
     }
     $config =& hikashop_config();
     if (!hikashop_isAllowed($config->get('acl_plugins_manage', 'all'))) {
         return 'Access to the HikaShop options of the plugins is restricted';
     }
     $text = '<a style="float:left;" title="' . JText::_('HIKASHOP_OPTIONS') . '"  href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&fromjoomla=1&task=listing&name=' . $name . '&plugin_type=' . $group) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
     return $text;
 }
コード例 #12
0
ファイル: out_of_stock.php プロジェクト: q0821/esportshop
 function checkProducts()
 {
     $db = JFactory::getDBO();
     $query = 'SELECT * FROM ' . hikashop_table('product') . ' WHERE ' . ' product_quantity < ' . (int) $this->stock_limit . ' AND product_published = 1 AND product_quantity != -1 ' . ' AND (product_sale_start = 0 OR product_sale_start < ' . time() . ') AND (product_sale_end = 0 OR product_sale_end > ' . time() . ')';
     $db->setQuery($query);
     $products = $db->loadObjectList();
     if (!empty($products)) {
         $mailClass = hikashop_get('class.mail');
         $infos = new stdClass();
         $infos->products =& $products;
         $mail = $mailClass->get('out_of_stock', $infos);
         $mail->subject = JText::sprintf($mail->subject, HIKASHOP_LIVE);
         $config =& hikashop_config();
         if (!empty($infos->email)) {
             $mail->dst_email = $infos->email;
         } else {
             $mail->dst_email = $config->get('from_email');
         }
         if (!empty($infos->name)) {
             $mail->dst_name = $infos->name;
         } else {
             $mail->dst_name = $config->get('from_name');
         }
         $mailClass->sendMail($mail);
     }
     $app = JFactory::getApplication();
     $this->message = 'Products quantity checked';
     $app->enqueueMessage($this->message);
     return true;
 }
コード例 #13
0
ファイル: view.html.php プロジェクト: q0821/esportshop
 function options(&$params)
 {
     $this->id = $params->get('id');
     $this->name = str_replace('[]', '', $params->get('name'));
     $this->element = $params->get('value');
     $this->pricetaxType = hikashop_get('type.pricetax');
     $this->discountDisplayType = hikashop_get('type.discount_display');
     $this->priceDisplayType = hikashop_get('type.priceDisplay');
     $this->arr = array(JHTML::_('select.option', '-1', JText::_('HIKA_INHERIT')), JHTML::_('select.option', '1', JText::_('HIKASHOP_YES')), JHTML::_('select.option', '0', JText::_('HIKASHOP_NO')));
     $this->arr[0]->class = 'btn-primary';
     $this->arr[1]->class = 'btn-success';
     $this->arr[2]->class = 'btn-danger';
     $this->type = 'cart';
     if (preg_match('/wishlist/', $this->name)) {
         $this->type = 'wishlist';
     }
     $cid = JRequest::getInt('id', '');
     if (empty($cid)) {
         $cid = hikashop_getCID();
     }
     $modulesClass = hikashop_get('class.modules');
     $module = $modulesClass->get($cid);
     if (empty($this->element)) {
         $this->element = $module->hikashop_params;
     }
     $config = hikashop_config();
     $this->default_params = $config->get('default_params');
 }
コード例 #14
0
 function onAfterRoute()
 {
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         return true;
     }
     if (@$_REQUEST['option'] == 'com_user' && @$_REQUEST['view'] == 'register' || @$_REQUEST['option'] == 'com_users' && @$_REQUEST['view'] == 'registration' && !in_array(@$_REQUEST['task'], array('remind.remind', 'reset.request', 'reset.confirm', 'reset.complete'))) {
         $Itemid = $this->params->get('item_id');
         if (empty($Itemid)) {
             global $Itemid;
             if (empty($Itemid)) {
                 $urlItemid = JRequest::getInt('Itemid');
                 if ($urlItemid) {
                     $Itemid = $urlItemid;
                 }
             }
         }
         if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
             return true;
         }
         $menuClass = hikashop_get('class.menus');
         if (!empty($Itemid)) {
             $Itemid = $menuClass->loadAMenuItemId('', '', $Itemid);
         }
         if (empty($Itemid)) {
             $Itemid = $menuClass->loadAMenuItemId('', '');
         }
         $url_itemid = '';
         if (!empty($Itemid)) {
             $url_itemid .= '&Itemid=' . $Itemid;
         }
         $app->redirect(JRoute::_('index.php?option=com_hikashop&ctrl=user&task=form' . $url_itemid, false));
     }
     return true;
 }
コード例 #15
0
ファイル: view.html.php プロジェクト: rodhoff/MNW
 function form()
 {
     $warehouse_id = hikashop_getCID('warehouse_id');
     $class = hikashop_get('class.warehouse');
     if (!empty($warehouse_id)) {
         $element = $class->get($warehouse_id, true);
         $task = 'edit';
     } else {
         $element = new stdClass();
         $element->warehouse_published = 1;
         $task = 'add';
     }
     hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&warehouse=' . $warehouse_id);
     $this->toolbar = array('save', array('name' => 'save2new', 'display' => version_compare(JVERSION, '1.7', '>=')), 'apply', 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'));
     $editor = hikashop_get('helper.editor');
     $editor->name = 'data[warehouse][warehouse_description]';
     $editor->content = @$element->warehouse_description;
     $this->assignRef('editor', $editor);
     $this->assignRef('element', $element);
     $toggle = hikashop_get('helper.toggle');
     $this->assignRef('toggle', $toggle);
     $warehouse = hikashop_get('type.warehouse');
     $this->assignRef('warehouse', $warehouse);
     $popup = hikashop_get('helper.popup');
     $this->assignRef('popup', $popup);
 }
コード例 #16
0
 /**
  *
  * @param object $order
  * @param array $methods
  * @param integer $method_id
  */
 public function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     //
     //
     $this->response = $this->generateTransaction($order, $method_id);
     // Store the Access Code directly in the order object
     //
     if (!$this->response->getErrors()) {
         $update_order = new stdClass();
         $update_order->order_id = (int) $order->order_id;
         $update_order->order_payment_params = @$order->order_payment_params;
         if (!empty($update_order->order_payment_params) && is_string($update_order->order_payment_params)) {
             $update_order->order_payment_params = unserialize($update_order->order_payment_params);
         }
         if (empty($update_order->order_payment_params)) {
             $update_order->order_payment_params = new stdClass();
         }
         $update_order->order_payment_params->eway_accesscode = $this->response->AccessCode;
         $orderClass = hikashop_get('class.order');
         $orderClass->save($update_order);
     } else {
         $app = JFactory::getApplication();
         $error_msg = array();
         foreach ($this->response->getErrors() as $error) {
             $error_mgs[] = eWayRapidBridge::getErrorMessage(trim($error));
         }
         $this->app->enqueueMessage('eWay Errors<br/>' . implode('<br/>', $error_msgs), 'error');
     }
     return $this->showPage('end');
 }
コード例 #17
0
 static function loadAddress(&$order, $type)
 {
     $app =& JFactory::getApplication();
     $cart = hikashop_get('class.cart');
     $address = $app->getUserState(HIKASHOP_COMPONENT . '.' . $type . '_address');
     if (!empty($address)) {
         $cart->loadAddress($order->cart, $address, 'object', $type);
     }
 }
コード例 #18
0
ファイル: email.php プロジェクト: q0821/esportshop
 function remove()
 {
     $mail_name = JRequest::getCmd('mail_name');
     $type = JRequest::getCmd('type');
     $class = hikashop_get('class.' . $this->type);
     $num = $class->delete($mail_name, $type);
     $app = JFactory::getApplication();
     $app->enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $num), 'message');
     return $this->listing();
 }
コード例 #19
0
ファイル: translation.php プロジェクト: rodhoff/MNW
 function getTable()
 {
     $trans_table = 'jf_content';
     $translationHelper = hikashop_get('helper.translation');
     $translationHelper->isMulti();
     if ($translationHelper->falang) {
         $trans_table = 'falang_content';
     }
     return hikashop_table($trans_table, false);
 }
コード例 #20
0
ファイル: characteristic.php プロジェクト: q0821/esportshop
 function loadConversionTables(&$obj)
 {
     $obj->characteristics = array();
     $obj->characteristicsConversionTable = array();
     $query = 'SELECT * FROM ' . hikashop_table('characteristic') . ' ORDER BY characteristic_parent_id ASC, characteristic_ordering ASC';
     $this->database->setQuery($query);
     $obj->characteristics = $this->database->loadObjectList('characteristic_id');
     $app = JFactory::getApplication();
     $translationHelper = hikashop_get('helper.translation');
     if (!$app->isAdmin() && $translationHelper->isMulti(true) && class_exists('JFalangDatabase')) {
         $this->database->setQuery($query);
         $obj->characteristics = array_merge($obj->characteristics, $this->database->loadObjectList('characteristic_id', 'stdClass', false));
     } elseif (!$app->isAdmin() && $translationHelper->isMulti(true) && (class_exists('JFDatabase') || class_exists('JDatabaseMySQLx'))) {
         $this->database->setQuery($query);
         if (HIKASHOP_J25) {
             $obj->characteristics = array_merge($obj->characteristics, $this->database->loadObjectList('characteristic_id', 'stdClass', false));
         } else {
             $obj->characteristics = array_merge($obj->characteristics, $this->database->loadObjectList('characteristic_id', false));
         }
     }
     if (!empty($obj->characteristics)) {
         foreach ($obj->characteristics as $characteristic) {
             $key = '';
             $key_alias = '';
             if (!empty($characteristic->characteristic_parent_id) && !empty($obj->characteristics[$characteristic->characteristic_parent_id])) {
                 if (function_exists('mb_strtolower')) {
                     $key = mb_strtolower(trim($obj->characteristics[$characteristic->characteristic_parent_id]->characteristic_value)) . '_';
                     $key_alias = mb_strtolower(trim($obj->characteristics[$characteristic->characteristic_parent_id]->characteristic_alias)) . '_';
                 } else {
                     $key = strtolower(trim($obj->characteristics[$characteristic->characteristic_parent_id]->characteristic_value)) . '_';
                     $key_alias = strtolower(trim($obj->characteristics[$characteristic->characteristic_parent_id]->characteristic_alias)) . '_';
                 }
             }
             if (function_exists('mb_strtolower')) {
                 $key2 = mb_strtolower(trim($characteristic->characteristic_value, '" '));
             } else {
                 $key2 = strtolower(trim($characteristic->characteristic_value, '" '));
             }
             $key .= $key2;
             $key_alias .= $key2;
             if (!empty($characteristic->characteristic_alias)) {
                 if (function_exists('mb_strtolower')) {
                     $alias = mb_strtolower(trim($characteristic->characteristic_alias, '" '));
                 } else {
                     $alias = strtolower(trim($characteristic->characteristic_alias, '" '));
                 }
                 $obj->characteristicsConversionTable[$alias] = $characteristic->characteristic_id;
             }
             $obj->characteristicsConversionTable[$key_alias] = $characteristic->characteristic_id;
             $obj->characteristicsConversionTable[$key] = $characteristic->characteristic_id;
             $obj->characteristicsConversionTable[$key2] = $characteristic->characteristic_id;
         }
     }
 }
コード例 #21
0
ファイル: order_status.php プロジェクト: rodhoff/MNW
 function load()
 {
     $class = hikashop_get('class.category');
     $rows = $class->loadAllWithTrans('status');
     foreach ($rows as $row) {
         if (!empty($row->translation)) {
             $this->values[$row->category_name] = JHTML::_('select.option', $row->category_name, hikashop_orderStatus($row->translation));
         } else {
             $this->values[$row->category_name] = JHTML::_('select.option', $row->category_name, hikashop_orderStatus($row->category_name));
         }
     }
 }
コード例 #22
0
ファイル: collectondelivery.php プロジェクト: rodhoff/MNW
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     if ($order->order_status != $this->payment_params->order_status) {
         $this->modifyOrder($order->order_id, $this->payment_params->order_status, (bool) @$this->payment_params->status_notif_email, false);
     }
     $this->removeCart = true;
     $currencyClass = hikashop_get('class.currency');
     $this->amount = $currencyClass->format($order->order_full_price, $order->order_currency_id);
     $this->order_number = $order->order_number;
     $this->showPage('end');
 }
コード例 #23
0
ファイル: field.php プロジェクト: q0821/esportshop
 function parentfield()
 {
     $type = JRequest::getVar('type');
     $namekey = JRequest::getVar('namekey');
     $value = JRequest::getString('value');
     if (!empty($namekey) && !empty($type)) {
         $class = hikashop_get('class.field');
         $field = $class->getField($namekey, $type);
         echo $class->display($field, $value, 'field_options[parent_value]', false, '', true);
     }
     exit;
 }
コード例 #24
0
ファイル: country.php プロジェクト: rodhoff/MNW
 function displayStateDropDown($namekey, $field_id, $field_namekey, $field_type, $value = '', $field_options = array())
 {
     $this->type = 'state';
     $this->published = true;
     $this->country_name = $namekey;
     $states = $this->load();
     $obj = new stdClass();
     $obj->suffix = '';
     $obj->prefix = '';
     $obj->excludeValue = array();
     $fieldClass = hikashop_get('class.field');
     $dropdown = new hikashopSingledropdown($obj);
     $field = new stdClass();
     $field->field_namekey = $field_id;
     $statesArray = array();
     if (!empty($states)) {
         if (!empty($field_options) && is_string($field_options)) {
             $field_options = unserialize($field_options);
         }
         $pleaseSelect = !empty($field_options['pleaseselect']);
         if ($pleaseSelect) {
             $pleaseSelect = 0;
             $obj = new stdClass();
             $obj->disabled = '0';
             $obj->value = JText::_('PLEASE_SELECT_SOMETHING');
             $statesArray[''] = $obj;
         }
         foreach ($states as $state) {
             if (is_numeric($state->zone_name_english)) {
                 $title = $state->zone_name;
             } else {
                 $title = $state->zone_name_english;
                 if ($state->zone_name_english != $state->zone_name) {
                     $title .= ' (' . $state->zone_name . ')';
                 }
             }
             $obj = new stdClass();
             $obj->disabled = '0';
             $obj->value = $title;
             $statesArray[$state->zone_namekey] = $obj;
         }
     } else {
         $value = 'no_state_found';
     }
     $field->field_value = $statesArray;
     if (!empty($field_type)) {
         $name = 'data[' . $field_type . '][' . $field_namekey . ']';
     } else {
         $name = $field_namekey;
     }
     return $dropdown->display($field, $value, $name, '', '');
 }
コード例 #25
0
ファイル: selectproducts.php プロジェクト: rodhoff/MNW
 function fetchElement($name, $value, &$node, $control_name)
 {
     if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
         echo 'HikaShop is required';
         return;
     }
     if (!is_array($this->value)) {
         $this->value = array($this->value);
     }
     $nameboxType = hikashop_get('type.namebox');
     $select = '<div style="height:130px; margin-left:150px;">' . $nameboxType->display('jform[params][product_id]', $this->value, hikashopNameboxType::NAMEBOX_MULTIPLE, 'product', array('delete' => false, 'default_text' => '<em>' . JText::_('HIKA_NONE') . '</em>')) . '</div>';
     return $select;
 }
コード例 #26
0
ファイル: file.php プロジェクト: q0821/esportshop
 function resetdownload()
 {
     $download = hikashop_get('class.file');
     $download->resetdownload(JRequest::getInt('file_id'), JRequest::getInt('order_id'));
     $return = JRequest::getString('return');
     if (!empty($return)) {
         $url = base64_decode(urldecode($return));
         if (hikashop_disallowUrlRedirect($url)) {
             return false;
         }
         $this->setRedirect($url);
     }
 }
コード例 #27
0
ファイル: warehouse.php プロジェクト: q0821/esportshop
 function findValue()
 {
     $displayFormat = JRequest::getVar('displayFormat', '');
     $search = JRequest::getVar('search', null);
     $nameboxType = hikashop_get('type.namebox');
     $options = array('displayFormat' => $displayFormat);
     $ret = $nameboxType->getValues($search, $this->type, $options);
     if (!empty($ret)) {
         echo json_encode($ret);
         exit;
     }
     echo '[]';
     exit;
 }
コード例 #28
0
 /**
  */
 protected function getInput()
 {
     if (!isset($this->delete) || (string) @$this->delete == '1' || (string) @$this->delete == 'true') {
         $this->delete = true;
     } else {
         $this->delete = false;
     }
     if (!isset($this->default_text)) {
         $this->default_text = 'HIKA_NONE';
     }
     $nameboxType = hikashop_get('type.namebox');
     $html = $nameboxType->display($this->name, @$this->value, hikashopNameboxType::NAMEBOX_MULTIPLE, 'category', array('delete' => $this->delete, 'default_text' => '<em>' . JText::_($this->default_text) . '</em>'));
     return $html;
 }
コード例 #29
0
ファイル: waitlist.php プロジェクト: q0821/esportshop
 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;
 }
コード例 #30
0
ファイル: cron.php プロジェクト: q0821/esportshop
 function cron()
 {
     $config =& hikashop_config();
     if ($config->get('cron') == 'no') {
         hikashop_display(JText::_('CRON_DISABLED'), 'info');
         return false;
     }
     $cronHelper = hikashop_get('helper.cron');
     $cronHelper->report = true;
     $launched = $cronHelper->cron();
     if ($launched) {
         $cronHelper->report();
     }
 }