Пример #1
0
 /**
  * checkout function
  *
  * @access public
  * @return void
  */
 public function checkout()
 {
     $option = JRequest::getVar('option');
     $Itemid = JRequest::getVar('Itemid');
     $post = JRequest::get('post');
     $encr = JRequest::getVar('encr');
     $quotationHelper = new quotationHelper();
     $model = $this->getmodel();
     $session = JFactory::getSession();
     $redhelper = new redhelper();
     $cart = array();
     $cart['idx'] = 0;
     $session->set('cart', $cart);
     $quotationProducts = $quotationHelper->getQuotationProduct($post['quotation_id']);
     for ($q = 0; $q < count($quotationProducts); $q++) {
         $model->addtocart($quotationProducts[$q]);
     }
     $cart = $session->get('cart');
     $quotationDetail = $quotationHelper->getQuotationDetail($post['quotation_id']);
     $cart['customer_note'] = $quotationDetail->quotation_note;
     $cart['quotation_id'] = $quotationDetail->quotation_id;
     $cart['cart_discount'] = $quotationDetail->quotation_discount;
     $cart['quotation'] = 1;
     $session->set('cart', $cart);
     $model->modifyQuotation($quotationDetail->user_id);
     $Itemid = $redhelper->getCheckoutItemid();
     $this->setRedirect('index.php?option=' . $option . '&view=checkout&quotation=1&encr=' . $encr . '&Itemid=' . $Itemid);
 }
Пример #2
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARD_MANAGEMENT'), 'redshop_giftcard_48');
     $uri = JFactory::getURI();
     jimport('joomla.html.pane');
     $pane = JPane::getInstance('sliders');
     $this->pane = $pane;
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->giftcard_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARDS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_giftcard_48');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $lists['customer_amount'] = JHTML::_('select.booleanlist', 'customer_amount', 'class="inputbox" ', $detail->customer_amount);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     if (ECONOMIC_INTEGRATION == 1) {
         $redhelper = new redhelper();
         $accountgroup = $redhelper->getEconomicAccountGroup();
         $op = array();
         $op[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
         $accountgroup = array_merge($op, $accountgroup);
         $lists["accountgroup_id"] = JHTML::_('select.genericlist', $accountgroup, 'accountgroup_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->accountgroup_id);
     }
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #3
0
 function genMenuItem(&$row, $level, $pos)
 {
     global $urlpath;
     $app = JFactory::getApplication();
     $txt = '';
     $objhelper = new redhelper();
     $Itemid = JRequest::getInt('Itemid', '1');
     $cItemid = $objhelper->getCategoryItemid($row->id);
     if ($cItemid != "") {
         $tmpItemid = $cItemid;
     } else {
         $tmpItemid = $Itemid;
     }
     switch ($row->type) {
         case 'separator':
         case 'component_item_link':
             break;
         case 'content_item_link':
             $temp = split("&task=view&id=", $row->link);
             $row->link .= '&Itemid=' . $app->getItemid($temp[1]);
             break;
         case 'url':
             if (eregi('index.php\\?', $row->link)) {
                 if (!eregi('Itemid=', $row->link)) {
                     $row->link .= '&Itemid=' . $tmpItemid;
                 }
             }
             break;
         case 'content_typed':
         default:
             $row->link .= '&Itemid=' . $tmpItemid;
             break;
     }
     if (strcasecmp(substr($row->link, 0, 4), 'http')) {
         $row->link = JRoute::_($row->link);
     }
     if ($level) {
         $pmenu = "tmenu{$row->parent}";
         $active = 0;
         if (in_array($row->id, $this->parent->open)) {
             $active = 1;
         }
         $row->link = JRoute::_($row->link);
         echo "{$pmenu}.addItem(\"{$row->name}\", \"{$row->link}\", {$row->browserNav}, {$active});\n";
     } else {
         $pmenu = "ms";
     }
     $cmenu = "tmenu{$row->id}";
     $idmenu = "menu{$row->id}";
     if ($this->parent->hasSubItems($row->id)) {
         if ($level == 0) {
             echo "var {$cmenu} = " . $pmenu . ".addMenu(document.getElementById(\"{$idmenu}\"));\n";
         } else {
             echo "var {$cmenu} = " . $pmenu . ".addMenu(" . $pmenu . ".items[" . $pos . "]);\n";
         }
     }
 }
Пример #4
0
 function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0', $shopper_group_id)
 {
     static $ibg = 0;
     global $Itemid, $urlpath, $sortparam;
     $db = JFactory::getDbo();
     $objhelper = new redhelper();
     $Itemid = JRequest::getInt('Itemid');
     $level++;
     $redproduct_menu = new modProMenuHelper();
     if ($shopper_group_id) {
         $shoppergroup_cat = $redproduct_menu->get_shoppergroup_cat($shopper_group_id);
     }
     $query = "SELECT category_name as cname, category_id as cid, category_child_id as ccid FROM #__redshop_category as a " . "LEFT JOIN #__redshop_category_xref as b ON a.category_id=b.category_child_id " . "WHERE a.published=1 " . "AND b.category_parent_id=" . (int) $category_id;
     if ($shopper_group_id && count($shoppergroup_cat) > 0) {
         $query .= " and category_id in (" . $shoppergroup_cat[0] . ")";
     }
     $query .= " ORDER BY " . $sortparam . "";
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     if (!($categories == null)) {
         $i = 1;
         $numCategories = count($categories);
         foreach ($categories as $category) {
             $ibg++;
             $Treeid = $ibg;
             $cItemid = $objhelper->getCategoryItemid($category->cid);
             if ($cItemid != "") {
                 $tmpItemid = $cItemid;
             } else {
                 $tmpItemid = $Itemid;
             }
             $mymenu_content .= str_repeat("\t", $level - 1);
             if ($level > 1 && $i == 1) {
                 $mymenu_content .= ",";
             }
             $mymenu_content .= "['" . $category->cname;
             //$mymenu_content.= "','href='".JRoute::_($urlpath.'index.php?option=com_redshop&view=category&layout=detail&cid='.$category->cid.'&Treeid='.$Treeid.$itemid)."\''\n ";
             $mymenu_content .= "','href=\\'" . JRoute::_('index.php?option=com_redshop&view=category&layout=detail&cid=' . $category->cid . '&Treeid=' . $Treeid . '&Itemid=' . $tmpItemid) . "\\''\n ";
             /* recurse through the subcategories */
             $this->traverse_tree_down($mymenu_content, $category->ccid, $level, $shopper_group_id);
             $mymenu_content .= str_repeat("\t", $level - 1);
             /* let's see if the loop has reached its end */
             if ($i == sizeof($categories) && $level == 1) {
                 $mymenu_content .= "]\n";
             } else {
                 $mymenu_content .= "],\n";
             }
             $i++;
         }
     }
 }
Пример #5
0
 function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0', $params = '', $shopper_group_id)
 {
     static $ibg = 0;
     global $urlpath, $redproduct_menu;
     $db = JFactory::getDbo();
     $level++;
     $redproduct_menu = new modProMenuHelper();
     if ($params->get('categorysorttype') == "catnameasc") {
         $sortparam = "category_name ASC";
     }
     if ($params->get('categorysorttype') == "catnamedesc") {
         $sortparam = "category_name DESC";
     }
     if ($params->get('categorysorttype') == "newest") {
         $sortparam = "category_id DESC";
     }
     if ($params->get('categorysorttype') == "catorder") {
         $sortparam = "ordering ASC";
     }
     if ($shopper_group_id) {
         $shoppergroup_cat = $redproduct_menu->get_shoppergroup_cat($shopper_group_id);
     }
     $query = "SELECT category_name, category_id, category_child_id FROM #__redshop_category AS a " . "LEFT JOIN #__redshop_category_xref as b ON a.category_id=b.category_child_id " . "WHERE a.published='1' " . "AND b.category_parent_id= " . (int) $category_id;
     if ($shopper_group_id && count($shoppergroup_cat) > 0) {
         $query .= " and category_id IN(" . $shoppergroup_cat[0] . ")";
     }
     $query .= " ORDER BY " . $sortparam . "";
     //	."ORDER BY ".$sortparam."";
     $db->setQuery($query);
     $traverse_results = $db->loadObjectList();
     $objhelper = new redhelper();
     $Itemid = JRequest::getInt('Itemid');
     foreach ($traverse_results as $traverse_result) {
         $cItemid = $objhelper->getCategoryItemid($traverse_result->category_id);
         if ($cItemid != "") {
             $tmpItemid = $cItemid;
         } else {
             $tmpItemid = $Itemid;
         }
         if ($ibg != 0) {
             $mymenu_content .= ",";
         }
         $mymenu_content .= "\n[ '<img src=\"' + ctThemeXPBase + 'darrow.png\" alt=\"arr\" />','" . $traverse_result->category_name . "','" . JRoute::_('index.php?option=com_redshop&view=category&layout=detail&cid=' . $traverse_result->category_id . '&Itemid=' . $tmpItemid) . "',null,'" . $traverse_result->category_name . "'\n ";
         $ibg++;
         /* recurse through the subcategories */
         $this->traverse_tree_down($mymenu_content, $traverse_result->category_child_id, $level, $params, $shopper_group_id);
         /* let's see if the loop has reached its end */
         $mymenu_content .= "]";
     }
 }
Пример #6
0
 /**
  *  Setlogin function
  *
  * @return  void
  */
 public function setlogin()
 {
     $username = JRequest::getVar('username', '', 'method', 'username');
     $password = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
     $option = JRequest::getVar('option');
     $Itemid = JRequest::getVar('Itemid');
     $returnitemid = JRequest::getVar('returnitemid');
     $mywishlist = JRequest::getVar('mywishlist');
     $menu = JFactory::getApplication()->getMenu();
     $item = $menu->getItem($returnitemid);
     include_once JPATH_COMPONENT . '/helpers/helper.php';
     $redhelper = new redhelper();
     $model = $this->getModel('login');
     $shoppergroupid = JRequest::getInt('protalid', '', 'post', 0);
     $msg = "";
     if ($shoppergroupid != 0) {
         $check = $model->CheckShopperGroup($username, $shoppergroupid);
         $link = "index.php?option=" . $option . "&view=login&layout=portal&protalid=" . $shoppergroupid;
         if ($check > 0) {
             $model->setlogin($username, $password);
             $return = JRequest::getVar('return');
         } else {
             $msg = JText::_("COM_REDSHOP_SHOPPERGROUP_NOT_MATCH");
             $return = "";
         }
     } else {
         $model->setlogin($username, $password);
         $return = JRequest::getVar('return');
     }
     if ($mywishlist == 1) {
         $wishreturn = JRoute::_('index.php?loginwishlist=1&option=com_redshop&view=wishlist&Itemid=' . $Itemid, false);
         $this->setRedirect($wishreturn);
     } else {
         if ($item) {
             $link = $item->link . '&Itemid=' . $returnitemid;
         } else {
             $link = 'index.php?option=' . $option . '&Itemid=' . $returnitemid;
         }
         if (!empty($return)) {
             $s_Itemid = $redhelper->getCheckoutItemid();
             $Itemid = $s_Itemid ? $s_Itemid : $Itemid;
             $return = JRoute::_('index.php?option=com_redshop&view=checkout&Itemid=' . $Itemid, false);
             $this->setRedirect($return);
         } else {
             $this->setRedirect($link, $msg);
         }
     }
 }
Пример #7
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSHOP_STATE_DETAIL'), 'redshop_region_48');
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $model = $this->getModel('state_detail');
     JToolBarHelper::save();
     JToolBarHelper::apply();
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->state_id < 1;
     // 	fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_REDSHOP_THE_DETAIL'), $detail->title);
         $app->redirect('index.php?option=' . $option, $msg);
     }
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     $db = JFactory::getDbo();
     JToolBarHelper::title(JText::_('COM_REDSHOP_STATE') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_region_48');
     require_once JPATH_COMPONENT_SITE . '/helpers/helper.php';
     $redhelper = new redhelper();
     $q = "SELECT  country_id as value,country_name as text,country_jtext from #__" . TABLE_PREFIX . "_country ORDER BY country_name ASC";
     $db->setQuery($q);
     $countries = $db->loadObjectList();
     $countries = $redhelper->convertLanguageString($countries);
     $temps[0] = new stdClass();
     $temps[0]->value = "0";
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     $countries = array_merge($temps, $countries);
     $lists['country_id'] = JHTML::_('select.genericlist', $countries, 'country_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->country_id);
     $state_data = $redhelper->getStateAbbrivationByList();
     $lists['show_state'] = JHTML::_('select.genericlist', $state_data, 'show_state', 'class="inputbox" size="1" ', 'value', 'text', $detail->show_state);
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // EDIT - check out the item
         $model->checkout($user->get('id'));
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     JToolBarHelper::title(JText::_('COM_REDSHOP_state') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_region_48');
     $this->detail = $detail;
     $this->lists = $lists;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #8
0
 public function display($tpl = null)
 {
     JLoader::import('joomla.html.pagination');
     require_once JPATH_COMPONENT_SITE . '/helpers/helper.php';
     $context = 'state_id';
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $document->setTitle(JText::_('COM_REDSHOP_STATE'));
     JToolBarHelper::title(JText::_('COM_REDSHOP_STATE_MANAGEMENT'), 'redshop_region_48');
     JToolbarHelper::addNewX();
     JToolbarHelper::EditListX();
     JToolbarHelper::deleteList();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'state_id');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $db = JFactory::getDbo();
     JToolBarHelper::title(JText::_('COM_REDSHOP_STATES'), 'redshop_region_48');
     $redhelper = new redhelper();
     $q = "SELECT  country_id as value,country_name as text,country_jtext from #__" . TABLE_PREFIX . "_country ORDER BY country_name ASC";
     $db->setQuery($q);
     $countries = $db->loadObjectList();
     $countries = $redhelper->convertLanguageString($countries);
     $defSelect = new StdClass();
     $defSelect->value = "0";
     $defSelect->text = JText::_('COM_REDSHOP_SELECT');
     $temps = array($defSelect);
     $countries = array_merge($temps, $countries);
     $country_id_filter = $app->getUserStateFromRequest($context . 'country_id_filter', 'country_id_filter', '');
     $lists['country_id'] = JHTML::_('select.genericlist', $countries, 'country_id_filter', 'class="inputbox" size="1" onchange="document.adminForm.submit();"    ', 'value', 'text', $country_id_filter);
     $country_main_filter = $app->getUserStateFromRequest($context . 'country_main_filter', 'country_main_filter', '');
     $fields = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->country_main_filter = $country_main_filter;
     $this->user = JFactory::getUser();
     $this->pagination = $pagination;
     $this->fields = $fields;
     $this->lists = $lists;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
 public function save()
 {
     $post = JRequest::get('post');
     $option = JRequest::getVar('option');
     $redhelper = new redhelper();
     $cid = JRequest::getVar('cid', array(0), 'post', 'array');
     $post['order_status_id'] = $cid[0];
     $model = $this->getModel('orderstatus_detail');
     if ($model->store($post)) {
         $msg = JText::_('COM_REDSHOP_ORDERSTATUS_DETAIL_SAVED');
     } elseif (JFactory::getACL()) {
         $msg = JText::_('COM_REDSHOP_ORDERSTATUS_CODE_IS_ALLREADY');
     } else {
         $msg = JText::_('COM_REDSHOP_ERROR_SAVING_ORDERSTATUS_DETAIL');
     }
     $link = 'index.php?option=' . $option . '&view=orderstatus';
     $link = $redhelper->sslLink($link, 0);
     $this->setRedirect($link, $msg);
 }
Пример #10
0
 private static function getProductDetail($id)
 {
     $component = JComponentHelper::getComponent("com_redshop");
     if (!isset($component->id)) {
         JError::raiseError('500', 'redShop Component is not installed');
     }
     if (!defined('TABLE_PREFIX')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
     }
     require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
     $objhelper = new redhelper();
     $producthelper = new producthelper();
     $ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $id);
     if (count($ItemData) > 0) {
         $pItemid = $ItemData->id;
     } else {
         $pItemid = $objhelper->getItemid($id);
     }
     $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $id . '&Itemid=' . $pItemid);
     $product = $producthelper->getProductById($id);
     $product->product_price = $producthelper->getProductPrice($id);
     $product->link = $link;
     return $product;
 }
Пример #11
0
 /**
  * Load the attributes for export
  *
  * @return  void
  */
 private function loadAttributes()
 {
     $producthelper = new producthelper();
     $db = JFactory::getDbo();
     $query = "SELECT * FROM `#__redshop_product` ORDER BY product_id asc ";
     $this->_db->setQuery($query);
     $cur = $this->_db->loadObjectList();
     $ret = null;
     if (count($cur) > 0) {
         $redhelper = new redhelper();
         $isrecrm = false;
         if ($redhelper->isredCRM()) {
             $isrecrm = true;
         }
         for ($i = 0; $i < count($cur); $i++) {
             if ($i == 0) {
                 echo '"product_number","attribute_name","attribute_ordering","allow_multiple_selection","hide_attribute_price","attribute_required","display_type","property_name","property_stock"';
                 if ($isrecrm) {
                     echo ',"property_stock_placement"';
                 }
                 echo ',"property_ordering","property_virtual_number","setdefault_selected","setdisplay_type","oprand","property_price","property_image","property_main_image","subattribute_color_name","subattribute_stock"';
                 if ($isrecrm) {
                     echo ',"subattribute_stock_placement"';
                 }
                 echo ',"subattribute_color_ordering","subattribute_setdefault_selected","subattribute_color_title","subattribute_virtual_number","subattribute_color_oprand","required_sub_attribute","subattribute_color_price","subattribute_color_image","delete"';
                 echo "\r\n";
             }
             // Added attribute of products
             $attribute = $producthelper->getProductAttribute($cur[$i]->product_id);
             $attr = array();
             for ($att = 0; $att < count($attribute); $att++) {
                 if ($attribute[$att]->attribute_name != "") {
                     echo '"' . $cur[$i]->product_number . '","' . $attribute[$att]->attribute_name . '","' . $attribute[$att]->ordering . '","' . $attribute[$att]->allow_multiple_selection . '","' . $attribute[$att]->hide_attribute_price . '","' . $attribute[$att]->attribute_required . '","' . $attribute[$att]->display_type . '"';
                     if ($isrecrm) {
                         echo ',,';
                     }
                     echo ',,,,,,,,,,,,,,,,"0"';
                     echo "\r\n";
                     $att_property = $producthelper->getAttibuteProperty(0, $attribute[$att]->attribute_id);
                     for ($prop = 0; $prop < count($att_property); $prop++) {
                         $property_image = "";
                         $property_main_image = "";
                         $main_attribute_stock = "";
                         $sel_arrtibute_stock = "select * from `#__redshop_product_attribute_stockroom_xref` where section_id='" . $att_property[$prop]->property_id . "'";
                         $this->_db->setQuery($sel_arrtibute_stock);
                         $fetch_arrtibute_stock = $this->_db->loadObjectList();
                         for ($h = 0; $h < count($fetch_arrtibute_stock); $h++) {
                             $main_attribute_stock .= $fetch_arrtibute_stock[$h]->stockroom_id . ":" . $fetch_arrtibute_stock[$h]->quantity . "#";
                         }
                         if ($att_property[$prop]->property_image != "") {
                             $property_image = REDSHOP_FRONT_IMAGES_ABSPATH . 'product_attributes/' . $att_property[$prop]->property_image;
                         }
                         if ($att_property[$prop]->property_main_image != "") {
                             $property_main_image = REDSHOP_FRONT_IMAGES_ABSPATH . 'property/' . $att_property[$prop]->property_main_image;
                         }
                         echo '"' . $cur[$i]->product_number . '","' . $attribute[$att]->attribute_name . '",,,,,,"' . $att_property[$prop]->property_name . '","' . $main_attribute_stock . '"';
                         if ($isrecrm) {
                             $main_attribute_stock_placement = "";
                             // Initialiase variables.
                             $query = $this->_db->getQuery(true);
                             // Prepare query.
                             $query->select('stock_placement');
                             $query->from('#__redcrm_attribute_stock_placement');
                             $query->where('section = "property"');
                             $query->where('section_id = "' . $att_property[$prop]->property_id . '"');
                             // Inject the query and load the result.
                             $this->_db->setQuery($query);
                             $main_attribute_stock_placement = $this->_db->loadResult();
                             echo ',"' . $main_attribute_stock_placement . '"';
                         }
                         echo ',"' . $att_property[$prop]->ordering . '","' . $att_property[$prop]->property_number . '","' . $att_property[$prop]->setdefault_selected . '","' . $att_property[$prop]->setdisplay_type . '","' . $att_property[$prop]->oprand . '","' . $att_property[$prop]->property_price . '","' . $property_image . '","' . $property_main_image . '"';
                         if ($isrecrm) {
                             echo ',';
                         }
                         echo ',,,,,,,,,"0"';
                         echo "\n";
                         $subatt_property = $producthelper->getAttibuteSubProperty(0, $att_property[$prop]->property_id);
                         for ($subprop = 0; $subprop < count($subatt_property); $subprop++) {
                             $subattribute_color_image = "";
                             $main_attribute_stock_sub = "";
                             $sel_arrtibute_stock_sub = "select * from `#__redshop_product_attribute_stockroom_xref` where section_id='" . $subatt_property[$subprop]->subattribute_color_id . "'";
                             $this->_db->setQuery($sel_arrtibute_stock_sub);
                             $fetch_arrtibute_stock_sub = $this->_db->loadObjectList();
                             for ($b = 0; $b < count($fetch_arrtibute_stock_sub); $b++) {
                                 $main_attribute_stock_sub .= $fetch_arrtibute_stock_sub[$b]->stockroom_id . ":" . $fetch_arrtibute_stock_sub[$b]->quantity . "#";
                             }
                             if ($subatt_property[$subprop]->subattribute_color_image != "") {
                                 $subattribute_color_image = REDSHOP_FRONT_IMAGES_ABSPATH . 'subcolor/' . $subatt_property[$subprop]->subattribute_color_image;
                             }
                             echo '"' . $cur[$i]->product_number . '","' . $attribute[$att]->attribute_name . '",,,,,,"' . $att_property[$prop]->property_name . '"';
                             if ($isrecrm) {
                                 echo ',';
                             }
                             echo ',,,,,,,,,,"' . $subatt_property[$subprop]->subattribute_color_name . '","' . $main_attribute_stock_sub . '"';
                             if ($isrecrm) {
                                 $main_attribute_stock_sub_placement = "";
                                 // Initialiase variables.
                                 $query = $this->_db->getQuery(true);
                                 // Prepare query.
                                 $query->select('stock_placement');
                                 $query->from('#__redcrm_attribute_stock_placement');
                                 $query->where('section = "subproperty"');
                                 $query->where('section_id = "' . $subatt_property[$subprop]->subattribute_color_id . '"');
                                 // Inject the query and load the result.
                                 $this->_db->setQuery($query);
                                 $main_attribute_stock_sub_placement = $this->_db->loadResult();
                                 echo ',"' . $main_attribute_stock_sub_placement . '"';
                             }
                             echo ',"' . $subatt_property[$subprop]->ordering . '","' . $subatt_property[$subprop]->setdefault_selected . '","' . $subatt_property[$subprop]->subattribute_color_title . '","' . $subatt_property[$subprop]->subattribute_color_number . '","' . $subatt_property[$subprop]->oprand . '","' . $att_property[$prop]->setrequire_selected . '","' . $subatt_property[$subprop]->subattribute_color_price . '","' . $subattribute_color_image . '","0"';
                             echo "\n";
                         }
                     }
                 }
             }
         }
     }
 }
Пример #12
0
				</tr>

				<?php 
if ($this->detail->product_id > 0) {
    ?>
					<?php 
    /*
     * @ToDo Seams to be that this mess outputs product's frontend link.
     * @ToDo Examine if there is better, more optimized way to obtain this link.
     */
    $ItemData = $this->producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $this->detail->product_id);
    $catidmain = $this->detail->first_selected_category_id;
    if (count($ItemData) > 0) {
        $pItemid = $ItemData->id;
    } else {
        $objhelper = new redhelper();
        $pItemid = $objhelper->getItemid($this->detail->product_id, $catidmain);
    }
    $link = JURI::root();
    $link .= 'index.php?option=' . $this->option;
    $link .= '&view=product&pid=' . $this->detail->product_id;
    $link .= '&cid=' . $catidmain;
    $link .= '&Itemid=' . $pItemid;
    ?>

					<tr>
						<td class="key">
							<label>
								<?php 
    echo JText::_('COM_REDSHOP_FRONTEND_LINK');
    ?>
Пример #13
0
/**
 * @package     RedSHOP.Frontend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
JHTML::_('behavior.tooltip');
JHTMLBehavior::modal();
$url = JURI::base();
$extraField = new extraField();
$extra_field = new extra_field();
$producthelper = new producthelper();
$redTemplate = new Redtemplate();
$redhelper = new redhelper();
$Itemid = JRequest::getInt('Itemid');
$model = $this->getModel('manufacturers');
// Page Title Start
$pagetitle = JText::_('COM_REDSHOP_MANUFACTURER_DETAIL');
if ($this->pageheadingtag != '') {
    $pagetitle = $this->pageheadingtag;
}
if ($this->params->get('show_page_heading', 1)) {
    ?>
	<h1 class="componentheading<?php 
    echo $this->escape($this->params->get('pageclass_sfx'));
    ?>
">
		<?php 
    if ($this->params->get('page_title') != $pagetitle) {
Пример #14
0
 public function countryList()
 {
     $db = JFactory::getDbo();
     if (empty($this->_country_list)) {
         require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
         $redhelper = new redhelper();
         $countries = array();
         if (COUNTRY_LIST) {
             $country_list = explode(',', COUNTRY_LIST);
             if (count($country_list) > 0) {
                 // Sanitize country list
                 $sanitizedCountryArray = array();
                 foreach ($country_list as &$countryCode) {
                     $countryCode = $db->quote($countryCode);
                 }
                 $q = 'SELECT country_3_code AS value,country_name AS text,country_jtext FROM ' . $this->_table_prefix . 'country ' . 'WHERE country_3_code IN (' . implode(",", $country_list) . ') ' . 'ORDER BY country_name ASC';
                 $this->_db->setQuery($q);
                 $countries = $this->_db->loadObjectList();
                 $countries = $redhelper->convertLanguageString($countries);
             }
         }
         $this->_country_list = $countries;
     }
     return $this->_country_list;
 }
Пример #15
0
<?php

/**
 * @package     RedSHOP.Frontend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php';
include_once JPATH_COMPONENT . '/helpers/helper.php';
$configobj = new Redconfiguration();
$order_functions = new order_functions();
$redhelper = new redhelper();
$url = JURI::base();
$Itemid = $redhelper->getCheckoutItemid();
$order_id = JRequest::getInt('oid');
$order = $order_functions->getOrderDetails($order_id);
$orderitem = $order_functions->getOrderItemDetail($order_id);
if ($order->order_total > 0 && !USE_AS_CATALOG) {
    $paymentmethod = $order_functions->getOrderPaymentDetail($order_id);
    $paymentmethod = $order_functions->getPaymentMethodInfo($paymentmethod[0]->payment_method_class);
    $paymentmethod = $paymentmethod[0];
    $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '/' . $paymentmethod->element . '.xml';
    $paymentparams = new JRegistry($paymentmethod->params);
    echo '<div>';
    $is_creditcard = $paymentparams->get('is_creditcard', '');
    $is_redirected = $paymentparams->get('is_redirected', 0);
    if (!$is_creditcard || $is_redirected == 1) {
        $adminpath = JPATH_ADMINISTRATOR . '/components/com_redshop';
Пример #16
0
 public function store($postdata)
 {
     $redshopMail = new redshopMail();
     $order_functions = new order_functions();
     $helper = new redhelper();
     $producthelper = new producthelper();
     $rsCarthelper = new rsCarthelper();
     $shippinghelper = new shipping();
     $adminproducthelper = new adminproducthelper();
     $stockroomhelper = new rsstockroomhelper();
     // For barcode generation
     $barcode_code = $order_functions->barcode_randon_number(12, 0);
     $postdata['barcode'] = $barcode_code;
     $row = $this->getTable('order_detail');
     if (!$row->bind($postdata)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     if (!$row->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     $iscrm = $helper->isredCRM();
     if ($iscrm) {
         $postdata['order_id'] = $row->order_id;
         $postdata['debitor_id'] = $postdata['user_info_id'];
         JTable::addIncludePath(REDCRM_ADMIN . '/tables');
         $crmorder =& $this->getTable('crm_order');
         if (!$crmorder->bind($postdata)) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
         if (!$crmorder->store()) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
         // Update rma table entry
         if (ENABLE_RMA && isset($postdata['rmanotes'])) {
             $rmaInfo = $this->getTable('rma_orders');
             $rmaInfo->rma_number = $postdata['rma_number'];
             $rmaInfo->original_order_id = $postdata['main_order_id'];
             $rmaInfo->credit_note_order_id = $row->order_id;
             $rmaInfo->rma_note = $postdata['rmanotes'];
             $rmaInfo->store();
         }
         JTable::addIncludePath(REDSHOP_ADMIN . '/tables');
     }
     $order_shipping = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $row->ship_method_id)));
     $rowOrderStatus =& $this->getTable('order_status_log');
     $rowOrderStatus->order_id = $row->order_id;
     $rowOrderStatus->order_status = $row->order_status;
     $rowOrderStatus->date_changed = time();
     $rowOrderStatus->customer_note = $row->customer_note;
     $rowOrderStatus->store();
     $billingaddresses = $order_functions->getBillingAddress($row->user_id);
     if (isset($postdata['billisship']) && $postdata['billisship'] == 1) {
         $shippingaddresses = $billingaddresses;
     } else {
         $key = 0;
         $shippingaddresses = $order_functions->getShippingAddress($row->user_id);
         $shipp_users_info_id = isset($postdata['shipp_users_info_id']) && $postdata['shipp_users_info_id'] != 0 ? $postdata['shipp_users_info_id'] : 0;
         if ($shipp_users_info_id != 0) {
             for ($o = 0; $o < count($shippingaddresses); $o++) {
                 if ($shippingaddresses[$o]->users_info_id == $shipp_users_info_id) {
                     $key = $o;
                     break;
                 }
             }
         }
         $shippingaddresses = $shippingaddresses[$key];
     }
     // ORDER DELIVERY TIME IS REMAINING
     $user_id = $row->user_id;
     $item = $postdata['order_item'];
     for ($i = 0; $i < count($item); $i++) {
         $product_id = $item[$i]->product_id;
         $quantity = $item[$i]->quantity;
         $product_excl_price = $item[$i]->prdexclprice;
         $product_price = $item[$i]->productprice;
         // Attribute price added
         $generateAttributeCart = $rsCarthelper->generateAttributeArray((array) $item[$i], $user_id);
         $retAttArr = $producthelper->makeAttributeCart($generateAttributeCart, $product_id, $user_id, 0, $quantity);
         $product_attribute = $retAttArr[0];
         // Accessory price
         $generateAccessoryCart = $rsCarthelper->generateAccessoryArray((array) $item[$i], $user_id);
         $retAccArr = $producthelper->makeAccessoryCart($generateAccessoryCart, $product_id, $user_id);
         $product_accessory = $retAccArr[0];
         $accessory_total_price = $retAccArr[1];
         $accessory_vat_price = $retAccArr[2];
         $wrapper_price = 0;
         $wrapper_vat = 0;
         if ($item[$i]->wrapper_data != 0 && $item[$i]->wrapper_data != '') {
             $wrapper = $producthelper->getWrapper($product_id, $item[$i]->wrapper_data);
             if (count($wrapper) > 0) {
                 if ($wrapper[0]->wrapper_price > 0) {
                     $wrapper_vat = $producthelper->getProducttax($product_id, $wrapper[0]->wrapper_price, $user_id);
                 }
                 $wrapper_price = $wrapper[0]->wrapper_price + $wrapper_vat;
             }
         }
         $product = $producthelper->getProductById($product_id);
         $rowitem =& $this->getTable('order_item_detail');
         if (!$rowitem->bind($postdata)) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
         // STOCKROOM update
         $updatestock = $stockroomhelper->updateStockroomQuantity($product_id, $quantity);
         $stockroom_id_list = $updatestock['stockroom_list'];
         $stockroom_quantity_list = $updatestock['stockroom_quantity_list'];
         $rowitem->stockroom_id = $stockroom_id_list;
         $rowitem->stockroom_quantity = $stockroom_quantity_list;
         $rowitem->order_item_id = 0;
         $rowitem->order_id = $row->order_id;
         $rowitem->user_info_id = $row->user_info_id;
         $rowitem->supplier_id = $product->manufacturer_id;
         $rowitem->product_id = $product_id;
         $rowitem->order_item_sku = $product->product_number;
         $rowitem->order_item_name = $product->product_name;
         $rowitem->product_quantity = $quantity;
         $rowitem->product_item_price = $product_price;
         $rowitem->product_item_price_excl_vat = $product_excl_price;
         $rowitem->product_final_price = $product_price * $quantity;
         $rowitem->order_item_currency = REDCURRENCY_SYMBOL;
         $rowitem->order_status = $row->order_status;
         $rowitem->cdate = $row->cdate;
         $rowitem->mdate = $row->cdate;
         $rowitem->product_attribute = $product_attribute;
         $rowitem->product_accessory = $product_accessory;
         $rowitem->wrapper_id = $item[$i]->wrapper_data;
         $rowitem->wrapper_price = $wrapper_price;
         $rowitem->is_giftcard = 0;
         // RedCRM product purchase price
         if ($iscrm) {
             $crmProductHelper = new crmProductHelper();
             $crmproduct = $crmProductHelper->getProductById($product_id);
             $rowitem->product_purchase_price = $crmproduct->product_purchase_price > 0 ? $crmproduct->product_purchase_price : $crmproduct->product_price;
         }
         if ($producthelper->checkProductDownload($product_id)) {
             $medianame = $producthelper->getProductMediaName($product_id);
             for ($j = 0; $j < count($medianame); $j++) {
                 $product_serial_number = $producthelper->getProdcutSerialNumber($product_id);
                 $producthelper->insertProductDownload($product_id, $user_id, $rowitem->order_id, $medianame[$j]->media_name, $product_serial_number->serial_number);
             }
         }
         if (!$rowitem->store()) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
         /** my accessory save in table start */
         if (count($generateAccessoryCart) > 0) {
             $attArr = $generateAccessoryCart;
             for ($a = 0; $a < count($attArr); $a++) {
                 $accessory_vat_price = 0;
                 $accessory_attribute = "";
                 $accessory_id = $attArr[$a]['accessory_id'];
                 $accessory_name = $attArr[$a]['accessory_name'];
                 $accessory_price = $attArr[$a]['accessory_price'];
                 $accessory_org_price = $accessory_price;
                 if ($accessory_price > 0) {
                     $accessory_vat_price = $producthelper->getProductTax($product_id, $accessory_price, $user_id);
                 }
                 $attchildArr = $attArr[$a]['accessory_childs'];
                 for ($j = 0; $j < count($attchildArr); $j++) {
                     $attribute_id = $attchildArr[$j]['attribute_id'];
                     $accessory_attribute .= urldecode($attchildArr[$j]['attribute_name']) . ":<br/>";
                     $rowattitem =& $this->getTable('order_attribute_item');
                     $rowattitem->order_att_item_id = 0;
                     $rowattitem->order_item_id = $rowitem->order_item_id;
                     $rowattitem->section_id = $attribute_id;
                     $rowattitem->section = "attribute";
                     $rowattitem->parent_section_id = $accessory_id;
                     $rowattitem->section_name = $attchildArr[$j]['attribute_name'];
                     $rowattitem->is_accessory_att = 1;
                     if ($attribute_id > 0) {
                         if (!$rowattitem->store()) {
                             $this->setError($this->_db->getErrorMsg());
                             return false;
                         }
                     }
                     $propArr = $attchildArr[$j]['attribute_childs'];
                     for ($k = 0; $k < count($propArr); $k++) {
                         $section_vat = 0;
                         if ($propArr[$k]['property_price'] > 0) {
                             $section_vat = $producthelper->getProducttax($product_id, $propArr[$k]['property_price'], $user_id);
                         }
                         $property_id = $propArr[$k]['property_id'];
                         $accessory_attribute .= urldecode($propArr[$k]['property_name']) . " (" . $propArr[$k]['property_oprand'] . $producthelper->getProductFormattedPrice($propArr[$k]['property_price'] + $section_vat) . ")<br/>";
                         $subpropArr = $propArr[$k]['property_childs'];
                         $rowattitem =& $this->getTable('order_attribute_item');
                         $rowattitem->order_att_item_id = 0;
                         $rowattitem->order_item_id = $rowitem->order_item_id;
                         $rowattitem->section_id = $property_id;
                         $rowattitem->section = "property";
                         $rowattitem->parent_section_id = $attribute_id;
                         $rowattitem->section_name = $propArr[$k]['property_name'];
                         $rowattitem->section_price = $propArr[$k]['property_price'];
                         $rowattitem->section_vat = $section_vat;
                         $rowattitem->section_oprand = $propArr[$k]['property_oprand'];
                         $rowattitem->is_accessory_att = 1;
                         if ($property_id > 0) {
                             if (!$rowattitem->store()) {
                                 $this->setError($this->_db->getErrorMsg());
                                 return false;
                             }
                         }
                         for ($l = 0; $l < count($subpropArr); $l++) {
                             $section_vat = 0;
                             if ($subpropArr[$l]['subproperty_price'] > 0) {
                                 $section_vat = $producthelper->getProducttax($rowitem->product_id, $subpropArr[$l]['subproperty_price'], $user_id);
                             }
                             $subproperty_id = $subpropArr[$l]['subproperty_id'];
                             $accessory_attribute .= urldecode($subpropArr[$l]['subproperty_name']) . " (" . $subpropArr[$l]['subproperty_oprand'] . $producthelper->getProductFormattedPrice($subpropArr[$l]['subproperty_price'] + $section_vat) . ")<br/>";
                             $rowattitem =& $this->getTable('order_attribute_item');
                             $rowattitem->order_att_item_id = 0;
                             $rowattitem->order_item_id = $rowitem->order_item_id;
                             $rowattitem->section_id = $subproperty_id;
                             $rowattitem->section = "subproperty";
                             $rowattitem->parent_section_id = $property_id;
                             $rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
                             $rowattitem->section_price = $subpropArr[$l]['subproperty_price'];
                             $rowattitem->section_vat = $section_vat;
                             $rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand'];
                             $rowattitem->is_accessory_att = 1;
                             if ($subproperty_id > 0) {
                                 if (!$rowattitem->store()) {
                                     $this->setError($this->_db->getErrorMsg());
                                     return false;
                                 }
                             }
                         }
                     }
                 }
                 $accdata =& $this->getTable('accessory_detail');
                 if ($accessory_id > 0) {
                     $accdata->load($accessory_id);
                 }
                 $accProductinfo = $producthelper->getProductById($accdata->child_product_id);
                 $rowaccitem =& $this->getTable('order_acc_item');
                 $rowaccitem->order_item_acc_id = 0;
                 $rowaccitem->order_item_id = $rowitem->order_item_id;
                 $rowaccitem->product_id = $accessory_id;
                 $rowaccitem->order_acc_item_sku = $accProductinfo->product_number;
                 $rowaccitem->order_acc_item_name = $accessory_name;
                 $rowaccitem->order_acc_price = $accessory_org_price;
                 $rowaccitem->order_acc_vat = $accessory_vat_price;
                 $rowaccitem->product_quantity = $quantity;
                 $rowaccitem->product_acc_item_price = $accessory_price;
                 $rowaccitem->product_acc_final_price = $accessory_price * $quantity;
                 $rowaccitem->product_attribute = $accessory_attribute;
                 if ($accessory_id > 0) {
                     if (!$rowaccitem->store()) {
                         $this->setError($this->_db->getErrorMsg());
                         return false;
                     }
                 }
             }
         }
         /** my attribute save in table start */
         if (count($generateAttributeCart) > 0) {
             $attArr = $generateAttributeCart;
             for ($j = 0; $j < count($attArr); $j++) {
                 $attribute_id = $attArr[$j]['attribute_id'];
                 $rowattitem =& $this->getTable('order_attribute_item');
                 $rowattitem->order_att_item_id = 0;
                 $rowattitem->order_item_id = $rowitem->order_item_id;
                 $rowattitem->section_id = $attribute_id;
                 $rowattitem->section = "attribute";
                 $rowattitem->parent_section_id = $rowitem->product_id;
                 $rowattitem->section_name = $attArr[$j]['attribute_name'];
                 $rowattitem->is_accessory_att = 0;
                 if ($attribute_id > 0) {
                     if (!$rowattitem->store()) {
                         $this->setError($this->_db->getErrorMsg());
                         return false;
                     }
                 }
                 $propArr = $attArr[$j]['attribute_childs'];
                 for ($k = 0; $k < count($propArr); $k++) {
                     $section_vat = 0;
                     if ($propArr[$k]['property_price'] > 0) {
                         $section_vat = $producthelper->getProducttax($rowitem->product_id, $propArr[$k]['property_price'], $user_id);
                     }
                     $property_id = $propArr[$k]['property_id'];
                     /** product property STOCKROOM update start */
                     $updatestock = $stockroomhelper->updateStockroomQuantity($property_id, $quantity, "property");
                     $rowattitem =& $this->getTable('order_attribute_item');
                     $rowattitem->order_att_item_id = 0;
                     $rowattitem->order_item_id = $rowitem->order_item_id;
                     $rowattitem->section_id = $property_id;
                     $rowattitem->section = "property";
                     $rowattitem->parent_section_id = $attribute_id;
                     $rowattitem->section_name = $propArr[$k]['property_name'];
                     $rowattitem->section_price = $propArr[$k]['property_price'];
                     $rowattitem->section_vat = $section_vat;
                     $rowattitem->section_oprand = $propArr[$k]['property_oprand'];
                     $rowattitem->is_accessory_att = 0;
                     if ($property_id > 0) {
                         if (!$rowattitem->store()) {
                             $this->setError($this->_db->getErrorMsg());
                             return false;
                         }
                     }
                     $subpropArr = $propArr[$k]['property_childs'];
                     for ($l = 0; $l < count($subpropArr); $l++) {
                         $section_vat = 0;
                         if ($subpropArr[$l]['subproperty_price'] > 0) {
                             $section_vat = $producthelper->getProducttax($product_id, $subpropArr[$l]['subproperty_price'], $user_id);
                         }
                         $subproperty_id = $subpropArr[$l]['subproperty_id'];
                         /** product subproperty STOCKROOM update start */
                         $updatestock = $stockroomhelper->updateStockroomQuantity($subproperty_id, $quantity, "subproperty");
                         $rowattitem =& $this->getTable('order_attribute_item');
                         $rowattitem->order_att_item_id = 0;
                         $rowattitem->order_item_id = $rowitem->order_item_id;
                         $rowattitem->section_id = $subproperty_id;
                         $rowattitem->section = "subproperty";
                         $rowattitem->parent_section_id = $property_id;
                         $rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
                         $rowattitem->section_price = $subpropArr[$l]['subproperty_price'];
                         $rowattitem->section_vat = $section_vat;
                         $rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand'];
                         $rowattitem->is_accessory_att = 0;
                         if ($subproperty_id > 0) {
                             if (!$rowattitem->store()) {
                                 $this->setError($this->_db->getErrorMsg());
                                 return false;
                             }
                         }
                     }
                 }
             }
         }
         //			$producthelper->insertProdcutUserfield($i,$item,$rowitem->order_item_id,12);
         if (USE_CONTAINER) {
             $producthelper->updateContainerStock($product_id, $quantity, $rowitem->container_id);
         }
         // Store userfields
         $userfields = $item[$i]->extrafieldname;
         $userfields_id = $item[$i]->extrafieldId;
         for ($ui = 0; $ui < count($userfields); $ui++) {
             $adminproducthelper->admin_insertProdcutUserfield($userfields_id[$ui], $rowitem->order_item_id, 12, $userfields[$ui]);
         }
         // redCRM RMA Transaction Entry
         if ($iscrm) {
             if (ENABLE_RMA && $rowitem->product_final_price < 0) {
                 // RMA transation log
                 if (isset($item[$i]->reason)) {
                     $rmaTrans =& $this->getTable('rma_transaction');
                     $rmaTrans->rma_transaction_id = 0;
                     $rmaTrans->rma_number = $postdata['rma_number'];
                     $rmaTrans->order_item_return_id = $rowitem->order_item_id;
                     $rmaTrans->order_item_return_reason = $item[$i]->reason;
                     $rmaTrans->order_item_return_status = $item[$i]->deposition;
                     $rmaTrans->order_item_return_action = $item[$i]->action;
                     $rmaTrans->cdate = time();
                     $rmaTrans->store();
                     if (ENABLE_ITEM_TRACKING_SYSTEM) {
                         // Manage supplier order stock
                         $crmSupplierOrderHelper = new crmSupplierOrderHelper();
                         $senddata['main_order_number'] = $postdata['main_order_number'];
                         $senddata['order_status'] = $row->order_status;
                         $senddata['product_id'] = $rowitem->product_id;
                         $senddata['property_id'] = $property_id;
                         $senddata['subproperty_id'] = $subproperty_id;
                         $senddata['deposition'] = $item[$i]->deposition;
                         $itemqty = $rowitem->product_quantity;
                         for ($r = 0; $r < $itemqty; $r++) {
                             $crmSupplierOrderHelper->manageStockAffectedRMA($senddata);
                         }
                     }
                 }
             }
         }
     }
     $rowpayment =& $this->getTable('order_payment');
     if (!$rowpayment->bind($postdata)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     $rowpayment->order_id = $row->order_id;
     $rowpayment->payment_method_id = $postdata['payment_method_class'];
     $rowpayment->order_payment_amount = $row->order_total;
     $rowpayment->order_payment_name = $postdata['order_payment_name'];
     $rowpayment->payment_method_class = $postdata['payment_method_class'];
     if (!$rowpayment->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Add billing Info
     $userrow =& $this->getTable('user_detail');
     $userrow->load($billingaddresses->users_info_id);
     $orderuserrow =& $this->getTable('order_user_detail');
     if (!$orderuserrow->bind($userrow)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     $orderuserrow->order_id = $row->order_id;
     $orderuserrow->address_type = 'BT';
     if (!$orderuserrow->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Add shipping Info
     $userrow =& $this->getTable('user_detail');
     if (isset($shippingaddresses->users_info_id)) {
         $userrow->load($shippingaddresses->users_info_id);
     }
     $orderuserrow =& $this->getTable('order_user_detail');
     if (!$orderuserrow->bind($userrow)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     $orderuserrow->order_id = $row->order_id;
     $orderuserrow->address_type = 'ST';
     if (!$orderuserrow->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     if ($row->order_status == CLICKATELL_ORDER_STATUS) {
         $helper->clickatellSMS($row->order_id);
     }
     // Maintan supplier order stck when item tracking system is enabled
     if ($helper->isredCRM()) {
         if (ENABLE_ITEM_TRACKING_SYSTEM) {
             // Supplier order helper object
             $crmSupplierOrderHelper = new crmSupplierOrderHelper();
             $getStatus = array();
             $getStatus['orderstatus'] = $row->order_status;
             $getStatus['paymentstatus'] = $row->order_payment_status;
             $crmSupplierOrderHelper->redSHOPOrderUpdate($row->order_id, $getStatus);
             unset($getStatus);
         }
     }
     $checkOrderStatus = 1;
     if ($postdata['payment_method_class'] == "rs_payment_banktransfer" || $postdata['payment_method_class'] == "rs_payment_banktransfer_discount" || $postdata['payment_method_class'] == "rs_payment_banktransfer2" || $postdata['payment_method_class'] == "rs_payment_banktransfer3" || $postdata['payment_method_class'] == "rs_payment_banktransfer4" || $postdata['payment_method_class'] == "rs_payment_banktransfer5") {
         $checkOrderStatus = 0;
     }
     // Economic Integration start for invoice generate and book current invoice
     if (ECONOMIC_INTEGRATION == 1 && ECONOMIC_INVOICE_DRAFT != 2) {
         $issplit = 0;
         $economic = new economic();
         if (isset($postdata['issplit']) && $postdata['issplit'] == 1) {
             $issplit = 1;
         }
         $economicdata['split_payment'] = $issplit;
         $economicdata['economic_payment_terms_id'] = $postdata['economic_payment_terms_id'];
         $economicdata['economic_design_layout'] = $postdata['economic_design_layout'];
         $economicdata['economic_is_creditcard'] = $postdata['economic_is_creditcard'];
         $payment_name = $postdata['payment_method_class'];
         $paymentArr = explode("rs_payment_", $postdata['payment_method_class']);
         if (count($paymentArr) > 0) {
             $payment_name = $paymentArr[1];
         }
         $economicdata['economic_payment_method'] = $payment_name;
         $invoiceHandle = $economic->createInvoiceInEconomic($row->order_id, $economicdata);
         if (ECONOMIC_INVOICE_DRAFT == 0) {
             $bookinvoicepdf = $economic->bookInvoiceInEconomic($row->order_id, $checkOrderStatus);
             if (is_file($bookinvoicepdf)) {
                 $ret = $redshopMail->sendEconomicBookInvoiceMail($row->order_id, $bookinvoicepdf);
             }
         }
     }
     // ORDER MAIL SEND
     if ($postdata['task'] != "save_without_sendmail") {
         $redshopMail->sendOrderMail($row->order_id);
     }
     return $row;
 }
Пример #17
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $redTemplate = new Redtemplate();
     $lists = array();
     $uri = JFactory::getURI();
     $params = $app->getParams('com_redshop');
     $document = JFactory::getDocument();
     $layout = JRequest::getCmd('layout', '');
     $model = $this->getModel('search');
     if ($layout == 'default') {
         $pagetitle = JText::_('COM_REDSHOP_SEARCH');
         $document->setTitle($pagetitle);
     }
     $document = JFactory::getDocument();
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     if (AJAX_CART_BOX == 0) {
         JHTML::Script('fetchscript.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     }
     // Ajax cart javascript
     if (AJAX_CART_BOX == 1) {
         JHTML::Script('fetchscript.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
         JHTML::Stylesheet('fetchscript.css', 'components/com_redshop/assets/css/');
     }
     if ($layout == 'redfilter') {
         $session = JSession::getInstance('none', array());
         $tagid = JRequest::getInt('tagid', 0);
         $typeid = JRequest::getInt('typeid', 0);
         $remove = JRequest::getInt('remove', 0);
         $Itemid = JRequest::getInt('Itemid', 0);
         $cntproduct = JRequest::getInt('cnt', 0);
         $getredfilter = $session->get('redfilter');
         if (count($getredfilter) == 0) {
             $redfilter = array();
         } else {
             $redfilter = $getredfilter;
         }
         if ($tagid != 0 && $typeid != 0 && !array_key_exists($typeid, $redfilter)) {
             $redfilter[$typeid] = $tagid;
         }
         if ($remove == 1) {
             if ($typeid != 0) {
                 unset($redfilter[$typeid]);
                 $session->set('redfilter', $redfilter);
                 $this->setLayout('redfilter');
                 $model->getRedFilterProduct($remove);
                 echo $model->mod_redProductfilter($Itemid, $typeid) . '~';
             } else {
                 $session->destroy('redfilter');
             }
         }
         $session->set('redfilter', $redfilter);
         if ($cntproduct == 1) {
             $mypid = JRequest::getInt('pid', 0);
             $app->Redirect('index.php?option=com_redshop&view=product&pid=' . $mypid . '&Itemid=' . $Itemid);
         }
     }
     $redHelper = new redhelper();
     $order_data = $redHelper->getOrderByList();
     $getorderby = JRequest::getString('order_by', DEFAULT_PRODUCT_ORDERING_METHOD);
     $lists['order_select'] = JHTML::_('select.genericlist', $order_data, 'order_by', 'class="inputbox" size="1" onchange="document.orderby_form.submit();" ', 'value', 'text', $getorderby);
     $templatedata = $model->getCategoryTemplet();
     for ($i = 0; $i < 1; $i++) {
         $templatedata[$i]->template_desc = $redTemplate->readtemplateFile($templatedata[$i]->template_section, $templatedata[$i]->template_name);
     }
     $search = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->params = $params;
     $this->limit = $model->getState('limit');
     $this->lists = $lists;
     $this->templatedata = $templatedata;
     $this->search = $search;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #18
0
 * @package     RedSHOP.Backend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
require_once JPATH_ROOT . '/administrator/components/com_redshop/helpers/images.php';
JHTML::_('behavior.tooltip');
$editor = JFactory::getEditor();
JHTMLBehavior::modal();
$uri = JURI::getInstance();
$url = $uri->root();
JHTML::_('behavior.calendar');
jimport('joomla.html.pane');
$objhelper = new redhelper();
$producthelper = new producthelper();
?>
<script language="javascript" type="text/javascript">
	Joomla.submitbutton = function (pressbutton) {
		submitbutton(pressbutton);
	}

	submitbutton = function (pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform(pressbutton);
			return;
		}
		if (form.category_name.value == "") {
			alert("<?php 
Пример #19
0
<?php

/**
 * @package     RedSHOP.Frontend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
JHTML::_('behavior.tooltip');
JHTMLBehavior::modal();
$objhelper = new redhelper();
$config = new Redconfiguration();
$producthelper = new producthelper();
$extraField = new extraField();
$redTemplate = new Redtemplate();
$stockroomhelper = new rsstockroomhelper();
$url = JURI::base();
$model = $this->getModel('category');
$loadCategorytemplate = $redTemplate->getTemplate('categoryproduct');
if (count($loadCategorytemplate) > 0 && $loadCategorytemplate[0]->template_desc != "") {
    $template_desc = $loadCategorytemplate[0]->template_desc;
} else {
    $template_desc = "<div><div>{print}</div>";
    $template_desc .= "<div>{filter_by_lbl}{filter_by}</div>";
    $template_desc .= "<div>{order_by_lbl}{order_by}</div>";
    $template_desc .= "<p>{category_loop_start}</p>";
    $template_desc .= "<div style='border: 1px solid;'><div id='categories'><div style='width: 200px;'>";
    $template_desc .= "<div class='category_image'>{category_thumb_image}</div><div class='category_description'>";
    $template_desc .= "<h4 class='category_title'>{category_name}</h4>{category_description}</div></div></div>";
Пример #20
0
 function renderLayout()
 {
     if ($this->config['module_mode'] !== 'normal') {
         $this->render_portal_mode($this->config['module_mode']);
     } else {
         $renderer = new NSP_GK4_Layout_Parts();
         // detecting mode - com_content or K2
         $k2_mode = false;
         $rs_mode = false;
         $vm_mode = false;
         $producthelper = '';
         $redhelper = '';
         //check the source
         if ($this->config["data_source"] == 'k2_categories' || $this->config["data_source"] == 'k2_articles' || $this->config["data_source"] == 'all_k2_articles' || $this->config["data_source"] == 'k2_tags') {
             if ($this->config['k2_categories'] != -1) {
                 $k2_mode = true;
             } else {
                 // exception when K2 is not installed
                 $this->content = array("ID" => array(), "alias" => array(), "CID" => array(), "title" => array(), "text" => array(), "date" => array(), "date_publish" => array(), "author" => array(), "cat_name" => array(), "cat_alias" => array(), "hits" => array(), "news_amount" => 0, "rating_sum" => 0, "rating_count" => 0, "plugins" => '');
             }
         } else {
             if ($this->config["data_source"] == 'redshop_categories' || $this->config["data_source"] == 'redshop_products' || $this->config["data_source"] == 'all_redshop_products') {
                 if ($this->config['redshop_categories'] != -1 && file_exists(JPATH_ROOT . DS . 'components' . DS . 'com_redshop')) {
                     $rs_mode = true;
                     $producthelper = new producthelper();
                     $redhelper = new redhelper();
                 } else {
                     // exception when RedSHOP is not installed
                     $this->content = array("ID" => array(), "CID" => array(), "title" => array(), "text" => array(), "date" => array(), "date_publish" => array(), "price" => array(), "discount_price" => array(), "discount_start" => array(), "discount_end" => array(), "tax" => array(), "cat_name" => array(), "manufacturer" => array(), "manufacturer_id" => array(), "product_image" => array(), "news_amount" => array());
                 }
             } elseif ($this->config["data_source"] == 'vm_categories' || $this->config["data_source"] == 'vm_products') {
                 if ($this->config['vm_categories'] != -1) {
                     $vm_mode = true;
                 } else {
                     // exception when VirtueMart is not installed
                     $this->content = array("ID" => array(), "CID" => array(), "title" => array(), "text" => array(), "date" => array(), "date_publish" => array(), "price" => array(), "price_currency" => array(), "discount_amount" => array(), "discount_is_percent" => array(), "discount_start" => array(), "discount_end" => array(), "tax" => array(), "cat_name" => array(), "manufacturer" => array(), "manufacturer_id" => array(), "product_image" => array(), "news_amount" => 0);
                 }
             }
         }
         // tables which will be used in generated content
         $news_list_tab = array();
         $news_html_tab = array();
         // Generating content
         $uri =& JURI::getInstance();
         $li_counter = 0;
         $news_k2_store = '';
         $news_header = '';
         $news_image = '';
         $news_readmore = '';
         $news_textt = '';
         $news_infoo = '';
         $news_infoo2 = '';
         //
         for ($i = 0; $i < count($this->content["ID"]); $i++) {
             if ($i < $this->config['news_column'] * $this->config['news_rows'] * $this->config['news_full_pages']) {
                 // GENERATING NEWS CONTENT
                 if ($k2_mode == FALSE && $rs_mode == FALSE && $vm_mode == FALSE) {
                     // GENERATING HEADER
                     if ($this->config['news_header_enabled'] == 1) {
                         $news_header = $renderer->header($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i]);
                     }
                     // GENERATING IMAGE
                     if ($this->config['news_image_enabled'] == 1) {
                         $news_image = $renderer->image($this->config, $uri, $this->content['ID'][$i], $this->content['IID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $this->content['title'][$i], $this->content['images'][$i]);
                     }
                     // GENERATING READMORE
                     if ($this->config['news_readmore_enabled'] == 1) {
                         $news_readmore = $renderer->readMore($this->config, $this->content['ID'][$i], $this->content['CID'][$i]);
                     }
                     // GENERATING TEXT
                     if ($this->config['news_text_enabled'] == 1) {
                         $news_textt = $renderer->text($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore);
                     }
                     // GENERATE NEWS INFO
                     if ($this->config['news_info_enabled'] == 1) {
                         $news_infoo = $renderer->info($this->config, $this->content['catname'][$i], $this->content['CID'][$i], $this->content['author'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['rating_count'][$i], $this->content['rating_sum'][$i]);
                     }
                     // GENERATE NEWS INFO2
                     if ($this->config['news_info2_enabled'] == 1) {
                         $news_infoo2 = $renderer->info($this->config, $this->content['catname'][$i], $this->content['CID'][$i], $this->content['author'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['rating_count'][$i], $this->content['rating_sum'][$i], 2);
                     }
                 } else {
                     if ($rs_mode == FALSE && $vm_mode == FALSE && $k2_mode == TRUE) {
                         // GENERATING HEADER
                         if ($this->config['news_header_enabled'] == 1) {
                             $news_header = $renderer->header_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['title'][$i]);
                         }
                         // GENERATING IMAGE
                         if ($this->config['news_image_enabled'] == 1) {
                             $news_image = $renderer->image_k2($this->config, $uri, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['text'][$i], $this->content['title'][$i]);
                         }
                         // GENERATING READMORE
                         if ($this->config['news_readmore_enabled'] == 1) {
                             $news_readmore = $renderer->readMore_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i]);
                         }
                         // GENERATING TEXT
                         if ($this->config['news_text_enabled'] == 1) {
                             $news_textt = $renderer->text_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['text'][$i], $news_readmore);
                         }
                         // GENERATE NEWS INFO
                         if ($this->config['news_info_enabled'] == 1) {
                             $news_infoo = $renderer->info_k2($this->config, $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['author'][$i], $this->content['author_id'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['alias'][$i], $this->content['comments'], $this->content['rating_count'][$i], $this->content['rating_sum'][$i]);
                         }
                         // GENERATE NEWS INFO2
                         if ($this->config['news_info2_enabled'] == 1) {
                             $news_infoo2 = $renderer->info_k2($this->config, $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['author'][$i], $this->content['author_id'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['alias'][$i], $this->content['comments'], $this->content['rating_count'][$i], $this->content['rating_sum'][$i], 2);
                         }
                         // GENERATE STORE BLOCK
                         $news_k2_store = $renderer->store_k2($this->config, $this->content['ID'][$i], $this->content['plugins'][$i], $this->k2store_params);
                     } else {
                         if ($rs_mode == TRUE && $vm_mode == FALSE && $k2_mode == FALSE) {
                             $ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $this->content['ID'][$i]);
                             $id = $this->content['ID'][$i];
                             $cid = $producthelper->getCategoryProduct($this->content['ID'][$i]);
                             $Itemid = $redhelper->getItemid($this->content['ID'][$i]);
                             $product = $producthelper->getProductById($this->content['ID'][$i]);
                             // GENERATING HEADER
                             if ($this->config['news_header_enabled'] == 1) {
                                 $news_header = $renderer->header_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $Itemid);
                             }
                             // GENERATING IMAGE
                             if ($this->config['news_image_enabled'] == 1) {
                                 $news_image = $renderer->image_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i], $Itemid);
                             }
                             // GENERATING READMORE
                             if ($this->config['news_readmore_enabled'] == 1) {
                                 $news_readmore = $renderer->readMore_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $Itemid);
                             }
                             // GENERATING TEXT
                             if ($this->config['news_text_enabled'] == 1) {
                                 $news_textt = $renderer->text_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore, $Itemid);
                             }
                             // GENERATE NEWS INFO
                             if ($this->config['news_info_enabled'] == 1) {
                                 $news_infoo = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 1);
                             }
                             // GENERATE NEWS INFO2
                             if ($this->config['news_info2_enabled'] == 1) {
                                 $news_infoo2 = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 2);
                             }
                             // COMPUTE PRICE DEPENDS OF USER ID
                             $user =& JFactory::getUser();
                             $price = $producthelper->getProductPrice($this->content['ID'][$i], $this->config['rs_price_with_vat'], $user->id);
                             $price = $producthelper->getProductFormattedPrice($price, true);
                             if ($this->config['rs_add_to_cart'] == 1) {
                                 $addToCart = $producthelper->replaceCartTemplate($this->content['ID'][$i], 0, 0, 0, "", false, array(), 0, 0, 0);
                                 $addToCart = str_replace('&', '&amp;', $addToCart);
                                 if ($this->config['rs_show_default_cart_button'] == 0) {
                                     $btnCode = '<a class=\'nspAddToCart\' onclick="if(displayAddtocartForm(\'addtocart_prd_' . $this->content['ID'][$i];
                                     $btnCode .= '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\'))';
                                     $btnCode .= '{checkAddtocartValidation(\'addtocart_prd_' . $id . '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\',\'0\',\'0\',\'0\');}"><span style=\'cursor: pointer;\' id=\'pdaddtocartprd' . $id . '\' title=\'\' class=\'\'>' . JText::_('MOD_NEWS_PRO_GK4_ADD_TO_CART') . '</span></a>';
                                     $addToCart = preg_replace('/\\<img.*?\\>/i', $btnCode, $addToCart);
                                 }
                             }
                             // GET THE CURRENCY
                             $bool = preg_match('/[^0-9]/u', $price, $currency);
                             $currency = $currency[0];
                             $bool = preg_match('/[0-9]+/u', $price, $price);
                             $price = $price[0];
                             // GENERATE RedSHOP STORE INFO
                             $news_rs_store = $renderer->store_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $price, $this->content['discount_start'][$i], $this->content['discount_end'][$i], $this->content['tax'][$i], $this->content['discount_price'][$i], $currency, $Itemid, $addToCart);
                         } else {
                             if ($vm_mode == TRUE) {
                                 // GENERATING HEADER
                                 if ($this->config['news_header_enabled'] == 1) {
                                     $news_header = $renderer->header_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i]);
                                 }
                                 // GENERATING IMAGE
                                 if ($this->config['news_image_enabled'] == 1) {
                                     $news_image = $renderer->image_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i]);
                                 }
                                 // GENERATING READMORE
                                 if ($this->config['news_readmore_enabled'] == 1) {
                                     $news_readmore = $renderer->readMore_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i]);
                                 }
                                 // GENERATING TEXT
                                 if ($this->config['news_text_enabled'] == 1) {
                                     $news_textt = $renderer->text_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore);
                                 }
                                 // GENERATE NEWS INFO
                                 if ($this->config['news_info_enabled'] == 1) {
                                     $news_infoo = $renderer->info_vm($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['comments']);
                                 }
                                 // GENERATE NEWS INFO2
                                 if ($this->config['news_info2_enabled'] == 1) {
                                     $news_infoo2 = $renderer->info_vm($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['comments'], 2);
                                 }
                                 $news_vm_store = $renderer->store_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['price'][$i], $this->content['price_currency'][$i], $this->content['discount_amount'][$i], true, $this->content['discount_start'][$i], $this->content['discount_end'][$i], $this->content['tax'][$i], $this->content['manufacturer_id'][$i]);
                             }
                         }
                     }
                 }
                 // PARSING PLUGINS
                 if ($this->config['parse_plugins'] == TRUE) {
                     $news_textt = JHtml::_('content.prepare', $news_textt);
                 }
                 // CLEANING PLUGINS
                 if ($this->config['clean_plugins'] == TRUE) {
                     $news_textt = preg_replace("/(\\{.+?\\}.+?\\{.+?})|(\\{.+?\\})/", "", $news_textt);
                 }
                 // GENERATE CONTENT FOR TAB
                 $news_generated_content = '';
                 // initialize variable
                 //
                 for ($j = 1; $j < 7; $j++) {
                     if ($this->config['wrapContent'] == 1 && $this->config['news_image_order'] == 1) {
                         if ($j == 2) {
                             $news_generated_content .= '<div class="gkArtContentWrap">';
                         }
                     }
                     if ($this->config['news_header_order'] == $j) {
                         $news_generated_content .= $news_header;
                     }
                     if ($this->config['news_image_order'] == $j) {
                         $news_generated_content .= $news_image;
                     }
                     if ($this->config['news_text_order'] == $j) {
                         $news_generated_content .= $news_textt;
                     }
                     if ($this->config['news_info_order'] == $j) {
                         $news_generated_content .= $news_infoo;
                     }
                     if ($this->config['news_info2_order'] == $j) {
                         $news_generated_content .= $news_infoo2;
                     }
                     if ($this->config['news_rs_store_enabled'] != 'disabled') {
                         if ($rs_mode != FALSE && $this->config['news_rs_store_order'] == $j) {
                             $news_generated_content .= $news_rs_store;
                         }
                         if ($vm_mode != FALSE && $this->config['news_rs_store_order'] == $j) {
                             $news_generated_content .= $news_vm_store;
                         }
                         if ($k2_mode != FALSE && $this->config['news_rs_store_order'] == $j) {
                             $news_generated_content .= $news_k2_store;
                         }
                     }
                 }
                 //
                 if ($this->config['news_content_readmore_pos'] != 'after') {
                     $news_generated_content .= $news_readmore;
                 }
                 if ($this->config['wrapContent'] == 1 && $this->config['news_image_order'] == 1) {
                     $news_generated_content .= '</div>';
                 }
                 // creating table with news content
                 array_push($news_html_tab, $news_generated_content);
             } else {
                 if ($k2_mode == FALSE && $vm_mode == FALSE) {
                     array_push($news_list_tab, $renderer->lists($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $this->content['text'][$i], $li_counter % 2, $li_counter));
                 } elseif ($k2_mode == TRUE) {
                     array_push($news_list_tab, $renderer->lists_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['title'][$i], $this->content['text'][$i], $li_counter % 2, $li_counter));
                 } else {
                     array_push($news_list_tab, $renderer->lists_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $this->content['text'][$i], $li_counter % 2, $li_counter));
                 }
                 //
                 $li_counter++;
             }
         }
         /** GENERATING FINAL XHTML CODE START **/
         // create instances of basic Joomla! classes
         $document = JFactory::getDocument();
         $uri = JURI::getInstance();
         // add stylesheets to document header
         if ($this->config["useCSS"] == 1) {
             $document->addStyleSheet($uri->root() . 'modules/mod_news_pro_gk4/interface/css/style.css', 'text/css');
         }
         // add script to the document header
         if ($this->config['useScript'] == 1) {
             $document->addScript($uri->root() . 'modules/mod_news_pro_gk4/interface/scripts/engine.js');
         }
         // init $headData variable
         $headData = false;
         // add scripts with automatic mode to document header
         if ($this->config['useScript'] == 2) {
             // getting module head section datas
             unset($headData);
             $headData = $document->getHeadData();
             // generate keys of script section
             $headData_keys = array_keys($headData["scripts"]);
             // set variable for false
             $engine_founded = false;
             // searching phrase mootools in scripts paths
             if (array_search($uri->root() . 'modules/mod_news_pro_gk4/interface/scripts/engine.js', $headData_keys) > 0) {
                 $engine_founded = true;
             }
             // if engine doesn't exists in the head section
             if (!$engine_founded) {
                 // add new script tag connected with mootools from module
                 $document->addScript($uri->root() . 'modules/mod_news_pro_gk4/interface/scripts/engine.js');
             }
         }
         //
         require JModuleHelper::getLayoutPath('mod_news_pro_gk4', 'content');
         require JModuleHelper::getLayoutPath('mod_news_pro_gk4', 'default');
     }
 }
Пример #21
0
 public function display($tpl = null)
 {
     $option = JRequest::getVar('option');
     $extra_field = new extra_field();
     $order_functions = new order_functions();
     $Redconfiguration = new Redconfiguration();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_ORDER'));
     $document->addScript('components/' . $option . '/assets/js/select_sort.js');
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $document->addScript('components/' . $option . '/assets/js/json.js');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $document->addScript('components/' . $option . '/assets/js/order.js');
     $document->addScript('components/' . $option . '/assets/js/common.js');
     $uri = JFactory::getURI();
     $lists = array();
     $billing = array();
     $shippinginfo = array();
     $model = $this->getModel();
     $detail = $this->get('data');
     $redhelper = new redhelper();
     $payment_lang_list = $redhelper->getPlugins("redshop_payment");
     $language = JFactory::getLanguage();
     $base_dir = JPATH_ADMINISTRATOR;
     $language_tag = $language->getTag();
     for ($l = 0; $l < count($payment_lang_list); $l++) {
         $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element;
         $language->load($extension, $base_dir, $language_tag, true);
     }
     $err = JRequest::getVar('err', '');
     $shipping_rate_id = JRequest::getVar('shipping_rate_id');
     $user_id = JRequest::getVar('user_id', 0);
     if ($user_id != 0) {
         $billing = $order_functions->getBillingAddress($user_id);
         $shippinginfo = $order_functions->getShippingAddress($user_id);
     } else {
         $billing = $model->setBilling();
     }
     $shipping_country = 0;
     $shipping_state = 0;
     $key = 0;
     $shippingop = array();
     $shippingop[0] = new stdClass();
     $shippingop[0]->users_info_id = 0;
     $shippingop[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (count($shippinginfo) > 0) {
         $shipping_users_info_id = JRequest::getVar('shipping_users_info_id', 0);
         if ($shipping_users_info_id != 0) {
             for ($o = 0; $o < count($shippinginfo); $o++) {
                 if ($shippinginfo[$o]->users_info_id == $shipping_users_info_id) {
                     $key = $o;
                     break;
                 }
             }
             $shipping_country = $shippinginfo[$key]->country_code;
             $shipping_state = $shippinginfo[$key]->state_code;
         }
         $shippingop = array_merge($shippingop, $shippinginfo);
         $billisship = $shippinginfo[$key]->billisship = $shipping_users_info_id ? 0 : 1;
     } else {
         $shippinginfo[0] = $model->setShipping();
         $shipping_users_info_id = $shippinginfo[0]->users_info_id = 0;
         $billisship = $shippinginfo[0]->billisship;
     }
     $shdisable = $billisship ? "disabled" : "";
     $detail->user_id = $user_id;
     $lists['shippinginfo_list'] = JHTML::_('select.genericlist', $shippingop, 'shipp_users_info_id', 'class="inputbox" ' . $shdisable . ' onchange="getShippinginfo(this.value, ' . $billing->is_company . ');" ', 'users_info_id', 'text', $shipping_users_info_id);
     $payment_detail = $this->get('payment');
     JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48');
     if ($err == "" && array_key_exists("users_info_id", $billing) && $billing->users_info_id) {
         JToolBarHelper::custom('savepay', 'save.png', 'save_f2.png', 'Save + Pay', false);
         JToolBarHelper::custom('save_without_sendmail', 'save.png', 'save_f2.png', JText::_('COM_REDSHOP_SAVE_WITHOUT_SEND_ORDERMAIL_LBL'), false);
         JToolBarHelper::save();
     }
     JToolBarHelper::cancel();
     $countryarray = $Redconfiguration->getCountryList((array) $billing, "country_code", "BT");
     $billing->country_code = $countryarray['country_code'];
     $lists['country_code'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $billing, "state_code", "country_code", "BT", 1);
     $lists['state_code'] = $statearray['state_dropdown'];
     $shipping['country_code_ST'] = $shippinginfo[$key]->country_code;
     $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST");
     $shipping['country_code_ST'] = $shippinginfo[$key]->country_code = $countryarray['country_code_ST'];
     $lists['country_code_ST'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1);
     $lists['state_code_ST'] = $statearray['state_dropdown'];
     $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $billing->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER'));
     $lists['customer_field'] = $extra_field->list_all_field(7, $billing->users_info_id);
     $lists['company_field'] = $extra_field->list_all_field(8, $billing->users_info_id);
     $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippinginfo[0]->users_info_id);
     $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippinginfo[0]->users_info_id);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->billing = $billing;
     $this->shipping = $shippinginfo[$key];
     $this->shipping_users_info_id = $shipping_users_info_id;
     $this->payment_detail = $payment_detail;
     $this->shipping_rate_id = $shipping_rate_id;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #22
0
$layout = JRequest::getCmd('layout');
$for = JRequest::getWord("for", false);
if ($tmpl == 'component' && !$for) {
    $doc->addStyleDeclaration('html { overflow:scroll; }');
}
// 	Getting the configuration
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php';
$Redconfiguration = new Redconfiguration();
$Redconfiguration->defineDynamicVars();
require_once JPATH_SITE . '/components/com_redshop/helpers/currency.php';
$session = JFactory::getSession('product_currency');
$post = JRequest::get('POST');
$Itemid = JRequest::getVar('Itemid');
require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
$redhelper = new redhelper();
$cart_Itemid = $redhelper->getCartItemid();
if ($cart_Itemid == "" || $cart_Itemid == 0) {
    $cItemid = $redhelper->getItemid();
    $tmpItemid = $cItemid;
} else {
    $tmpItemid = $cart_Itemid;
}
if (isset($post['product_currency'])) {
    $session->set('product_currency', $post['product_currency']);
}
$currency_symbol = REDCURRENCY_SYMBOL;
$currency_convert = 1;
$script = "\n\t\twindow.site_url = '" . JURI::root() . "';\n\t\twindow.AJAX_CART_BOX = '" . AJAX_CART_BOX . "';\n\t\twindow.REDSHOP_VIEW = '" . $view . "';\n\t\twindow.REDSHOP_LAYOUT = '" . $layout . "';\n\t\twindow.DEFAULT_CUSTOMER_REGISTER_TYPE = '" . DEFAULT_CUSTOMER_REGISTER_TYPE . "';\n\t\twindow.AJAX_CART_URL = '" . JRoute::_('index.php?option=com_redshop&view=cart&Itemid=' . $tmpItemid, false) . "';\n\t\twindow.REDCURRENCY_SYMBOL = '" . REDCURRENCY_SYMBOL . "';\n\t\twindow.CURRENCY_SYMBOL_CONVERT = '" . $currency_symbol . "';\n\t\twindow.CURRENCY_CONVERT = '" . $currency_convert . "';\n\t\twindow.PRICE_SEPERATOR = '" . PRICE_SEPERATOR . "';\n\t\twindow.COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE = '" . JText::_('COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\twindow.COM_REDSHOP_PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE = '" . JText::_('COM_REDSHOP_PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\twindow.CURRENCY_SYMBOL_POSITION = '" . CURRENCY_SYMBOL_POSITION . "';\n\t\twindow.PRICE_DECIMAL = '" . PRICE_DECIMAL . "';\n\t\twindow.COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT') . "';\n\t\twindow.THOUSAND_SEPERATOR = '" . THOUSAND_SEPERATOR . "';\n\t\twindow.COM_REDSHOP_VIEW_CART = '" . JText::_('COM_REDSHOP_VIEW_CART') . "';\n\t\twindow.COM_REDSHOP_CONTINUE_SHOPPING = '" . JText::_('COM_REDSHOP_CONTINUE_SHOPPING') . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE') . "';\n\t\twindow.COM_REDSHOP_CART_SAVE = '" . JText::_('COM_REDSHOP_CART_SAVE') . "';\n\t\twindow.COM_REDSHOP_IS_REQUIRED = '" . JText::_('COM_REDSHOP_IS_REQUIRED') . "';\n\t\twindow.COM_REDSHOP_ENTER_NUMBER = '" . JText::_('COM_REDSHOP_ENTER_NUMBER') . "';\n\t\twindow.USE_STOCKROOM = '" . USE_STOCKROOM . "';\n\t\twindow.USE_AS_CATALOG = '" . USE_AS_CATALOG . "';\n\t\twindow.AJAX_CART_DISPLAY_TIME = '" . AJAX_CART_DISPLAY_TIME . "';\n\t\twindow.SHOW_PRICE = '" . SHOW_PRICE . "';\n\t\twindow.DEFAULT_QUOTATION_MODE = '" . DEFAULT_QUOTATION_MODE . "';\n\t\twindow.PRICE_REPLACE = '" . PRICE_REPLACE . "';\n\t\twindow.PRICE_REPLACE_URL = '" . PRICE_REPLACE_URL . "';\n\t\twindow.ZERO_PRICE_REPLACE = '" . ZERO_PRICE_REPLACE . "';\n\t\twindow.ZERO_PRICE_REPLACE_URL = '" . ZERO_PRICE_REPLACE_URL . "';\n\t\twindow.OPTIONAL_SHIPPING_ADDRESS = '" . OPTIONAL_SHIPPING_ADDRESS . "';\n\t\twindow.SHIPPING_METHOD_ENABLE = '" . SHIPPING_METHOD_ENABLE . "';\n\t\twindow.PRODUCT_ADDIMG_IS_LIGHTBOX = '" . PRODUCT_ADDIMG_IS_LIGHTBOX . "';\n\t\twindow.ALLOW_PRE_ORDER = '" . ALLOW_PRE_ORDER . "';\n\t\twindow.ATTRIBUTE_SCROLLER_THUMB_WIDTH = '" . ATTRIBUTE_SCROLLER_THUMB_WIDTH . "';\n\t\twindow.ATTRIBUTE_SCROLLER_THUMB_HEIGHT = '" . ATTRIBUTE_SCROLLER_THUMB_HEIGHT . "';\n\t\twindow.PRODUCT_DETAIL_IS_LIGHTBOX = '" . PRODUCT_DETAIL_IS_LIGHTBOX . "';\n\t\twindow.REQUIRED_VAT_NUMBER = '" . REQUIRED_VAT_NUMBER . "';\n\t\twindow.COM_REDSHOP_PLEASE_ENTER_COMPANY_NAME = '" . JText::_('COM_REDSHOP_PLEASE_ENTER_COMPANY_NAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_PHONE = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_PHONE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_REQUIRED = '" . JText::_('COM_REDSHOP_THIS_FIELD_REQUIRED', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_REMOTE = '" . JText::_('COM_REDSHOP_THIS_FIELD_REMOTE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_URL= '" . JText::_('COM_REDSHOP_THIS_FIELD_URL', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DATE= '" . JText::_('COM_REDSHOP_THIS_FIELD_DATE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DATEISO= '" . JText::_('COM_REDSHOP_THIS_FIELD_DATEISO', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_NUMBER= '" . JText::_('COM_REDSHOP_THIS_FIELD_NUMBER', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DIGITS= '" . JText::_('COM_REDSHOP_THIS_FIELD_DIGITS', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_CREDITCARD= '" . JText::_('COM_REDSHOP_THIS_FIELD_CREDITCARD', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_EQUALTO= '" . JText::_('COM_REDSHOP_THIS_FIELD_EQUALTO', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_ACCEPT= '" . JText::_('COM_REDSHOP_THIS_FIELD_ACCEPT', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MAXLENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_MAXLENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MINLENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_MINLENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_RANGELENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_RANGELENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_RANGE= '" . JText::_('COM_REDSHOP_THIS_FIELD_RANGE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MAX= '" . JText::_('COM_REDSHOP_THIS_FIELD_MAX', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MIN= '" . JText::_('COM_REDSHOP_THIS_FIELD_MIN', true) . "';\n\t\twindow.COM_REDSHOP_YOU_MUST_PROVIDE_LOGIN_NAME = '" . JText::_('COM_REDSHOP_YOU_MUST_PROVIDE_LOGIN_NAME', true) . "';\n\t\twindow.COM_REDSHOP_PROVIDE_EMAIL_ADDRESS = '" . JText::_('COM_REDSHOP_PROVIDE_EMAIL_ADDRESS', true) . "';\n\t\twindow.COM_REDSHOP_EMAIL_NOT_MATCH = '" . JText::_('COM_REDSHOP_EMAIL_NOT_MATCH', true) . "';\n\t\twindow.COM_REDSHOP_PASSWORD_NOT_MATCH = '" . JText::_('COM_REDSHOP_PASSWORD_NOT_MATCH', true) . "';\n\t\twindow.NOOF_SUBATTRIB_THUMB_FOR_SCROLLER = '" . NOOF_SUBATTRIB_THUMB_FOR_SCROLLER . "';\n\t\twindow.COM_REDSHOP_NOT_AVAILABLE = '" . JText::_('COM_REDSHOP_NOT_AVAILABLE', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_HEIGHT = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_HEIGHT', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_WIDTH = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_WIDTH', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_DEPTH = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_DEPTH', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_RADIUS = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_RADIUS', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_UNIT = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_UNIT', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_IS_REQUIRED = '" . JText::_('COM_REDSHOP_THIS_FIELD_IS_REQUIRED', true) . "';\n\t\twindow.COM_REDSHOP_SELECT_SUBSCRIPTION_PLAN = '" . JText::_('COM_REDSHOP_SELECT_SUBSCRIPTION_PLAN', true) . "';\n\t    window.COM_REDSHOP_USERNAME_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_USERNAME_MIN_CHARACTER_LIMIT', true) . "';\n\t\twindow.CREATE_ACCOUNT_CHECKBOX = '" . CREATE_ACCOUNT_CHECKBOX . "';\n\t\twindow.USE_TAX_EXEMPT = '" . USE_TAX_EXEMPT . "';\n\t\twindow.SHOW_EMAIL_VERIFICATION = '" . SHOW_EMAIL_VERIFICATION . "';\n\t\twindow.SHOW_QUOTATION_PRICE = '" . SHOW_QUOTATION_PRICE . "';\n\t\twindow.AJAX_DETAIL_BOX_WIDTH = '" . AJAX_DETAIL_BOX_WIDTH . "';\n\t\twindow.AJAX_DETAIL_BOX_HEIGHT = '" . AJAX_DETAIL_BOX_HEIGHT . "';\n\t\twindow.AJAX_BOX_WIDTH = '" . AJAX_BOX_WIDTH . "';\n\t\twindow.AJAX_BOX_HEIGHT = '" . AJAX_BOX_HEIGHT . "';\n\t\twindow.COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT', true) . "';\n\t";
$doc->addScriptDeclaration($script);
if ($view == 'product') {
Пример #23
0
<?php

/**
 * @package     RedSHOP.Frontend
 * @subpackage  mod_redshop_wishlist
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die('restricted access');
JHTML::_('behavior.tooltip');
JHTML::_('behavior.modal');
$uri = JURI::getInstance();
$url = $uri->root();
$user = JFactory::getUser();
$redhelper = new redhelper();
$Itemid = $redhelper->getItemid();
// get product helper
// Getting the configuration
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php';
$Redconfiguration = new Redconfiguration();
$Redconfiguration->defineDynamicVars();
if (MY_WISHLIST) {
    if (!$user->id) {
        echo "<div class='mod_redshop_wishlist'>";
        if (count($rows) > 0) {
            $mywishlist_link = JRoute::_('index.php?view=wishlist&task=viewwishlist&option=com_redshop&Itemid=' . $Itemid);
            echo "<a href=\"" . $mywishlist_link . "\" >" . JText::_('COM_REDSHOP_VIEW_WISHLIST') . "</a>";
            // send mail link
        } else {
Пример #24
0
    public function replaceCartItem($data, $cart = array(), $replace_button, $quotation_mode = 0)
    {
        JPluginHelper::importPlugin('redshop_product');
        $dispatcher = JDispatcher::getInstance();
        $prdItemid = JRequest::getInt('Itemid');
        $option = JRequest::getVar('option', 'com_redshop');
        $Itemid = $this->_redhelper->getCheckoutItemid();
        $url = JURI::base(true);
        $mainview = JRequest::getVar('view');
        if ($Itemid == 0) {
            $Itemid = JRequest::getInt('Itemid');
        }
        $cart_tr = '';
        $i = 0;
        $idx = $cart['idx'];
        $fieldArray = $this->_extraFieldFront->getSectionFieldList(17, 0, 0);
        if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . ADDTOCART_DELETE)) {
            $delete_img = ADDTOCART_DELETE;
        } else {
            $delete_img = "defaultcross.jpg";
        }
        for ($i = 0; $i < $idx; $i++) {
            if (isset($cart[$i]['giftcard_id']) && $cart[$i]['giftcard_id']) {
                $giftcard_id = $cart[$i]['giftcard_id'];
                $giftcardData = $this->_producthelper->getGiftcardData($giftcard_id);
                $link = JRoute::_('index.php?option=' . $option . '&view=giftcard&gid=' . $giftcard_id . '&Itemid=' . $Itemid);
                $product_name = "<div  class='product_name'><a href='" . $link . "'>" . $giftcardData->giftcard_name . "</a></div>";
                if (strstr($data, "{product_name_nolink}")) {
                    $product_name_nolink = "<div  class='product_name'>{$giftcardData->giftcard_name}</a></div>";
                    $cart_mdata = str_replace("{product_name_nolink}", $product_name_nolink, $data);
                    if (strstr($data, "{product_name}")) {
                        $cart_mdata = str_replace("{product_name}", "", $cart_mdata);
                    }
                } else {
                    $cart_mdata = str_replace("{product_name}", $product_name, $data);
                }
                // $cart_mdata=str_replace("{product_name}",$product_name,$data);
                $cart_mdata = str_replace("{product_attribute}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_accessory}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_wrapper}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_old_price}", '', $cart_mdata);
                $cart_mdata = str_replace("{vat_info}", '', $cart_mdata);
                $cart_mdata = str_replace("{update_cart}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_number}", '', $cart_mdata);
                $cart_mdata = str_replace("{attribute_price_without_vat}", '', $cart_mdata);
                $cart_mdata = str_replace("{attribute_price_with_vat}", '', $cart_mdata);
                if ($quotation_mode && !SHOW_QUOTATION_PRICE) {
                    $cart_mdata = str_replace("{product_total_price}", "", $cart_mdata);
                    $cart_mdata = str_replace("{product_price}", "", $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{product_price}", $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price']), $cart_mdata);
                    $cart_mdata = str_replace("{product_total_price}", $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price'] * $cart[$i]['quantity'], true), $cart_mdata);
                }
                $cart_mdata = str_replace("{if product_on_sale}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_on_sale end if}", '', $cart_mdata);
                $thumbUrl = RedShopHelperImages::getImagePath($giftcardData->giftcard_image, '', 'thumb', 'giftcard', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                $giftcard_image = "<div  class='giftcard_image'><img src='" . $thumbUrl . "'></div>";
                $cart_mdata = str_replace("{product_thumb_image}", $giftcard_image, $cart_mdata);
                $user_fields = $this->_producthelper->GetProdcutUserfield($i, 13);
                $cart_mdata = str_replace("{product_userfields}", $user_fields, $cart_mdata);
                $cart_mdata = str_replace("{product_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price']), $cart_mdata);
                $cart_mdata = str_replace("{product_total_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price'] * $cart[$i]['quantity']), $cart_mdata);
                $cart_mdata = str_replace("{attribute_change}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_attribute_price}", "", $cart_mdata);
                $cart_mdata = str_replace("{product_attribute_number}", "", $cart_mdata);
                $cart_mdata = str_replace("{product_tax}", "", $cart_mdata);
                // ProductFinderDatepicker Extra Field
                $cart_mdata = $this->_producthelper->getProductFinderDatepickerValue($cart_mdata, $product_id, $fieldArray, $giftcard = 1);
                $remove_product = '<form style="" class="rs_hiddenupdatecart" name="delete_cart' . $i . '" method="POST" >
				<input type="hidden" name="giftcard_id" value="' . $cart[$i]['giftcard_id'] . '">
				<input type="hidden" name="cart_index" value="' . $i . '">
				<input type="hidden" name="task" value="">
				<input type="hidden" name="Itemid" value="' . $Itemid . '">
				<img class="delete_cart" src="' . REDSHOP_FRONT_IMAGES_ABSPATH . $delete_img . '" title="' . JText::_('COM_REDSHOP_DELETE_PRODUCT_FROM_CART_LBL') . '" alt="' . JText::_('COM_REDSHOP_DELETE_PRODUCT_FROM_CART_LBL') . '" onclick="document.delete_cart' . $i . '.task.value=\'delete\';document.delete_cart' . $i . '.submit();"></form>';
                if (QUANTITY_TEXT_DISPLAY) {
                    $cart_mdata = str_replace("{remove_product}", $remove_product, $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{remove_product}", $remove_product, $cart_mdata);
                }
            } else {
                $product_id = $cart[$i]['product_id'];
                $product = $this->_producthelper->getProductById($product_id);
                $quantity = $cart[$i]['quantity'];
                $retAttArr = $this->_producthelper->makeAttributeCart($cart[$i]['cart_attribute'], $product_id, 0, 0, $quantity, $data);
                $cart_attribute = $retAttArr[0];
                $retAccArr = $this->_producthelper->makeAccessoryCart($cart[$i]['cart_accessory'], $product_id, $data);
                $cart_accessory = $retAccArr[0];
                $ItemData = $this->_producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $product_id);
                if (count($ItemData) > 0) {
                    $Itemid = $ItemData->id;
                } else {
                    $Itemid = $this->_redhelper->getItemid($product_id);
                }
                $link = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $product_id . '&Itemid=' . $Itemid);
                $pname = $product->product_name;
                $product_name = "<div  class='product_name'><a href='" . $link . "'>" . $pname . "</a></div>";
                $product_image = "";
                $prd_image = '';
                $type = 'product';
                if (WANT_TO_SHOW_ATTRIBUTE_IMAGE_INCART && isset($cart[$i]['hidden_attribute_cartimage'])) {
                    $image_path = REDSHOP_FRONT_IMAGES_ABSPATH;
                    $product_image = str_replace($image_path, '', $cart[$i]['hidden_attribute_cartimage']);
                }
                if ($product_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . $product_image)) {
                    $val = explode("/", $product_image);
                    $prd_image = $val[1];
                    $type = $val[0];
                } elseif ($product->product_full_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
                    $prd_image = $product->product_full_image;
                    $type = 'product';
                } elseif (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                    $prd_image = PRODUCT_DEFAULT_IMAGE;
                    $type = 'product';
                }
                $isAttributeImage = false;
                if (isset($cart[$i]['attributeImage'])) {
                    $isAttributeImage = is_file(REDSHOP_FRONT_IMAGES_RELPATH . "mergeImages/" . $cart[$i]['attributeImage']);
                }
                if ($isAttributeImage) {
                    $prd_image = $cart[$i]['attributeImage'];
                    $type = 'mergeImages';
                }
                if ($prd_image !== '') {
                    $redhelper = new redhelper();
                    if (WATERMARK_CART_THUMB_IMAGE && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . WATERMARK_IMAGE)) {
                        $product_cart_img = $redhelper->watermark($type, $prd_image, CART_THUMB_WIDTH, CART_THUMB_HEIGHT, WATERMARK_CART_THUMB_IMAGE, '0');
                        $product_image = "<div  class='product_image'><img src='" . $product_cart_img . "'></div>";
                    } else {
                        $thumbUrl = RedShopHelperImages::getImagePath($prd_image, '', 'thumb', $type, CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                        $product_image = "<div  class='product_image'><img src='" . $thumbUrl . "'></div>";
                    }
                } else {
                    $product_image = "<div  class='product_image'></div>";
                }
                // Trigger to change product image.
                $dispatcher->trigger('changeCartOrderItemImage', array(&$cart, &$product_image, $product, $i));
                $chktag = $this->_producthelper->getApplyVatOrNot($data);
                $product_total_price = "<div class='product_price'>";
                if (!$quotation_mode || $quotation_mode && SHOW_QUOTATION_PRICE) {
                    if (!$chktag) {
                        $product_total_price .= $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price_excl_vat'] * $quantity);
                    } else {
                        $product_total_price .= $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price'] * $quantity);
                    }
                }
                $product_total_price .= "</div>";
                $product_old_price = "";
                $product_price = "<div class='product_price'>";
                if (!$quotation_mode || $quotation_mode && SHOW_QUOTATION_PRICE) {
                    if (!$chktag) {
                        $product_price .= $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price_excl_vat'], true);
                    } else {
                        $product_price .= $this->_producthelper->getProductFormattedPrice($cart[$i]['product_price'], true);
                    }
                    if (isset($cart[$i]['product_old_price'])) {
                        $product_old_price = $cart[$i]['product_old_price'];
                        if (!$chktag) {
                            $product_old_price = $cart[$i]['product_old_price_excl_vat'];
                        }
                        $product_old_price = $this->_producthelper->getProductFormattedPrice($product_old_price, true);
                    }
                }
                $product_price .= "</div>";
                $wrapper_name = "";
                if (array_key_exists('wrapper_id', $cart[$i]) && $cart[$i]['wrapper_id']) {
                    $wrapper = $this->_producthelper->getWrapper($product_id, $cart[$i]['wrapper_id']);
                    if (count($wrapper) > 0) {
                        $wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ": " . $wrapper[0]->wrapper_name;
                        if (!$quotation_mode || $quotation_mode && SHOW_QUOTATION_PRICE) {
                            $wrapper_name .= "(" . $this->_producthelper->getProductFormattedPrice($cart[$i]['wrapper_price'], true) . ")";
                        }
                    }
                }
                $cart_mdata = '';
                if (strstr($data, "{product_name_nolink}")) {
                    $product_name_nolink = "";
                    $product_name_nolink = "<div  class='product_name'>{$product->product_name}</a></div>";
                    $cart_mdata = str_replace("{product_name_nolink}", $product_name_nolink, $data);
                    if (strstr($data, "{product_name}")) {
                        $cart_mdata = str_replace("{product_name}", "", $cart_mdata);
                    }
                } else {
                    $cart_mdata = str_replace("{product_name}", $product_name, $data);
                }
                $cart_mdata = str_replace("{product_s_desc}", $product->product_s_desc, $cart_mdata);
                // Replace Attribute data
                if (strstr($cart_mdata, "{product_attribute_loop_start}") && strstr($cart_mdata, "{product_attribute_loop_end}")) {
                    $templateattibute_sdata = explode('{product_attribute_loop_start}', $cart_mdata);
                    $templateattibute_start = $templateattibute_sdata[0];
                    $templateattibute_edata = explode('{product_attribute_loop_end}', $templateattibute_sdata[1]);
                    $templateattibute_end = $templateattibute_edata[1];
                    $templateattibute_middle = $templateattibute_edata[0];
                    $pro_detail = '';
                    $sum_total = count($cart[$i]['cart_attribute']);
                    $temp_tpi = $cart[$i]['cart_attribute'];
                    if ($sum_total > 0) {
                        for ($tpi = 0; $tpi < $sum_total; $tpi++) {
                            $product_attribute_name = "";
                            $product_attribute_value = "";
                            $product_attribute_value_price = "";
                            $product_attribute_name = $temp_tpi[$tpi]['attribute_name'];
                            if (count($temp_tpi[$tpi]['attribute_childs']) > 0) {
                                $product_attribute_value = ": " . $temp_tpi[$tpi]['attribute_childs'][0]['property_name'];
                                if (count($temp_tpi[$tpi]['attribute_childs'][0]['property_childs']) > 0) {
                                    $product_attribute_value .= ": " . $temp_tpi[$tpi]['attribute_childs'][0]['property_childs'][0]['subattribute_color_title'] . ": " . $temp_tpi[$tpi]['attribute_childs'][0]['property_childs'][0]['subproperty_name'];
                                }
                                $product_attribute_value_price = $temp_tpi[$tpi]['attribute_childs'][0]['property_price'];
                                if (count($temp_tpi[$tpi]['attribute_childs'][0]['property_childs']) > 0) {
                                    $product_attribute_value_price = $product_attribute_value_price + $temp_tpi[$tpi]['attribute_childs'][0]['property_childs'][0]['subproperty_price'];
                                }
                                $product_attribute_value_price = $this->_producthelper->getProductFormattedPrice($product_attribute_value_price);
                            }
                            $data_add_pro = $templateattibute_middle;
                            $data_add_pro = str_replace("{product_attribute_name}", $product_attribute_name, $data_add_pro);
                            $data_add_pro = str_replace("{product_attribute_value}", $product_attribute_value, $data_add_pro);
                            $data_add_pro = str_replace("{product_attribute_value_price}", $product_attribute_value_price, $data_add_pro);
                            $pro_detail .= $data_add_pro;
                        }
                    }
                    $cart_mdata = str_replace($templateattibute_middle, $pro_detail, $cart_mdata);
                }
                if (count($cart[$i]['cart_attribute']) > 0) {
                    $cart_mdata = str_replace("{attribute_label}", JText::_("COM_REDSHOP_ATTRIBUTE"), $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{attribute_label}", "", $cart_mdata);
                }
                $cart_mdata = str_replace("{product_number}", $product->product_number, $cart_mdata);
                $cart_mdata = str_replace("{product_vat}", $cart[$i]['product_vat'] * $cart[$i]['quantity'], $cart_mdata);
                $user_fields = $this->_producthelper->GetProdcutUserfield($i);
                $cart_mdata = str_replace("{product_userfields}", $user_fields, $cart_mdata);
                $user_custom_fields = $this->_producthelper->GetProdcutfield($i);
                $cart_mdata = str_replace("{product_customfields}", $user_custom_fields, $cart_mdata);
                $cart_mdata = str_replace("{product_customfields_lbl}", JText::_("COM_REDSHOP_PRODUCT_CUSTOM_FIELD"), $cart_mdata);
                $discount_calc_output = isset($cart[$i]['discount_calc_output']) && $cart[$i]['discount_calc_output'] ? $cart[$i]['discount_calc_output'] . "<br />" : "";
                $cart_mdata = str_replace("{product_attribute}", $discount_calc_output . $cart_attribute, $cart_mdata);
                $cart_mdata = str_replace("{product_accessory}", $cart_accessory, $cart_mdata);
                $cart_mdata = str_replace("{product_attribute_price}", "", $cart_mdata);
                $cart_mdata = str_replace("{product_attribute_number}", "", $cart_mdata);
                $cart_mdata = $this->_producthelper->getProductOnSaleComment($product, $cart_mdata, $product_old_price);
                $cart_mdata = str_replace("{product_old_price}", $product_old_price, $cart_mdata);
                $cart_mdata = str_replace("{product_wrapper}", $wrapper_name, $cart_mdata);
                $cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata);
                $cart_mdata = str_replace("{attribute_price_without_vat}", '', $cart_mdata);
                $cart_mdata = str_replace("{attribute_price_with_vat}", '', $cart_mdata);
                // ProductFinderDatepicker Extra Field Start
                $cart_mdata = $this->_producthelper->getProductFinderDatepickerValue($cart_mdata, $product_id, $fieldArray);
                $product_price_excl_vat = $cart[$i]['product_price_excl_vat'];
                if (!$quotation_mode || $quotation_mode && SHOW_QUOTATION_PRICE) {
                    $cart_mdata = str_replace("{product_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($product_price_excl_vat), $cart_mdata);
                    $cart_mdata = str_replace("{product_total_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($product_price_excl_vat * $quantity), $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{product_price_excl_vat}", "", $cart_mdata);
                    $cart_mdata = str_replace("{product_total_price_excl_vat}", "", $cart_mdata);
                }
                // $cart[$i]['product_price_excl_vat'] = $product_price_excl_vat;
                $this->_session->set('cart', $cart);
                if ($product->product_type == 'subscription') {
                    $subscription_detail = $this->_producthelper->getProductSubscriptionDetail($product->product_id, $cart[$i]['subscription_id']);
                    $selected_subscription = $subscription_detail->subscription_period . " " . $subscription_detail->period_type;
                    $cart_mdata = str_replace("{product_subscription_lbl}", JText::_('COM_REDSHOP_SUBSCRIPTION'), $cart_mdata);
                    $cart_mdata = str_replace("{product_subscription}", $selected_subscription, $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{product_subscription_lbl}", "", $cart_mdata);
                    $cart_mdata = str_replace("{product_subscription}", "", $cart_mdata);
                }
                if ($replace_button) {
                    $update_attribute = '';
                    if ($mainview == 'cart') {
                        $attchange = JURI::root() . 'index.php?option=com_redshop&view=cart&layout=change_attribute&tmpl=component&pid=' . $product_id . '&cart_index=' . $i;
                        $update_attribute = '<a class="modal" rel="{handler: \'iframe\', size: {x: 550, y: 400}}" href="' . $attchange . '">' . JText::_('COM_REDSHOP_CHANGE_ATTRIBUTE') . '</a>';
                    }
                    if ($cart_attribute != "") {
                        $cart_mdata = str_replace("{attribute_change}", $update_attribute, $cart_mdata);
                    } else {
                        $cart_mdata = str_replace("{attribute_change}", "", $cart_mdata);
                    }
                    $update_cart_none = '<label>' . $quantity . '</label>';
                    $update_img = '';
                    if ($mainview == 'checkout') {
                        $update_cart = $quantity;
                    } else {
                        $update_cart = '<form style="padding:0px;margin:0px;" name="update_cart' . $i . '" method="POST" >';
                        $update_cart .= '<input class="inputbox" type="text" value="' . $quantity . '" name="quantity" id="quantitybox' . $i . '" size="' . DEFAULT_QUANTITY . '" maxlength="' . DEFAULT_QUANTITY . '" onchange="validateInputNumber(this.id);">';
                        $update_cart .= '<input type="hidden" name="product_id" value="' . $product_id . '">
								<input type="hidden" name="cart_index" value="' . $i . '">
								<input type="hidden" name="Itemid" value="' . $Itemid . '">
								<input type="hidden" name="task" value="">';
                        if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . ADDTOCART_UPDATE)) {
                            $update_img = ADDTOCART_UPDATE;
                        } else {
                            $update_img = "defaultupdate.jpg";
                        }
                        $update_cart .= '<img class="update_cart" src="' . REDSHOP_FRONT_IMAGES_ABSPATH . $update_img . '" title="' . JText::_('COM_REDSHOP_UPDATE_PRODUCT_FROM_CART_LBL') . '" alt="' . JText::_('COM_REDSHOP_UPDATE_PRODUCT_FROM_CART_LBL') . '" onclick="document.update_cart' . $i . '.task.value=\'update\';document.update_cart' . $i . '.submit();">';
                        $update_cart .= '</form>';
                    }
                    $update_cart_minus_plus = '<form name="update_cart' . $i . '" method="POST">';
                    $update_cart_minus_plus .= '<input type="text" id="quantitybox' . $i . '" name="quantity"  size="1"  value="' . $quantity . '" /><input type="button" id="minus" value="-"
									    onClick="quantity.value = (quantity.value) ; var qty1 = quantity.value; if( !isNaN( qty1 ) &amp;&amp; qty1 > 1 ) quantity.value--;return false;">';
                    $update_cart_minus_plus .= '<input type="button" value="+"
									    onClick="quantity.value = (+quantity.value+1)"><input type="hidden" name="product_id" value="' . $product_id . '">
																	<input type="hidden" name="cart_index" value="' . $i . '">
																	<input type="hidden" name="Itemid" value="' . $Itemid . '">
																	<input type="hidden" name="task" value=""><img class="update_cart" src="' . REDSHOP_FRONT_IMAGES_ABSPATH . $update_img . '" title="' . JText::_('COM_REDSHOP_UPDATE_PRODUCT_FROM_CART_LBL') . '" alt="' . JText::_('COM_REDSHOP_UPDATE_PRODUCT_FROM_CART_LBL') . '" onclick="document.update_cart' . $i . '.task.value=\'update\';document.update_cart' . $i . '.submit();">
									</form>
									';
                    if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . ADDTOCART_DELETE)) {
                        $delete_img = ADDTOCART_DELETE;
                    } else {
                        $delete_img = "defaultcross.jpg";
                    }
                    $empty_cart = '<form style="padding:0px;margin:0px;" name="delete_cart' . $i . '" method="POST" >
								<input type="hidden" name="product_id" value="' . $product_id . '">
								<input type="hidden" name="task" value="">
								<input type="hidden" name="Itemid" value="' . $Itemid . '">
								<img class="delete_cart" src="' . REDSHOP_FRONT_IMAGES_ABSPATH . $delete_img . '"  onclick="document.delete_cart' . $i . '.task.value=\'delete\';document.delete_cart' . $i . '.submit();"></form>';
                    if ($mainview == 'checkout') {
                        $remove_product = '';
                    } else {
                        $remove_product = '<form style="padding:0px;margin:0px;" name="delete_cart' . $i . '" method="POST" >
								<input type="hidden" name="product_id" value="' . $product_id . '">
								<input type="hidden" name="cart_index" value="' . $i . '">
								<input type="hidden" name="task" value="">
								<input type="hidden" name="Itemid" value="' . $Itemid . '">
								<img class="delete_cart" src="' . REDSHOP_FRONT_IMAGES_ABSPATH . $delete_img . '" title="' . JText::_('COM_REDSHOP_DELETE_PRODUCT_FROM_CART_LBL') . '" alt="' . JText::_('COM_REDSHOP_DELETE_PRODUCT_FROM_CART_LBL') . '" onclick="document.delete_cart' . $i . '.task.value=\'delete\';document.delete_cart' . $i . '.submit();"></form>';
                    }
                    if (QUANTITY_TEXT_DISPLAY) {
                        if (strstr($cart_mdata, "{quantity_increase_decrease}") && $mainview == 'cart') {
                            $cart_mdata = str_replace("{quantity_increase_decrease}", $update_cart_minus_plus, $cart_mdata);
                            $cart_mdata = str_replace("{update_cart}", '', $cart_mdata);
                        } else {
                            $cart_mdata = str_replace("{quantity_increase_decrease}", $update_cart, $cart_mdata);
                            $cart_mdata = str_replace("{update_cart}", $update_cart, $cart_mdata);
                        }
                        $cart_mdata = str_replace("{remove_product}", $remove_product, $cart_mdata);
                    } else {
                        $cart_mdata = str_replace("{quantity_increase_decrease}", $update_cart_minus_plus, $cart_mdata);
                        $cart_mdata = str_replace("{update_cart}", $update_cart_none, $cart_mdata);
                        $cart_mdata = str_replace("{remove_product}", $remove_product, $cart_mdata);
                    }
                } else {
                    $cart_mdata = str_replace("{update_cart}", $quantity, $cart_mdata);
                    $cart_mdata = str_replace("{remove_product}", '', $cart_mdata);
                    $cart_mdata = str_replace("{attribute_change}", '', $cart_mdata);
                }
                $cart_mdata = $this->_producthelper->replaceVatinfo($cart_mdata);
                $cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata);
                $cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata);
            }
            // Plugin support:  Process the product plugin for cart item
            $dispatcher->trigger('onCartItemDisplay', array(&$cart_mdata, $cart, $i));
            $cart_tr .= $cart_mdata;
        }
        return $cart_tr;
    }
Пример #25
0
 /**
  * Method to delete cart entry from session
  *
  * @return void
  */
 public function delete()
 {
     $option = JRequest::getVar('option');
     $post = JRequest::get('post');
     $cartElement = $post['cart_index'];
     $Itemid = JRequest::getVar('Itemid');
     $redhelper = new redhelper();
     $Itemid = $redhelper->getCartItemid();
     $model = $this->getModel('cart');
     $model->delete($cartElement);
     $this->_carthelper->cartFinalCalculation();
     $this->_carthelper->carttodb();
     $link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);
     $this->setRedirect($link);
 }
Пример #26
0
 function get_category_tree($params, $category_id = 0, $links_css_class = "mainlevel", $list_css_class = "mm123", $highlighted_style = "font-style:italic;", $shopper_group_id)
 {
     $objhelper = new redhelper();
     $parent_selected = $params->get('redshop_category', '');
     $parent_selected_remove = $params->get('redshop_category_remove', '');
     $categories = $this->getCategoryTreeArray($only_published = 1, $keyword = "", $shopper_group_id, $parent_selected_remove);
     // $categories = $this->getCategoryTreeArray(); // Get array of category objects
     // Sort array of category objects
     $result = $this->sortCategoryTreeArray($categories, $parent_selected);
     $row_list = $result['row_list'];
     $depth_list = $result['depth_list'];
     $category_tmp = $result['category_tmp'];
     $nrows = sizeof($category_tmp);
     // Copy the Array into an Array with auto_incrementing Indexes
     // Array of category table primary keys
     $key = array_keys($categories);
     // Category count
     $nrows = $size = sizeOf($key);
     $html = "";
     // Find out if we have subcategories to display
     $allowed_subcategories = array();
     if (!empty($categories[$category_id]["category_parent_id"])) {
         // Find the Root Category of this category
         $root = $categories[$category_id];
         $allowed_subcategories[] = $categories[$category_id]["category_parent_id"];
         // Loop through the Tree up to the root
         while (!empty($root["category_parent_id"])) {
             $allowed_subcategories[] = $categories[$root["category_child_id"]]["category_child_id"];
             $root = $categories[$root["category_parent_id"]];
         }
     }
     // Fix the empty Array Fields
     if ($nrows < count($row_list)) {
         $nrows = count($row_list);
     }
     // Now show the categories
     for ($n = 0; $n < $nrows; $n++) {
         if (!isset($row_list[$n]) || !isset($category_tmp[$row_list[$n]]["category_child_id"])) {
             continue;
         }
         if ($category_id == $category_tmp[$row_list[$n]]["category_child_id"] || $category_tmp[$row_list[$n]]["category_child_id"] == $root["category_child_id"] || in_array($category_tmp[$row_list[$n]]["category_child_id"], $allowed_subcategories)) {
             $style = $highlighted_style;
         } else {
             $style = "";
         }
         $allowed = false;
         if ($depth_list[$n] > 0) {
             // Subcategory!
             if (isset($root) && in_array($category_tmp[$row_list[$n]]["category_child_id"], $allowed_subcategories) || $category_tmp[$row_list[$n]]["category_parent_id"] == $category_id || $category_tmp[$row_list[$n]]["category_parent_id"] == @$categories[$category_id]["category_parent_id"] || $category_tmp[$row_list[$n]]["category_parent_id"] == $root["category_child_id"]) {
                 $allowed = true;
             }
         } else {
             $allowed = true;
         }
         $append = "";
         $class = "";
         if ($allowed) {
             if ($n == 0) {
                 $html .= '<ul>';
             }
             if ($style == $highlighted_style) {
                 $append = '&id=active_menu';
                 $class = "class='active'";
             }
             if ($depth_list[$n] > 0) {
                 $css_class = "sublevel";
                 if ($depth_list[$n] > $sub) {
                     $html .= '<ul>';
                     $sub = $depth_list[$n];
                 }
                 if ($depth_list[$n] < $sub) {
                     for ($i = $depth_list[$n]; $i < $sub; $i++) {
                         $html .= '</ul></li>';
                     }
                     $sub = $depth_list[$n];
                 }
             } else {
                 $css_class = $links_css_class;
                 if ($sub > 0) {
                     $html .= str_repeat("</ul></li>", $sub);
                     $sub = 0;
                 }
                 $html .= "</li>";
             }
             $catname = JText::_($category_tmp[$row_list[$n]]["category_name"]);
             $Itemid = $objhelper->getCategoryItemid($category_tmp[$row_list[$n]]["category_child_id"]);
             if (!$Itemid) {
                 $Itemid = JRequest::getInt('Itemid');
             }
             $uri = JURI::getInstance();
             $url = $uri->root();
             $catlink = 'index.php?option=com_redshop&view=category&layout=detail&cid=' . $category_tmp[$row_list[$n]]["category_child_id"] . $append . '&Itemid=' . $Itemid;
             $html .= '
        <li ' . $class . ' ><a title="' . $catname . '" style="display:block;' . $style . '" class="' . $css_class . '" href=' . JRoute::_($catlink) . '>' . str_repeat("", $depth_list[$n]) . $catname . $this->products_in_category($category_tmp[$row_list[$n]]["category_child_id"], $params) . '</a>';
             if ($n == $nrows - 1) {
                 $html .= "</ul>";
             }
         }
     }
     return $html;
 }
Пример #27
0
if (!file_exists($configpath)) {
    error_reporting(0);
    $controller = 'redshop';
    JRequest::setVar('view', 'redshop');
    JRequest::setVar('layout', 'noconfig');
} else {
    require_once $configpath;
}
require_once JPATH_COMPONENT . '/helpers/configuration.php';
require_once JPATH_COMPONENT . '/helpers/template.php';
require_once JPATH_COMPONENT . '/helpers/stockroom.php';
require_once JPATH_COMPONENT . '/helpers/economic.php';
require_once JPATH_COMPONENT . '/helpers/access_level.php';
require_once JPATH_ROOT . '/components/com_redshop/helpers/helper.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/images.php';
$redhelper = new redhelper();
$redhelper->removeShippingRate();
$Redconfiguration = new Redconfiguration();
$Redconfiguration->defineDynamicVars();
$json_var = JRequest::getVar('json');
$view = JRequest::getVar('view');
$user = JFactory::getUser();
$usertype = array_keys($user->groups);
$user->usertype = $usertype[0];
$user->gid = $user->groups[$user->usertype];
if (ENABLE_BACKENDACCESS && $user->gid != 8 && !$json_var) {
    $access_rslt = new Redaccesslevel();
    $access_rslt->checkaccessofuser($user->gid);
}
if (ENABLE_BACKENDACCESS) {
    if ($user->gid != 8 && $view != '' && !$json_var) {
Пример #28
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSHOP_SHOPPER_GROUP_MANAGEMENT_DETAIL'), 'redshop_manufact48');
     $shoppergroup = new shoppergroup();
     $redhelper = new redhelper();
     $option = JRequest::getVar('option', '', 'request', 'string');
     $document = JFactory::getDocument();
     $document->addScript('components/' . $option . '/assets/js/json.js');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $uri = JFactory::getURI();
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->shopper_group_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_SHOPPER_GROUP') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_manufact48');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $groups = $shoppergroup->list_all("parent_id", $detail->shopper_group_id);
     $lists['groups'] = $groups;
     $model = $this->getModel('shopper_group_detail');
     $optioncustomer = array();
     $optioncustomer[] = JHTML::_('select.option', '-1', JText::_('COM_REDSHOP_SELECT'));
     $optioncustomer[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_COMPANY'));
     $optioncustomer[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_PRIVATE'));
     $lists['customertype'] = JHTML::_('select.genericlist', $optioncustomer, 'shopper_group_customer_type', 'class="inputbox" size="1" ', 'value', 'text', $detail->shopper_group_customer_type);
     $lists['portal'] = JHTML::_('select.booleanlist', 'shopper_group_portal', 'class="inputbox"', $detail->shopper_group_portal);
     $lists['default_shipping'] = JHTML::_('select.booleanlist', 'default_shipping', 'class="inputbox"', $detail->default_shipping);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     $lists['show_price_without_vat'] = JHTML::_('select.booleanlist', 'show_price_without_vat', 'class="inputbox"', $detail->show_price_without_vat);
     $lists['shopper_group_quotation_mode'] = JHTML::_('select.booleanlist', 'shopper_group_quotation_mode', 'class="inputbox"', $detail->shopper_group_quotation_mode);
     // For individual show_price and catalog
     $show_price_data = $redhelper->getPreOrderByList();
     $lists['show_price'] = JHTML::_('select.genericlist', $show_price_data, 'show_price', 'class="inputbox" size="1" ', 'value', 'text', $detail->show_price);
     $lists['use_as_catalog'] = JHTML::_('select.genericlist', $show_price_data, 'use_as_catalog', 'class="inputbox" size="1" ', 'value', 'text', $detail->use_as_catalog);
     $shopper_group_categories = $detail->shopper_group_categories;
     $shopper_group_categories = explode(",", $shopper_group_categories);
     $shoppergroup_category = new product_category();
     $categories = $shoppergroup_category->list_all("shopper_group_categories[]", 0, $shopper_group_categories, 20, true, true, array(), 250);
     $lists['categories'] = $categories;
     $shopper_group_manufactures = '';
     if (isset($detail->shopper_group_manufactures)) {
         $shopper_group_manufactures = $detail->shopper_group_manufactures;
     }
     $shopper_group_manufactures = explode(",", $shopper_group_manufactures);
     $manufacturers = $model->getmanufacturers();
     $lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'shopper_group_manufactures[]', 'class="inputbox"  multiple="multiple"  size="10" style="width: 250px;"> ', 'value', 'text', $shopper_group_manufactures);
     $vatgroup = $model->getVatGroup();
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $vatgroup = @array_merge($tmp, $vatgroup);
     $lists['tax_group_id'] = JHTML::_('select.genericlist', $vatgroup, 'tax_group_id', 'class="inputbox" size="1"', 'value', 'text', $detail->tax_group_id);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #29
0
 public function getRelatedtemplateView($template_desc, $product_id)
 {
     $extra_field = new extraField();
     $config = new Redconfiguration();
     $redTemplate = new Redtemplate();
     $redhelper = new redhelper();
     $related_product = $this->getRelatedProduct($product_id);
     $related_template = $this->getRelatedProductTemplate($template_desc);
     $option = 'com_redshop';
     $fieldArray = $extra_field->getSectionFieldList(17, 0, 0);
     if (count($related_template) > 0) {
         if (count($related_product) > 0 && strstr($related_template->template_desc, "{related_product_start}") && strstr($related_template->template_desc, "{related_product_end}")) {
             $related_template_data = '';
             $product_start = explode("{related_product_start}", $related_template->template_desc);
             $product_end = explode("{related_product_end}", $product_start[1]);
             $tempdata_div_start = $product_start[0];
             $tempdata_div_middle = $product_end[0];
             $tempdata_div_end = $product_end[1];
             $attribute_template = $this->getAttributeTemplate($tempdata_div_middle);
             for ($r = 0; $r < count($related_product); $r++) {
                 $related_template_data .= $tempdata_div_middle;
                 $ItemData = $this->getMenuInformation(0, 0, '', 'product&pid=' . $related_product[$r]->product_id);
                 if (count($ItemData) > 0) {
                     $pItemid = $ItemData->id;
                 } else {
                     $pItemid = $redhelper->getItemid($related_product[$r]->product_id);
                 }
                 $rlink = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $related_product[$r]->product_id . '&Itemid=' . $pItemid);
                 if (strstr($related_template_data, "{relproduct_image_3}")) {
                     $rpimg_tag = '{relproduct_image_3}';
                     $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT_3;
                     $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH_3;
                 } elseif (strstr($related_template_data, "{relproduct_image_2}")) {
                     $rpimg_tag = '{relproduct_image_2}';
                     $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT_2;
                     $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH_2;
                 } elseif (strstr($related_template_data, "{relproduct_image_1}")) {
                     $rpimg_tag = '{relproduct_image_1}';
                     $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT;
                     $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH;
                 } else {
                     $rpimg_tag = '{relproduct_image}';
                     $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT;
                     $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH;
                 }
                 $hidden_thumb_image = "<input type='hidden' name='rel_main_imgwidth' id='rel_main_imgwidth' value='" . $rpw_thumb . "'><input type='hidden' name='rel_main_imgheight' id='rel_main_imgheight' value='" . $rph_thumb . "'>";
                 $relimage = $this->getProductImage($related_product[$r]->product_id, $rlink, $rpw_thumb, $rph_thumb);
                 $related_template_data = str_replace($rpimg_tag, $relimage . $hidden_thumb_image, $related_template_data);
                 if (strstr($related_template_data, "{relproduct_link}")) {
                     $rpname = "<a href='" . $rlink . "' title='" . $related_product[$r]->product_name . "'>" . $config->maxchar($related_product[$r]->product_name, RELATED_PRODUCT_TITLE_MAX_CHARS, RELATED_PRODUCT_TITLE_END_SUFFIX) . "</a>";
                 } else {
                     $rpname = $config->maxchar($related_product[$r]->product_name, RELATED_PRODUCT_TITLE_MAX_CHARS, RELATED_PRODUCT_TITLE_END_SUFFIX);
                 }
                 $rpdesc = $config->maxchar($related_product[$r]->product_desc, RELATED_PRODUCT_DESC_MAX_CHARS, RELATED_PRODUCT_DESC_END_SUFFIX);
                 $rp_shortdesc = $config->maxchar($related_product[$r]->product_s_desc, RELATED_PRODUCT_SHORT_DESC_MAX_CHARS, RELATED_PRODUCT_SHORT_DESC_END_SUFFIX);
                 $related_template_data = str_replace("{relproduct_link}", '', $related_template_data);
                 if (strstr($related_template_data, "{relproduct_link}")) {
                     $related_template_data = str_replace("{relproduct_name}", "", $related_template_data);
                 } else {
                     $related_template_data = str_replace("{relproduct_name}", $rpname, $related_template_data);
                 }
                 $related_template_data = str_replace("{relproduct_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER_LBL'), $related_template_data);
                 $related_template_data = str_replace("{relproduct_number}", $related_product[$r]->product_number, $related_template_data);
                 $related_template_data = str_replace("{relproduct_s_desc}", $rp_shortdesc, $related_template_data);
                 $related_template_data = str_replace("{relproduct_desc}", $rpdesc, $related_template_data);
                 // ProductFinderDatepicker Extra Field Start
                 $related_template_data = $this->getProductFinderDatepickerValue($related_template_data, $related_product[$r]->product_id, $fieldArray);
                 // ProductFinderDatepicker Extra Field End
                 if (strstr($related_template_data, "{manufacturer_name}") || strstr($related_template_data, "{manufacturer_link}")) {
                     $manufacturer = $this->getSection("manufacturer", $related_product[$r]->manufacturer_id);
                     if (count($manufacturer) > 0) {
                         $man_url = JRoute::_('index.php?option=' . $option . '&view=manufacturers&layout=products&mid=' . $related_product[$r]->manufacturer_id . '&Itemid=' . $pItemid);
                         $manufacturerLink = "<a href='" . $man_url . "'>" . JText::_("COM_REDSHOP_VIEW_ALL_MANUFACTURER_PRODUCTS") . "</a>";
                         $related_template_data = str_replace("{manufacturer_name}", $manufacturer->manufacturer_name, $related_template_data);
                         $related_template_data = str_replace("{manufacturer_link}", $manufacturerLink, $related_template_data);
                     } else {
                         $related_template_data = str_replace("{manufacturer_name}", '', $related_template_data);
                         $related_template_data = str_replace("{manufacturer_link}", '', $related_template_data);
                     }
                 }
                 $relmorelink = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $related_product[$r]->product_id . '&cid=' . $related_product[$r]->cat_in_sefurl . '&Itemid=' . $pItemid);
                 $rmore = "<a href='" . $relmorelink . "' title='" . $related_product[$r]->product_name . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>";
                 $related_template_data = str_replace("{read_more}", $rmore, $related_template_data);
                 $related_template_data = str_replace("{read_more_link}", $relmorelink, $related_template_data);
                 /*
                  *  related product Required Attribute start
                  * 	this will parse only Required Attributes
                  */
                 $relid = $related_product[$r]->product_id;
                 $attributes_set = array();
                 if ($related_product[$r]->attribute_set_id > 0) {
                     $attributes_set = $this->getProductAttribute(0, $related_product[$r]->attribute_set_id);
                 }
                 $attributes = $this->getProductAttribute($relid);
                 $attributes = array_merge($attributes, $attributes_set);
                 $related_template_data = $this->replaceAttributeData($related_product[$r]->mainproduct_id, 0, $related_product[$r]->product_id, $attributes, $related_template_data, $attribute_template);
                 // Check product for not for sale
                 $related_template_data = $this->getProductNotForSaleComment($related_product[$r], $related_template_data, $attributes, 1);
                 $related_template_data = $this->replaceCartTemplate($related_product[$r]->mainproduct_id, 0, 0, $related_product[$r]->product_id, $related_template_data, false, 0, count($attributes), 0, 0);
                 $related_template_data = $this->replaceCompareProductsButton($related_product[$r]->product_id, 0, $related_template_data, 1);
                 $related_template_data = $this->replaceProductInStock($related_product[$r]->product_id, $related_template_data);
                 $related_template_data = $this->getProductOnSaleComment($related_product[$r], $related_template_data);
                 $related_template_data = $this->getSpecialProductComment($related_product[$r], $related_template_data);
                 // related product attribute price list
                 $related_template_data = $this->replaceAttributePriceList($related_product[$r]->product_id, $related_template_data);
             }
             $related_template_data = $tempdata_div_start . $related_template_data . $tempdata_div_end;
             $template_desc = str_replace("{related_product:{$related_template->template_name}}", $related_template_data, $template_desc);
             $template_desc = $redTemplate->parseredSHOPplugin($template_desc);
         } else {
             $template_desc = str_replace("{related_product:{$related_template->template_name}}", "", $template_desc);
         }
     }
     return $template_desc;
 }
Пример #30
0
 public function display($tpl = null)
 {
     $db = JFactory::getDbo();
     $option = JRequest::getVar('option');
     $document = JFactory::getDocument();
     $layout = JRequest::getVar('layout');
     if ($layout == "resettemplate") {
         $tpl = "resettemplate";
     }
     $document->setTitle(JText::_('COM_REDSHOP_CONFIG'));
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $document->addScript('components/' . $option . '/assets/js/select_sort.js');
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $currency_data = JRequest::getVar('currency_data');
     $redhelper = new redhelper();
     $config = new Redconfiguration();
     $redTemplate = new Redtemplate();
     $extra_field = new extra_field();
     $userhelper = new rsUserhelper();
     $lists = array();
     // Load language file
     $payment_lang_list = $redhelper->getallPlugins("redshop_payment");
     $language = JFactory::getLanguage();
     $base_dir = JPATH_ADMINISTRATOR;
     $language_tag = $language->getTag();
     for ($l = 0; $l < count($payment_lang_list); $l++) {
         $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element;
         $language->load($extension, $base_dir, $language_tag, true);
     }
     $configpath = JPATH_COMPONENT . '/helpers/redshop.cfg.php';
     if (!is_writable($configpath)) {
         JError::raiseWarning(21, JText::_('COM_REDSHOP_CONFIGURATION_FILE_IS_NOT_WRITABLE'));
     }
     JToolBarHelper::title(JText::_('COM_REDSHOP_CONFIG'), 'redshop_icon-48-settings');
     if (is_writable($configpath)) {
         JToolBarHelper::save();
         JToolBarHelper::apply();
     }
     JToolBarHelper::cancel();
     jimport('joomla.html.pane');
     $pane = JPane::getInstance('sliders');
     $this->pane = $pane;
     $uri = JFactory::getURI();
     $this->setLayout('default');
     $model = $this->getModel('configuration');
     $newsletters = $model->getnewsletters();
     $templatesel = array();
     $templatesel[0] = new stdClass();
     $templatesel[0]->template_id = 0;
     $templatesel[0]->template_name = JText::_('COM_REDSHOP_SELECT');
     $product_template = $redTemplate->getTemplate("product");
     $compare_template = $redTemplate->getTemplate("compare_product");
     $category_template = $redTemplate->getTemplate("category");
     $categorylist_template = $redTemplate->getTemplate("frontpage_category");
     $manufacturer_template = $redTemplate->getTemplate("manufacturer_products");
     $ajax_detail_template = $redTemplate->getTemplate("ajax_cart_detail_box");
     $product_template = array_merge($templatesel, $product_template);
     $compare_template = array_merge($templatesel, $compare_template);
     $category_template = array_merge($templatesel, $category_template);
     $categorylist_template = array_merge($templatesel, $categorylist_template);
     $manufacturer_template = array_merge($templatesel, $manufacturer_template);
     $ajax_detail_template = array_merge($templatesel, $ajax_detail_template);
     $shopper_groups = $userhelper->getShopperGroupList();
     if (count($shopper_groups) <= 0) {
         $shopper_groups = array();
     }
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $new_shopper_group_get_value_from = array_merge($tmp, $shopper_groups);
     defined('CALCULATION_PRICE_DECIMAL') ? CALCULATION_PRICE_DECIMAL : define('CALCULATION_PRICE_DECIMAL', '4');
     defined('NEW_SHOPPER_GROUP_GET_VALUE_FROM') ? NEW_SHOPPER_GROUP_GET_VALUE_FROM : define('NEW_SHOPPER_GROUP_GET_VALUE_FROM', '0');
     defined('IMAGE_QUALITY_OUTPUT') ? IMAGE_QUALITY_OUTPUT : define('IMAGE_QUALITY_OUTPUT', '70');
     $lists['new_shopper_group_get_value_from'] = JHTML::_('select.genericlist', $new_shopper_group_get_value_from, 'new_shopper_group_get_value_from', 'class="inputbox" ', 'value', 'text', NEW_SHOPPER_GROUP_GET_VALUE_FROM);
     defined('MANUFACTURER_TITLE_MAX_CHARS') ? MANUFACTURER_TITLE_MAX_CHARS : define('MANUFACTURER_TITLE_MAX_CHARS', '');
     defined('MANUFACTURER_TITLE_END_SUFFIX') ? MANUFACTURER_TITLE_END_SUFFIX : define('MANUFACTURER_TITLE_END_SUFFIX', '');
     defined('WRITE_REVIEW_IS_LIGHTBOX') ? WRITE_REVIEW_IS_LIGHTBOX : define('WRITE_REVIEW_IS_LIGHTBOX', '0');
     $lists['write_review_is_lightbox'] = JHTML::_('select.booleanlist', 'write_review_is_lightbox', 'class="inputbox" ', WRITE_REVIEW_IS_LIGHTBOX);
     defined('NOOF_SUBATTRIB_THUMB_FOR_SCROLLER') ? NOOF_SUBATTRIB_THUMB_FOR_SCROLLER : define('NOOF_SUBATTRIB_THUMB_FOR_SCROLLER', '3');
     defined('ACCESSORY_PRODUCT_IN_LIGHTBOX') ? ACCESSORY_PRODUCT_IN_LIGHTBOX : define('ACCESSORY_PRODUCT_IN_LIGHTBOX', '0');
     $lists['accessory_product_in_lightbox'] = JHTML::_('select.booleanlist', 'accessory_product_in_lightbox', 'class="inputbox" ', ACCESSORY_PRODUCT_IN_LIGHTBOX);
     $show_price_user_group_list = explode(',', SHOW_PRICE_USER_GROUP_LIST);
     defined('REQUESTQUOTE_IMAGE') ? REQUESTQUOTE_IMAGE : define('REQUESTQUOTE_IMAGE', 'requestquote.gif');
     defined('REQUESTQUOTE_BACKGROUND') ? REQUESTQUOTE_BACKGROUND : define('REQUESTQUOTE_BACKGROUND', 'requestquotebg.jpg');
     defined('WEBPACK_ENABLE_SMS') ? WEBPACK_ENABLE_SMS : define('WEBPACK_ENABLE_SMS', '1');
     $lists['webpack_enable_sms'] = JHTML::_('select.booleanlist', 'webpack_enable_sms', 'class="inputbox" size="1"', WEBPACK_ENABLE_SMS);
     defined('WEBPACK_ENABLE_EMAIL_TRACK') ? WEBPACK_ENABLE_EMAIL_TRACK : define('WEBPACK_ENABLE_EMAIL_TRACK', '1');
     $lists['webpack_enable_email_track'] = JHTML::_('select.booleanlist', 'webpack_enable_email_track', 'class="inputbox" size="1"', WEBPACK_ENABLE_EMAIL_TRACK);
     defined('DEFAULT_STOCKAMOUNT_THUMB_WIDTH') ? DEFAULT_STOCKAMOUNT_THUMB_WIDTH : define('DEFAULT_STOCKAMOUNT_THUMB_WIDTH', '150');
     defined('DEFAULT_STOCKAMOUNT_THUMB_HEIGHT') ? DEFAULT_STOCKAMOUNT_THUMB_HEIGHT : define('DEFAULT_STOCKAMOUNT_THUMB_HEIGHT', '90');
     defined('AJAX_DETAIL_BOX_WIDTH') ? AJAX_DETAIL_BOX_WIDTH : define('AJAX_DETAIL_BOX_WIDTH', '500');
     defined('AJAX_DETAIL_BOX_HEIGHT') ? AJAX_DETAIL_BOX_HEIGHT : define('AJAX_DETAIL_BOX_HEIGHT', '600');
     defined('AJAX_BOX_WIDTH') ? AJAX_BOX_WIDTH : define('AJAX_BOX_WIDTH', '500');
     defined('AJAX_BOX_HEIGHT') ? AJAX_BOX_HEIGHT : define('AJAX_BOX_HEIGHT', '150');
     $q = "SELECT  country_3_code as value,country_name as text,country_jtext from #__" . TABLE_PREFIX . "_country ORDER BY country_name ASC";
     $db->setQuery($q);
     $countries = $db->loadObjectList();
     $countries = $redhelper->convertLanguageString($countries);
     $q = "SELECT  stockroom_id as value,stockroom_name as text from #__" . TABLE_PREFIX . "_stockroom ORDER BY stockroom_name ASC";
     $db->setQuery($q);
     $stockroom = $db->loadObjectList();
     $country_list = explode(',', COUNTRY_LIST);
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $economic_accountgroup = $redhelper->getEconomicAccountGroup();
     $economic_accountgroup = array_merge($tmp, $economic_accountgroup);
     $lists['default_economic_account_group'] = JHTML::_('select.genericlist', $economic_accountgroup, 'default_economic_account_group', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_ECONOMIC_ACCOUNT_GROUP);
     defined('ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC') ? ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC : define('ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC', '0');
     $tmpoption = array();
     $tmpoption[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_NO'));
     $tmpoption[] = JHTML::_('select.option', 1, JText::_('COM_REDSHOP_ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC_LBL'));
     $tmpoption[] = JHTML::_('select.option', 2, JText::_('COM_REDSHOP_ATTRIBUTE_PLUS_PRODUCT_IN_ECONOMIC_LBL'));
     $lists['attribute_as_product_in_economic'] = JHTML::_('select.genericlist', $tmpoption, 'attribute_as_product_in_economic', 'class="inputbox" size="1" ', 'value', 'text', ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC);
     defined('DETAIL_ERROR_MESSAGE_ON') ? DETAIL_ERROR_MESSAGE_ON : define('DETAIL_ERROR_MESSAGE_ON', '1');
     $lists['detail_error_message_on'] = JHTML::_('select.booleanlist', 'detail_error_message_on', 'class="inputbox" ', DETAIL_ERROR_MESSAGE_ON);
     defined('PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE') ? PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE : define('PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE', '');
     $lists['newsletters'] = JHTML::_('select.genericlist', $newsletters, 'default_newsletter', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_NEWSLETTER);
     $lists['currency_data'] = JHTML::_('select.genericlist', $currency_data, 'currency_code', 'class="inputbox" size="1" ', 'value', 'text', CURRENCY_CODE);
     defined('USE_ENCODING') ? USE_ENCODING : define('USE_ENCODING', '0');
     $lists['use_encoding'] = JHTML::_('select.booleanlist', 'use_encoding', 'class="inputbox" ', USE_ENCODING);
     defined('REQUIRED_VAT_NUMBER') ? REQUIRED_VAT_NUMBER : define('REQUIRED_VAT_NUMBER', '1');
     $lists['required_vat_number'] = JHTML::_('select.booleanlist', 'required_vat_number', 'class="inputbox" ', REQUIRED_VAT_NUMBER);
     $lists['coupons_enable'] = JHTML::_('select.booleanlist', 'coupons_enable', 'class="inputbox" ', COUPONS_ENABLE);
     $lists['vouchers_enable'] = JHTML::_('select.booleanlist', 'vouchers_enable', 'class="inputbox" ', VOUCHERS_ENABLE);
     $lists['manufacturer_mail_enable'] = JHTML::_('select.booleanlist', 'manufacturer_mail_enable', 'class="inputbox" ', MANUFACTURER_MAIL_ENABLE);
     defined('SUPPLIER_MAIL_ENABLE') ? SUPPLIER_MAIL_ENABLE : define('SUPPLIER_MAIL_ENABLE', '0');
     defined('COMPARE_PRODUCT_THUMB_WIDTH') ? COMPARE_PRODUCT_THUMB_WIDTH : define('COMPARE_PRODUCT_THUMB_WIDTH', '70');
     defined('COMPARE_PRODUCT_THUMB_HEIGHT') ? COMPARE_PRODUCT_THUMB_HEIGHT : define('COMPARE_PRODUCT_THUMB_HEIGHT', '70');
     $lists['supplier_mail_enable'] = JHTML::_('select.booleanlist', 'supplier_mail_enable', 'class="inputbox" ', SUPPLIER_MAIL_ENABLE);
     $lists['splitable_payment'] = JHTML::_('select.booleanlist', 'splitable_payment', 'class="inputbox"', SPLITABLE_PAYMENT);
     $lists['show_captcha'] = JHTML::_('select.booleanlist', 'show_captcha', 'class="inputbox"', SHOW_CAPTCHA);
     $lists['create_account_checkbox'] = JHTML::_('select.booleanlist', 'create_account_checkbox', 'class="inputbox"', CREATE_ACCOUNT_CHECKBOX);
     $lists['show_email_verification'] = JHTML::_('select.booleanlist', 'show_email_verification', 'class="inputbox"', SHOW_EMAIL_VERIFICATION);
     $lists['quantity_text_display'] = JHTML::_('select.booleanlist', 'quantity_text_display', 'class="inputbox"', QUANTITY_TEXT_DISPLAY);
     $lists['enable_sef_product_number'] = JHTML::_('select.booleanlist', 'enable_sef_product_number', 'class="inputbox"', ENABLE_SEF_PRODUCT_NUMBER);
     $lists['enable_sef_number_name'] = JHTML::_('select.booleanlist', 'enable_sef_number_name', 'class="inputbox"', ENABLE_SEF_NUMBER_NAME, 'COM_REDSHOP_NAME', 'COM_REDSHOP_ID');
     $lists['category_in_sef_url'] = JHTML::_('select.booleanlist', 'category_in_sef_url', 'class="inputbox"', CATEGORY_IN_SEF_URL);
     $lists['autogenerated_seo'] = JHTML::_('select.booleanlist', 'autogenerated_seo', 'class="inputbox"', AUTOGENERATED_SEO);
     $lists['shop_country'] = JHTML::_('select.genericlist', $countries, 'shop_country', 'class="inputbox" size="1" ', 'value', 'text', SHOP_COUNTRY);
     $lists['default_shipping_country'] = JHTML::_('select.genericlist', $countries, 'default_shipping_country', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_SHIPPING_COUNTRY);
     // Default_shipping_country
     $lists['show_shipping_in_cart'] = JHTML::_('select.booleanlist', 'show_shipping_in_cart', 'class="inputbox"', SHOW_SHIPPING_IN_CART);
     $lists['discount_mail_send'] = JHTML::_('select.booleanlist', 'discount_mail_send', 'class="inputbox"', DISCOUNT_MAIL_SEND);
     defined('SPECIAL_DISCOUNT_MAIL_SEND') ? SPECIAL_DISCOUNT_MAIL_SEND : define('SPECIAL_DISCOUNT_MAIL_SEND', '1');
     $lists['special_discount_mail_send'] = JHTML::_('select.booleanlist', 'special_discount_mail_send', 'class="inputbox"', SPECIAL_DISCOUNT_MAIL_SEND);
     $lists['economic_integration'] = JHTML::_('select.booleanlist', 'economic_integration', 'class="inputbox"', ECONOMIC_INTEGRATION);
     $discoupon_percent_or_total = array(JHTML::_('select.option', 0, JText::_('COM_REDSHOP_TOTAL')), JHTML::_('select.option', 1, JText::_('COM_REDSHOP_PERCENTAGE')));
     $lists['discoupon_percent_or_total'] = JHTML::_('select.genericlist', $discoupon_percent_or_total, 'discoupon_percent_or_total', 'class="inputbox" size="1"', 'value', 'text', DISCOUPON_PERCENT_OR_TOTAL);
     $lists['use_container'] = JHTML::_('select.booleanlist', 'use_container', 'class="inputbox" size="1"', USE_CONTAINER);
     $lists['use_stockroom'] = JHTML::_('select.booleanlist', 'use_stockroom', 'class="inputbox" size="1"', USE_STOCKROOM);
     $lists['use_blank_as_infinite'] = JHTML::_('select.booleanlist', 'use_blank_as_infinite', 'class="inputbox" size="1"', USE_BLANK_AS_INFINITE);
     $lists['allow_pre_order'] = JHTML::_('select.booleanlist', 'allow_pre_order', 'class="inputbox" size="1"', ALLOW_PRE_ORDER);
     $lists['onestep_checkout_enable'] = JHTML::_('select.booleanlist', 'onestep_checkout_enable', 'class="inputbox" size="1"', ONESTEP_CHECKOUT_ENABLE);
     $lists['ssl_enable_in_checkout'] = JHTML::_('select.booleanlist', 'ssl_enable_in_checkout', 'class="inputbox" size="1"', SSL_ENABLE_IN_CHECKOUT);
     $lists['twoway_related_product'] = JHTML::_('select.booleanlist', 'twoway_related_product', 'class="inputbox" size="1"', TWOWAY_RELATED_PRODUCT);
     // For child product opttion
     defined('CHILDPRODUCT_DROPDOWN') ? CHILDPRODUCT_DROPDOWN : define('CHILDPRODUCT_DROPDOWN', 'product_name');
     $chilproduct_data = $redhelper->getChildProductOption();
     $lists['childproduct_dropdown'] = JHTML::_('select.genericlist', $chilproduct_data, 'childproduct_dropdown', 'class="inputbox" size="1" ', 'value', 'text', CHILDPRODUCT_DROPDOWN);
     defined('PURCHASE_PARENT_WITH_CHILD') ? PURCHASE_PARENT_WITH_CHILD : define('PURCHASE_PARENT_WITH_CHILD', '0');
     $lists['purchase_parent_with_child'] = JHTML::_('select.booleanlist', 'purchase_parent_with_child', 'class="inputbox" size="1"', PURCHASE_PARENT_WITH_CHILD);
     $lists['product_hover_image_enable'] = JHTML::_('select.booleanlist', 'product_hover_image_enable', 'class="inputbox" size="1"', PRODUCT_HOVER_IMAGE_ENABLE);
     $lists['additional_hover_image_enable'] = JHTML::_('select.booleanlist', 'additional_hover_image_enable', 'class="inputbox" size="1"', ADDITIONAL_HOVER_IMAGE_ENABLE);
     $lists['ssl_enable_in_backend'] = JHTML::_('select.booleanlist', 'ssl_enable_in_backend', 'class="inputbox" size="1"', SSL_ENABLE_IN_BACKEND);
     $lists['use_tax_exempt'] = JHTML::_('select.booleanlist', 'use_tax_exempt', 'class="inputbox" size="1"', USE_TAX_EXEMPT);
     $lists['tax_exempt_apply_vat'] = JHTML::_('select.booleanlist', 'tax_exempt_apply_vat', 'class="inputbox" size="1"', TAX_EXEMPT_APPLY_VAT);
     $lists['couponinfo'] = JHTML::_('select.booleanlist', 'couponinfo', 'class="inputbox" size="1"', COUPONINFO);
     $lists['my_tags'] = JHTML::_('select.booleanlist', 'my_tags', 'class="inputbox" size="1"', MY_TAGS);
     $lists['my_wishlist'] = JHTML::_('select.booleanlist', 'my_wishlist', 'class="inputbox" size="1"', MY_WISHLIST);
     $lists['compare_products'] = JHTML::_('select.booleanlist', 'compare_products', 'class="inputbox" size="1"', COMARE_PRODUCTS);
     $lists['country_list'] = JHTML::_('select.genericlist', $countries, 'country_list[]', 'class="inputbox" multiple="multiple"', 'value', 'text', $country_list);
     $lists['product_detail_is_lightbox'] = JHTML::_('select.booleanlist', 'product_detail_is_lightbox', 'class="inputbox" size="1"', PRODUCT_DETAIL_IS_LIGHTBOX);
     $lists['new_customer_selection'] = JHTML::_('select.booleanlist', 'new_customer_selection', 'class="inputbox" size="1"', NEW_CUSTOMER_SELECTION);
     $lists['ajax_cart_box'] = JHTML::_('select.booleanlist', 'ajax_cart_box', 'class="inputbox" size="1"', AJAX_CART_BOX);
     $lists['is_product_reserve'] = JHTML::_('select.booleanlist', 'is_product_reserve', 'class="inputbox" size="1"', IS_PRODUCT_RESERVE);
     $lists['product_is_lightbox'] = JHTML::_('select.booleanlist', 'product_is_lightbox', 'class="inputbox" size="1"', PRODUCT_IS_LIGHTBOX);
     $lists['product_addimg_is_lightbox'] = JHTML::_('select.booleanlist', 'product_addimg_is_lightbox', 'class="inputbox" size="1"', PRODUCT_ADDIMG_IS_LIGHTBOX);
     $lists['cat_is_lightbox'] = JHTML::_('select.booleanlist', 'cat_is_lightbox', 'class="inputbox" size="1"', CAT_IS_LIGHTBOX);
     $lists['default_stockroom'] = JHTML::_('select.genericlist', $stockroom, 'default_stockroom', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_STOCKROOM);
     $lists['portalshop'] = JHTML::_('select.booleanlist', 'portal_shop', 'class="inputbox" size="1"', PORTAL_SHOP);
     $lists['use_image_size_swapping'] = JHTML::_('select.booleanlist', 'use_image_size_swapping', 'class="inputbox" size="1"', USE_IMAGE_SIZE_SWAPPING);
     $lists['apply_vat_on_discount'] = JHTML::_('select.booleanlist', 'apply_vat_on_discount', 'class="inputbox" size="1"', APPLY_VAT_ON_DISCOUNT, $yes = JText::_('COM_REDSHOP_BEFORE_DISCOUNT'), $no = JText::_('COM_REDSHOP_AFTER_DISCOUNT'));
     $lists['auto_scroll_wrapper'] = JHTML::_('select.booleanlist', 'auto_scroll_wrapper', 'class="inputbox" size="1"', AUTO_SCROLL_WRAPPER);
     $lists['allow_multiple_discount'] = JHTML::_('select.booleanlist', 'allow_multiple_discount', 'class="inputbox" size="1"', ALLOW_MULTIPLE_DISCOUNT);
     defined('SHOW_PRODUCT_DETAIL') ? SHOW_PRODUCT_DETAIL : define('SHOW_PRODUCT_DETAIL', '1');
     $lists['show_product_detail'] = JHTML::_('select.booleanlist', 'show_product_detail', 'class="inputbox" size="1"', SHOW_PRODUCT_DETAIL);
     $lists['compare_template_id'] = JHTML::_('select.genericlist', $compare_template, 'compare_template_id', 'class="inputbox" size="1" ', 'template_id', 'template_name', COMPARE_TEMPLATE_ID);
     defined('SHOW_TERMS_AND_CONDITIONS') ? SHOW_TERMS_AND_CONDITIONS : define('SHOW_TERMS_AND_CONDITIONS', '0');
     $lists['show_terms_and_conditions'] = JHTML::_('select.booleanlist', 'show_terms_and_conditions', 'class="inputbox" size="1"', SHOW_TERMS_AND_CONDITIONS, $yes = JText::_('COM_REDSHOP_SHOW_PER_USER'), $no = JText::_('COM_REDSHOP_SHOW_PER_ORDER'));
     defined('RATING_REVIEW_LOGIN_REQUIRED') ? RATING_REVIEW_LOGIN_REQUIRED : define('RATING_REVIEW_LOGIN_REQUIRED', '1');
     $lists['rating_review_login_required'] = JHTML::_('select.booleanlist', 'rating_review_login_required', 'class="inputbox" size="1"', RATING_REVIEW_LOGIN_REQUIRED);
     $product_comparison = array();
     $product_comparison[] = JHTML::_('select.option', '', JText::_('COM_REDSHOP_SELECT'));
     $product_comparison[] = JHTML::_('select.option', 'category', JText::_('COM_REDSHOP_CATEGORY'));
     $product_comparison[] = JHTML::_('select.option', 'global', JText::_('COM_REDSHOP_GLOBAL'));
     $pagination = array(0 => array("value" => 0, "text" => "Joomla"), 1 => array("value" => 1, "text" => "Redshop"));
     $lists['product_comparison_type'] = JHTML::_('select.genericlist', $product_comparison, 'product_comparison_type', 'class="inputbox" size="1"', 'value', 'text', PRODUCT_COMPARISON_TYPE);
     $lists['pagination'] = JHTML::_('select.genericlist', $pagination, 'pagination', 'class="inputbox" size="1" ', 'value', 'text', PAGINATION);
     $lists['newsletter_enable'] = JHTML::_('select.booleanlist', 'newsletter_enable', 'class="inputbox" size="1"', NEWSLETTER_ENABLE);
     $lists['newsletter_confirmation'] = JHTML::_('select.booleanlist', 'newsletter_confirmation', 'class="inputbox" size="1"', NEWSLETTER_CONFIRMATION);
     $lists['watermark_category_image'] = JHTML::_('select.booleanlist', 'watermark_category_image', 'class="inputbox" size="1"', WATERMARK_CATEGORY_IMAGE);
     $lists['watermark_category_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_category_thumb_image', 'class="inputbox" size="1"', WATERMARK_CATEGORY_THUMB_IMAGE);
     $lists['watermark_product_image'] = JHTML::_('select.booleanlist', 'watermark_product_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_IMAGE);
     $lists['watermark_product_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_product_thumb_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_THUMB_IMAGE);
     defined('WATERMARK_PRODUCT_ADDITIONAL_IMAGE') ? WATERMARK_PRODUCT_ADDITIONAL_IMAGE : define('WATERMARK_PRODUCT_ADDITIONAL_IMAGE', '0');
     $lists['watermark_product_additional_image'] = JHTML::_('select.booleanlist', 'watermark_product_additional_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_ADDITIONAL_IMAGE);
     $lists['watermark_cart_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_cart_thumb_image', 'class="inputbox" size="1"', WATERMARK_CART_THUMB_IMAGE);
     $lists['watermark_giftcart_image'] = JHTML::_('select.booleanlist', 'watermark_giftcart_image', 'class="inputbox" size="1"', WATERMARK_GIFTCART_IMAGE);
     $lists['watermark_giftcart_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_giftcart_thumb_image', 'class="inputbox" size="1"', WATERMARK_GIFTCART_THUMB_IMAGE);
     $lists['watermark_manufacturer_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_manufacturer_thumb_image', 'class="inputbox" size="1"', WATERMARK_MANUFACTURER_THUMB_IMAGE);
     $lists['watermark_manufacturer_image'] = JHTML::_('select.booleanlist', 'watermark_manufacturer_image', 'class="inputbox" size="1"', WATERMARK_MANUFACTURER_IMAGE);
     $lists['clickatell_enable'] = JHTML::_('select.booleanlist', 'clickatell_enable', 'class="inputbox" size="1"', CLICKATELL_ENABLE);
     $lists['quotation_mode'] = JHTML::_('select.booleanlist', 'default_quotation_mode', 'onclick="return quote_price(this.value);" class="inputbox" size="1"', DEFAULT_QUOTATION_MODE_PRE, $yes = JText::_('COM_REDSHOP_ON'), $no = JText::_('COM_REDSHOP_OFF'));
     $lists['wanttoshowattributeimage'] = JHTML::_('select.booleanlist', 'wanttoshowattributeimage', 'class="inputbox" size="1"', WANT_TO_SHOW_ATTRIBUTE_IMAGE_INCART);
     $lists['show_quotation_price'] = JHTML::_('select.booleanlist', 'show_quotation_price', 'class="inputbox" size="1"', SHOW_QUOTATION_PRICE);
     $lists['display_out_of_stock_attribute_data'] = JHTML::_('select.booleanlist', 'display_out_of_stock_attribute_data', 'class="inputbox"', DISPLAY_OUT_OF_STOCK_ATTRIBUTE_DATA);
     $orderstatus = $model->getOrderstatus();
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $orderstatus = array_merge($tmp, $orderstatus);
     $lists['clickatell_order_status'] = JHTML::_('select.genericlist', $orderstatus, 'clickatell_order_status', 'class="inputbox" size="1" ', 'value', 'text', CLICKATELL_ORDER_STATUS);
     $menuitem = array();
     $menuitem[0] = new stdClass();
     $menuitem[0]->value = 0;
     $menuitem[0]->text = JText::_('COM_REDSHOP_SELECT');
     $q = "SELECT m.id,m.title AS name,mt.title FROM #__menu AS m " . "LEFT JOIN #__menu_types AS mt ON mt.menutype=m.menutype " . "WHERE m.published=1 " . "ORDER BY m.menutype,m.ordering";
     $db->setQuery($q);
     $menuitemlist = $db->loadObjectList();
     for ($i = 0; $i < count($menuitemlist); $i++) {
         $menuitem[$i + 1] = new stdClass();
         $menuitem[$i + 1]->value = $menuitemlist[$i]->id;
         $menuitem[$i + 1]->text = $menuitemlist[$i]->name;
     }
     $lists['url_after_portal_login'] = JHTML::_('select.genericlist', $menuitem, 'portal_login_itemid', 'class="inputbox" size="1" ', 'value', 'text', PORTAL_LOGIN_ITEMID);
     $lists['url_after_portal_logout'] = JHTML::_('select.genericlist', $menuitem, 'portal_logout_itemid', 'class="inputbox" size="1" ', 'value', 'text', PORTAL_LOGOUT_ITEMID);
     $default_vat_group = $model->getVatGroup();
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $default_vat_group = array_merge($tmp, $default_vat_group);
     $tmp = array();
     $tmp[] = JHTML::_('select.option', '', JText::_('COM_REDSHOP_SELECT'));
     $default_vat_country = array_merge($tmp, $countries);
     $default_customer_register_type = array();
     $default_customer_register_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
     $default_customer_register_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_PRIVATE'));
     $default_customer_register_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_COMPANY'));
     $lists['default_customer_register_type'] = JHTML::_('select.genericlist', $default_customer_register_type, 'default_customer_register_type', 'class="inputbox" ', 'value', 'text', DEFAULT_CUSTOMER_REGISTER_TYPE);
     $addtocart_behaviour = array();
     $addtocart_behaviour[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
     $addtocart_behaviour[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_DIRECT_TO_CART'));
     $addtocart_behaviour[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_STAY_ON_CURRENT_VIEW'));
     $lists['addtocart_behaviour'] = JHTML::_('select.genericlist', $addtocart_behaviour, 'addtocart_behaviour', 'class="inputbox" ', 'value', 'text', ADDTOCART_BEHAVIOUR);
     $allow_customer_register_type = array();
     $allow_customer_register_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_BOTH'));
     $allow_customer_register_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_PRIVATE'));
     $allow_customer_register_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_COMPANY'));
     $lists['allow_customer_register_type'] = JHTML::_('select.genericlist', $allow_customer_register_type, 'allow_customer_register_type', 'class="inputbox" ', 'value', 'text', ALLOW_CUSTOMER_REGISTER_TYPE);
     // Optional shipping address select box
     $lists['optional_shipping_address'] = JHTML::_('select.booleanlist', 'optional_shipping_address', 'class="inputbox" ', OPTIONAL_SHIPPING_ADDRESS);
     $lists['shipping_method_enable'] = JHTML::_('select.booleanlist', 'shipping_method_enable', 'class="inputbox" ', SHIPPING_METHOD_ENABLE);
     $lists['default_vat_group'] = JHTML::_('select.genericlist', $default_vat_group, 'default_vat_group', 'class="inputbox" ', 'value', 'text', DEFAULT_VAT_GROUP);
     $vat_based_on = array();
     $vat_based_on[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_WEBSHOP_MODE'));
     $vat_based_on[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_CUSTOMER_MODE'));
     $vat_based_on[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_EU_MODE'));
     $lists['vat_based_on'] = JHTML::_('select.genericlist', $vat_based_on, 'vat_based_on', 'class="inputbox" ', 'value', 'text', VAT_BASED_ON);
     $lists['default_vat_country'] = JHTML::_('select.genericlist', $default_vat_country, 'default_vat_country', 'class="inputbox" onchange="changeStateList();"', 'value', 'text', DEFAULT_VAT_COUNTRY);
     $country_list_name = 'default_vat_country';
     $state_list_name = 'default_vat_state';
     $selected_country_code = DEFAULT_VAT_COUNTRY;
     $selected_state_code = DEFAULT_VAT_STATE;
     if (empty($selected_state_code)) {
         $selected_state_code = "originalPos";
     } else {
         $selected_state_code = "'" . $selected_state_code . "'";
     }
     $db->setQuery("SELECT c.country_id, c.country_3_code, s.state_name, s.state_2_code\n\t\t\t\t\t\tFROM #__" . TABLE_PREFIX . "_country c\n\t\t\t\t\t\tLEFT JOIN #__" . TABLE_PREFIX . "_state s\n\t\t\t\t\t\tON c.country_id=s.country_id OR s.country_id IS NULL\n\t\t\t\t\t\tORDER BY c.country_id, s.state_name");
     $states = $db->loadObjectList();
     // Build the State lists for each Country
     $script = "<script language=\"javascript\" type=\"text/javascript\">//<![CDATA[\n";
     $script .= "<!--\n";
     $script .= "var originalOrder = '1';\n";
     $script .= "var originalPos = '{$selected_country_code}';\n";
     $script .= "var states = new Array();\t// array in the format [key,value,text]\n";
     $i = 0;
     $prev_country = '';
     for ($j = 0; $j < count($states); $j++) {
         $state = $states[$j];
         $country_3_code = $state->country_3_code;
         if ($state->state_name) {
             if ($prev_country != $country_3_code) {
                 $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','',' -= " . JText::_("COM_REDSHOP_SELECT") . " =-' );\n";
             }
             $prev_country = $country_3_code;
             // Array in the format [key,value,text]
             $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','" . $state->state_2_code . "','" . addslashes(JText::_($state->state_name)) . "' );\n";
         } else {
             $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','','" . JText::_("COM_REDSHOP_NONE") . "' );\n";
         }
     }
     $script .= "function changeStateList()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar selected_country = null;\n\t\t\t\t\t\tfor (var i=0; i<document.adminForm.default_vat_country.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (document.adminForm." . $country_list_name . "[i].selected)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tselected_country = document.adminForm." . $country_list_name . "[i].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchangeDynaList('" . $state_list_name . "',states,selected_country, originalPos, originalOrder);\n\t\t\t\t \t}\n\t\t\t\t \twriteDynaList( 'class=\"inputbox\" name=\"default_vat_state\" size=\"1\" id=\"default_vat_state\"',\n\t\t\t\t \tstates, originalPos, originalPos, {$selected_state_code} );\n\t\t\t\t\t//-->\n\t\t\t\t\t//]]></script>";
     $lists['default_vat_state'] = $script;
     $shopper_Group_private = $model->getShopperGroupPrivate();
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $tmp = array_merge($tmp, $shopper_Group_private);
     $lists['shopper_group_default_private'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_private', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_PRIVATE);
     $shopper_Group_company = $model->getShopperGroupCompany();
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT'));
     $tmp = array_merge($tmp, $shopper_Group_company);
     $lists['shopper_group_default_company'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_company', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_COMPANY);
     $tmp = array();
     $tmp[] = JHTML::_('select.option', 0, JText::_('SELECT'));
     $tmp = array_merge($tmp, $shopper_Group_private, $shopper_Group_company);
     defined('SHOPPER_GROUP_DEFAULT_UNREGISTERED') ? SHOPPER_GROUP_DEFAULT_UNREGISTERED : define('SHOPPER_GROUP_DEFAULT_UNREGISTERED', SHOPPER_GROUP_DEFAULT_PRIVATE);
     $lists['shopper_group_default_unregistered'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_unregistered', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_UNREGISTERED);
     $register_methods = array();
     $register_methods[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_REGISTER_WITH_ACCOUNT_CREATION'));
     $register_methods[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_REGISTER_WITHOUT_ACCOUNT_CREATION'));
     $register_methods[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_REGISTER_ACCOUNT_OPTIONAL'));
     $register_methods[] = JHTML::_('select.option', '3', JText::_('COM_REDSHOP_REGISTER_ACCOUNT_SILENT'));
     $lists['register_method'] = JHTML::_('select.genericlist', $register_methods, 'register_method', 'class="inputbox" id="register_method"', 'value', 'text', REGISTER_METHOD);
     $lists['product_template'] = JHTML::_('select.genericlist', $product_template, 'default_product_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', PRODUCT_TEMPLATE);
     $lists['ajax_detail_template'] = JHTML::_('select.genericlist', $ajax_detail_template, 'default_ajax_detailbox_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', DEFAULT_AJAX_DETAILBOX_TEMPLATE);
     $lists['category_template'] = JHTML::_('select.genericlist', $category_template, 'default_category_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', CATEGORY_TEMPLATE);
     $lists['default_categorylist_template'] = JHTML::_('select.genericlist', $categorylist_template, 'default_categorylist_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', DEFAULT_CATEGORYLIST_TEMPLATE);
     $lists['manufacturer_template'] = JHTML::_('select.genericlist', $manufacturer_template, 'default_manufacturer_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', MANUFACTURER_TEMPLATE);
     $lists['show_price'] = JHTML::_('select.booleanlist', 'show_price', 'class="inputbox" size="1"', SHOW_PRICE_PRE);
     $PRE_USE_AS_CATALOG = defined('PRE_USE_AS_CATALOG') ? PRE_USE_AS_CATALOG : 0;
     $lists['use_as_catalog'] = JHTML::_('select.booleanlist', 'use_as_catalog', 'class="inputbox" size="1"', $PRE_USE_AS_CATALOG);
     $lists['show_tax_exempt_infront'] = JHTML::_('select.booleanlist', 'show_tax_exempt_infront', 'class="inputbox" size="1"', SHOW_TAX_EXEMPT_INFRONT);
     $lists['individual_add_to_cart_enable'] = JHTML::_('select.booleanlist', 'individual_add_to_cart_enable', 'class="inputbox" size="1"', INDIVIDUAL_ADD_TO_CART_ENABLE, JText::_('COM_REDSHOP_INDIVIDUAL_ADD_TO_CART_PER_PROPERTY'), JText::_('COM_REDSHOP_ADD_TO_CART_PER_PRODUCT'));
     defined('ACCESSORY_AS_PRODUCT_IN_CART_ENABLE') ? ACCESSORY_AS_PRODUCT_IN_CART_ENABLE : define('ACCESSORY_AS_PRODUCT_IN_CART_ENABLE', '0');
     $lists['accessory_as_product_in_cart_enable'] = JHTML::_('select.booleanlist', 'accessory_as_product_in_cart_enable', 'class="inputbox" size="1"', ACCESSORY_AS_PRODUCT_IN_CART_ENABLE);
     $lists['use_product_outofstock_image'] = JHTML::_('select.booleanlist', 'use_product_outofstock_image', 'class="inputbox" size="1"', USE_PRODUCT_OUTOFSTOCK_IMAGE);
     defined('ENABLE_ADDRESS_DETAIL_IN_SHIPPING') ? ENABLE_ADDRESS_DETAIL_IN_SHIPPING : define('ENABLE_ADDRESS_DETAIL_IN_SHIPPING', '0');
     $lists['enable_address_detail_in_shipping'] = JHTML::_('select.booleanlist', 'enable_address_detail_in_shipping', 'class="inputbox" size="1"', ENABLE_ADDRESS_DETAIL_IN_SHIPPING);
     defined('SEND_MAIL_TO_CUSTOMER') ? SEND_MAIL_TO_CUSTOMER : define('SEND_MAIL_TO_CUSTOMER', '1');
     $lists['send_mail_to_customer'] = JHTML::_('select.booleanlist', 'send_mail_to_customer', 'class="inputbox" size="1"', SEND_MAIL_TO_CUSTOMER);
     $bookinvoice = array();
     $bookinvoice[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_DIRECTLY_BOOK'));
     $bookinvoice[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_MANUALLY_BOOK'));
     $bookinvoice[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_BOOK_ON_ORDER_STATUS'));
     $lists['economic_invoice_draft'] = JHTML::_('select.genericlist', $bookinvoice, 'economic_invoice_draft', 'class="inputbox" onchange="javascript:changeBookInvoice(this.value);" ', 'value', 'text', ECONOMIC_INVOICE_DRAFT);
     defined('ECONOMIC_BOOK_INVOICE_NUMBER') ? ECONOMIC_BOOK_INVOICE_NUMBER : define('ECONOMIC_BOOK_INVOICE_NUMBER', '0');
     $lists['economic_book_invoice_number'] = JHTML::_('select.booleanlist', 'economic_book_invoice_number', 'class="inputbox" size="1"', ECONOMIC_BOOK_INVOICE_NUMBER, JText::_('COM_REDSHOP_SEQUENTIALLY_IN_ECONOMIC_NO_MATCH_UP_WITH_ORDER_NUMBER'), JText::_('COM_REDSHOP_SAME_AS_ORDER_NUMBER'));
     // NEXT-PREVIOUS LINK
     $link_type = array();
     $link_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_DEFAULT_LINK'));
     $link_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_CUSTOM_LINK'));
     $link_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_IMAGE_LINK'));
     $lists['next_previous_link'] = JHTML::_('select.genericlist', $link_type, 'next_previous_link', 'class="inputbox" ', 'value', 'text', DEFAULT_LINK_FIND);
     $order_data = $redhelper->getOrderByList();
     $lists['default_product_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_product_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_PRODUCT_ORDERING_METHOD);
     $lists['default_manufacturer_product_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_manufacturer_product_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_MANUFACTURER_PRODUCT_ORDERING_METHOD);
     $order_data = $redhelper->getRelatedOrderByList();
     $lists['default_related_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_related_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_RELATED_ORDERING_METHOD);
     $order_data = $redhelper->getAccessoryOrderByList();
     $lists['default_accessory_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_accessory_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_ACCESSORY_ORDERING_METHOD);
     $shipping_after = defined('SHIPPING_AFTER') ? SHIPPING_AFTER : 'total';
     $lists['shipping_after'] = $extra_field->rs_booleanlist('shipping_after', 'class="inputbox"', $shipping_after, $yes = JText::_('COM_REDSHOP_TOTAL'), $no = JText::_('COM_REDSHOP_SUBTOTAL_LBL'), '', 'total', 'subtotal');
     $payment_calculation = defined('PAYMENT_CALCULATION_ON') ? PAYMENT_CALCULATION_ON : 'total';
     $lists['payment_calculation_on'] = $extra_field->rs_booleanlist('payment_calculation_on', 'class="inputbox"', $payment_calculation, $yes = JText::_('COM_REDSHOP_TOTAL'), $no = JText::_('COM_REDSHOP_SUBTOTAL_LBL'), '', 'total', 'subtotal');
     $calculate_vat_on = defined('CALCULATE_VAT_ON') ? CALCULATE_VAT_ON : 'BT';
     $lists['calculate_vat_on'] = $extra_field->rs_booleanlist('calculate_vat_on', 'class="inputbox"', $calculate_vat_on, $yes = JText::_('COM_REDSHOP_BILLING_ADDRESS_LBL'), $no = JText::_('COM_REDSHOP_SHIPPING_ADDRESS_LBL'), '', 'BT', 'ST');
     $order_data = array();
     $order_data[0] = new stdClass();
     $order_data[0]->value = "c.category_name ASC";
     $order_data[0]->text = JText::_('COM_REDSHOP_CATEGORY_NAME');
     $order_data[1] = new stdClass();
     $order_data[1]->value = "c.category_id DESC";
     $order_data[1]->text = JText::_('COM_REDSHOP_NEWEST');
     $order_data[2] = new stdClass();
     $order_data[2]->value = "c.ordering ASC";
     $order_data[2]->text = JText::_('COM_REDSHOP_ORDERING');
     $lists['default_category_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_category_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_CATEGORY_ORDERING_METHOD);
     $order_data = $redhelper->getManufacturerOrderByList();
     $lists['default_manufacturer_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_manufacturer_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_MANUFACTURER_ORDERING_METHOD);
     $symbol_position = array();
     $symbol_position[0] = new stdClass();
     $symbol_position[0]->value = " ";
     $symbol_position[0]->text = JText::_('COM_REDSHOP_SELECT');
     $symbol_position[1] = new stdClass();
     $symbol_position[1]->value = "front";
     $symbol_position[1]->text = JText::_('COM_REDSHOP_FRONT');
     $symbol_position[2] = new stdClass();
     $symbol_position[2]->value = "behind";
     $symbol_position[2]->text = JText::_('COM_REDSHOP_BEHIND');
     $symbol_position[3] = new stdClass();
     $symbol_position[3]->value = "none";
     $symbol_position[3]->text = JText::_('COM_REDSHOP_NONE');
     $lists['currency_symbol_position'] = JHTML::_('select.genericlist', $symbol_position, 'currency_symbol_position', 'class="inputbox" ', 'value', 'text', CURRENCY_SYMBOL_POSITION);
     $default_dateformat = $config->getDateFormat();
     $lists['default_dateformat'] = JHTML::_('select.genericlist', $default_dateformat, 'default_dateformat', 'class="inputbox" ', 'value', 'text', DEFAULT_DATEFORMAT);
     $lists['discount_enable'] = JHTML::_('select.booleanlist', 'discount_enable', 'class="inputbox" ', DISCOUNT_ENABLE);
     $lists['invoice_mail_enable'] = JHTML::_('select.booleanlist', 'invoice_mail_enable', 'class="inputbox"', INVOICE_MAIL_ENABLE);
     $lists['enable_backendaccess'] = JHTML::_('select.booleanlist', 'enable_backendaccess', 'class="inputbox"', ENABLE_BACKENDACCESS);
     $lists['wishlist_login_required'] = JHTML::_('select.booleanlist', 'wishlist_login_required', 'class="inputbox"', WISHLIST_LOGIN_REQUIRED);
     $invoice_mail_send_option = array();
     $invoice_mail_send_option[0] = new stdClass();
     $invoice_mail_send_option[0]->value = 0;
     $invoice_mail_send_option[0]->text = JText::_('COM_REDSHOP_SELECT');
     $invoice_mail_send_option[1] = new stdClass();
     $invoice_mail_send_option[1]->value = 1;
     $invoice_mail_send_option[1]->text = JText::_('COM_REDSHOP_ADMINISTRATOR');
     $invoice_mail_send_option[2] = new stdClass();
     $invoice_mail_send_option[2]->value = 2;
     $invoice_mail_send_option[2]->text = JText::_('COM_REDSHOP_CUSTOMER');
     $invoice_mail_send_option[3] = new stdClass();
     $invoice_mail_send_option[3]->value = 3;
     $invoice_mail_send_option[3]->text = JText::_('COM_REDSHOP_BOTH');
     $lists['invoice_mail_send_option'] = JHTML::_('select.genericlist', $invoice_mail_send_option, 'invoice_mail_send_option', 'class="inputbox" ', 'value', 'text', INVOICE_MAIL_SEND_OPTION);
     $order_mail_after = array();
     $order_mail_after[0] = new stdClass();
     $order_mail_after[0]->value = 0;
     $order_mail_after[0]->text = JText::_('COM_REDSHOP_ORDER_MAIL_BEFORE_PAYMENT');
     $order_mail_after[1] = new stdClass();
     $order_mail_after[1]->value = 1;
     $order_mail_after[1]->text = JText::_('COM_REDSHOP_ORDER_MAIL_AFTER_PAYMENT');
     $lists['order_mail_after'] = JHTML::_('select.genericlist', $order_mail_after, 'order_mail_after', 'class="inputbox" ', 'value', 'text', ORDER_MAIL_AFTER);
     $discount_type = array();
     $discount_type[0] = new stdClass();
     $discount_type[0]->value = 0;
     $discount_type[0]->text = JText::_('COM_REDSHOP_SELECT');
     $discount_type[1] = new stdClass();
     $discount_type[1]->value = 1;
     $discount_type[1]->text = JText::_('COM_REDSHOP_DISCOUNT_OR_VOUCHER_OR_COUPON');
     $discount_type[2] = new stdClass();
     $discount_type[2]->value = 2;
     $discount_type[2]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_OR_COUPON');
     $discount_type[3] = new stdClass();
     $discount_type[3]->value = 3;
     $discount_type[3]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_COUPON');
     $discount_type[4] = new stdClass();
     $discount_type[4]->value = 4;
     $discount_type[4]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_COUPON_MULTIPLE');
     $lists['discount_type'] = JHTML::_('select.genericlist', $discount_type, 'discount_type', 'class="inputbox" ', 'value', 'text', DISCOUNT_TYPE);
     /*
      * Measurement select boxes
      */
     $option = array();
     $option[0] = new stdClass();
     $option[0]->value = 0;
     $option[0]->text = JText::_('COM_REDSHOP_SELECT');
     $option[1] = new stdClass();
     $option[1]->value = 'mm';
     $option[1]->text = JText::_('COM_REDSHOP_MILLIMETER');
     $option[2] = new stdClass();
     $option[2]->value = 'cm';
     $option[2]->text = JText::_('COM_REDSHOP_CENTIMETERS');
     $option[3] = new stdClass();
     $option[3]->value = 'inch';
     $option[3]->text = JText::_('COM_REDSHOP_INCHES');
     $option[4] = new stdClass();
     $option[4]->value = 'feet';
     $option[4]->text = JText::_('COM_REDSHOP_FEET');
     $option[5] = new stdClass();
     $option[5]->value = 'm';
     $option[5]->text = JText::_('COM_REDSHOP_METER');
     $lists['default_volume_unit'] = JHTML::_('select.genericlist', $option, 'default_volume_unit', 'class="inputbox" ', 'value', 'text', DEFAULT_VOLUME_UNIT);
     unset($option);
     $option = array();
     $option[0] = new stdClass();
     $option[0]->value = 0;
     $option[0]->text = JText::_('COM_REDSHOP_SELECT');
     $option[1] = new stdClass();
     $option[1]->value = 'gram';
     $option[1]->text = JText::_('COM_REDSHOP_GRAM');
     $option[2] = new stdClass();
     $option[2]->value = 'pounds';
     $option[2]->text = JText::_('COM_REDSHOP_POUNDS');
     $option[3] = new stdClass();
     $option[3]->value = 'kg';
     $option[3]->text = JText::_('COM_REDSHOP_KG');
     $lists['default_weight_unit'] = JHTML::_('select.genericlist', $option, 'default_weight_unit', 'class="inputbox" ', 'value', 'text', DEFAULT_WEIGHT_UNIT);
     unset($option);
     $lists['postdk_integration'] = JHTML::_('select.booleanlist', 'postdk_integration', 'class="inputbox" size="1"', POSTDK_INTEGRATION);
     $lists['display_new_orders'] = JHTML::_('select.booleanlist', 'display_new_orders', 'class="inputbox" size="1"', DISPLAY_NEW_ORDERS);
     $lists['display_new_customers'] = JHTML::_('select.booleanlist', 'display_new_customers', 'class="inputbox" size="1"', DISPLAY_NEW_CUSTOMERS);
     $lists['display_statistic'] = JHTML::_('select.booleanlist', 'display_statistic', 'class="inputbox" size="1"', DISPLAY_STATISTIC);
     $lists['expand_all'] = JHTML::_('select.booleanlist', 'expand_all', 'class="inputbox" size="1"', EXPAND_ALL);
     $lists['send_catalog_reminder_mail'] = JHTML::_('select.booleanlist', 'send_catalog_reminder_mail', 'class="inputbox" size="1"', SEND_CATALOG_REMINDER_MAIL);
     $current_version = $model->getcurrentversion();
     $getinstalledmodule = $model->getinstalledmodule();
     $getinstalledplugins = $model->getinstalledplugins();
     $getinstalledshipping = $model->getinstalledplugins('redshop_shipping');
     $db_version = $db->getVersion();
     $php_version = phpversion();
     $server = $this->get_server_software();
     $gd_check = extension_loaded('gd');
     $mb_check = extension_loaded('mbstring');
     $this->server = $server;
     $this->php_version = $php_version;
     $this->db_version = $db_version;
     $this->gd_check = $gd_check;
     $this->mb_check = $mb_check;
     $this->getinstalledmodule = $getinstalledmodule;
     $this->getinstalledplugins = $getinstalledplugins;
     $this->getinstalledshipping = $getinstalledshipping;
     $this->current_version = $current_version;
     $this->lists = $lists;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }