Example #1
0
 function step2()
 {
     $checkout = JSFactory::getModel('checkout', 'jshop');
     $checkout->checkStep(2);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onLoadCheckoutStep2', array());
     $jshopConfig = JSFactory::getConfig();
     $checkLogin = JRequest::getInt('check_login');
     if ($checkLogin) {
         JSFactory::getModel('userlogin', 'jshop')->setPayWithoutReg();
         checkUserLogin();
     }
     JshopHelpersMetadata::checkoutAddress();
     $adv_user = JSFactory::getUser()->loadDataFromEdit();
     $config_fields = $jshopConfig->getListFieldsRegisterType('address');
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
     $checkout_navigator = $checkout->showCheckoutNavigation(2);
     $small_cart = $checkout->loadSmallCart(2);
     $select_countries = JshopHelpersSelects::getCountry($adv_user->country);
     $select_d_countries = JshopHelpersSelects::getCountry($adv_user->d_country, null, 'd_country');
     $select_titles = JshopHelpersSelects::getTitle($adv_user->title);
     $select_d_titles = JshopHelpersSelects::getTitle($adv_user->d_title, null, 'd_title');
     $select_client_types = JshopHelpersSelects::getClientType($adv_user->client_type);
     filterHTMLSafe($adv_user, ENT_QUOTES);
     if ($config_fields['birthday']['display'] || $config_fields['d_birthday']['display']) {
         JHTML::_('behavior.calendar');
     }
     $view = $this->getView("checkout");
     $view->setLayout("adress");
     $view->assign('select', $jshopConfig->user_field_title);
     $view->assign('config', $jshopConfig);
     $view->assign('select_countries', $select_countries);
     $view->assign('select_d_countries', $select_d_countries);
     $view->assign('select_titles', $select_titles);
     $view->assign('select_d_titles', $select_d_titles);
     $view->assign('select_client_types', $select_client_types);
     $view->assign('live_path', JURI::base());
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $view->assign('user', $adv_user);
     $view->assign('delivery_adress', $adv_user->delivery_adress);
     $view->assign('checkout_navigator', $checkout_navigator);
     $view->assign('small_cart', $small_cart);
     $view->assign('action', JSFactory::getModel('checkoutStep', 'jshop')->getCheckoutUrl('step2save', 0, 0));
     $dispatcher->trigger('onBeforeDisplayCheckoutStep2View', array(&$view));
     $view->display();
 }
Example #2
0
 function display($cachable = false, $urlparams = false)
 {
     $jshopConfig = JSFactory::getConfig();
     $Itemid = JRequest::getInt('Itemid');
     $category_id = JRequest::getInt('category_id');
     JHTML::_('behavior.calendar');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeLoadSearchForm', array());
     JshopHelpersMetadata::search();
     $list_categories = JshopHelpersSelects::getSearchCategory();
     $list_manufacturers = JshopHelpersSelects::getManufacturer();
     $characteristics = $this->load_tmpl_characteristics($category_id);
     $view = $this->getView("search");
     $view->setLayout("form");
     $view->assign('list_categories', $list_categories);
     $view->assign('list_manufacturers', $list_manufacturers);
     $view->assign('characteristics', $characteristics);
     $view->assign('config', $jshopConfig);
     $view->assign('Itemid', $Itemid);
     $view->assign('action', SEFLink("index.php?option=com_jshopping&controller=search&task=result"));
     $dispatcher->trigger('onBeforeDisplaySearchFormView', array(&$view));
     $view->display();
 }
Example #3
0
 function edit()
 {
     $mainframe = JFactory::getApplication();
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $me = JFactory::getUser();
     $user_id = JRequest::getInt("user_id");
     $user = JSFactory::getTable('userShop', 'jshop');
     $user->load($user_id);
     $user->loadDataFromEdit();
     $user_site = new JUser($user_id);
     $lists['country'] = JshopHelpersSelects::getCountry($user->country);
     $lists['d_country'] = JshopHelpersSelects::getCountry($user->d_country, 'class = "inputbox endes"', 'd_country');
     $lists['select_titles'] = JshopHelpersSelects::getTitle($user->title);
     $lists['select_d_titles'] = JshopHelpersSelects::getTitle($user->d_title, 'class = "inputbox endes"', 'd_title');
     $lists['select_client_types'] = JshopHelpersSelects::getClientType($user->client_type);
     $usergroups = JSFactory::getModel("userGroups")->getAllUsergroups();
     $lists['usergroups'] = JHTML::_('select.genericlist', $usergroups, 'usergroup_id', 'class = "inputbox" size = "1"', 'usergroup_id', 'usergroup_name', $user->usergroup_id);
     $lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox" size="1"', $user_site->get('block'));
     filterHTMLSafe($user, ENT_QUOTES);
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields['editaccount'];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('editaccount');
     JHTML::_('behavior.calendar');
     $view = $this->getView("users", 'html');
     $view->setLayout("edit");
     $view->assign('config', $jshopConfig);
     $view->assign('user', $user);
     $view->assign('me', $me);
     $view->assign('user_site', $user_site);
     $view->assign('lists', $lists);
     $view->assign('etemplatevar', '');
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     JDispatcher::getInstance()->trigger('onBeforeEditUsers', array(&$view));
     $view->displayEdit();
 }
Example #4
0
 function edit()
 {
     $mainframe = JFactory::getApplication();
     $order_id = JRequest::getVar("order_id");
     $client_id = JRequest::getInt('client_id', 0);
     $lang = JSFactory::getLang();
     $db = JFactory::getDBO();
     $jshopConfig = JSFactory::getConfig();
     $orders = JSFactory::getModel("orders");
     $order = JSFactory::getTable('order', 'jshop');
     $order->load($order_id);
     $id_vendor_cuser = getIdVendorForCUser();
     if ($jshopConfig->admin_show_vendors && $id_vendor_cuser) {
         if ($order->vendor_id != $id_vendor_cuser) {
             $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
             return 0;
         }
     }
     $order_items = $order->getAllItems();
     $_languages = JSFactory::getModel("languages");
     $languages = $_languages->getAllLanguages(1);
     $select_language = JHTML::_('select.genericlist', $languages, 'lang', 'class = "inputbox" style="float:none"', 'language', 'name', $order->lang);
     $select_countries = JshopHelpersSelects::getCountry($order->country);
     $select_d_countries = JshopHelpersSelects::getCountry($order->d_country, 'class = "inputbox endes"', 'd_country');
     $select_titles = JshopHelpersSelects::getTitle($order->title);
     $select_d_titles = JshopHelpersSelects::getTitle($order->d_title, 'class = "inputbox endes"', 'd_title');
     $select_client_types = JshopHelpersSelects::getClientType($order->client_type);
     $order->prepareBirthdayFormat();
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields["address"];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
     $order->client_type_name = $order->getClientTypeName();
     $order->payment_name = $order->getPaymentName();
     $order->order_tax_list = $order->getTaxExt();
     $_currency = JSFactory::getModel("currencies");
     $currency_list = $_currency->getAllCurrencies();
     $order_currency = 0;
     foreach ($currency_list as $k => $v) {
         if ($v->currency_code_iso == $order->currency_code_iso) {
             $order_currency = $v->currency_id;
         }
     }
     $select_currency = JHTML::_('select.genericlist', $currency_list, 'currency_id', 'class = "inputbox"', 'currency_id', 'currency_code', $order_currency);
     $display_price_list = array();
     $display_price_list[] = JHTML::_('select.option', 0, _JSHOP_PRODUCT_BRUTTO_PRICE, 'id', 'name');
     $display_price_list[] = JHTML::_('select.option', 1, _JSHOP_PRODUCT_NETTO_PRICE, 'id', 'name');
     $display_price_select = JHTML::_('select.genericlist', $display_price_list, 'display_price', 'onchange="updateOrderTotalValue();"', 'id', 'name', $order->display_price);
     $shippings = JSFactory::getModel("shippings");
     $shippings_list = $shippings->getAllShippings(0);
     $first = array();
     $first[] = JHTML::_('select.option', 0, "- - -", 'shipping_id', 'name');
     $shippings_select = JHTML::_('select.genericlist', array_merge($first, $shippings_list), 'shipping_method_id', 'onchange="order_shipping_calculate()"', 'shipping_id', 'name', $order->shipping_method_id);
     $payments = JSFactory::getModel("payments");
     $payments_list = $payments->getAllPaymentMethods(0);
     $first = array();
     $first[] = JHTML::_('select.option', 0, "- - -", 'payment_id', 'name');
     $payments_select = JHTML::_('select.genericlist', array_merge($first, $payments_list), 'payment_method_id', 'onchange="order_payment_calculate()"', 'payment_id', 'name', $order->payment_method_id);
     $deliverytimes = JSFactory::getAllDeliveryTime();
     $first = array(0 => "- - -");
     $delivery_time_select = JHTML::_('select.genericlist', array_merge($first, $deliverytimes), 'order_delivery_times_id', '', 'id', 'name', $order->delivery_times_id);
     $users = JSFactory::getModel('users');
     $users_list = $users->getUsers();
     $first = array();
     $first[] = JHTML::_('select.option', -1, "- - -", 'user_id', 'name');
     $users_list_select = JHTML::_('select.genericlist', array_merge($first, $users_list), 'user_id', 'onchange="updateBillingShippingForUser(this.value);"', 'user_id', 'name', $order->user_id);
     filterHTMLSafe($order);
     foreach ($order_items as $k => $v) {
         JFilterOutput::objectHTMLSafe($order_items[$k]);
     }
     JHTML::_('behavior.calendar');
     $view = $this->getView("orders", 'html');
     $view->setLayout("edit");
     $view->assign('config', $jshopConfig);
     $view->assign('order', $order);
     $view->assign('order_items', $order_items);
     $view->assign('config_fields', $config_fields);
     $view->assign('etemplatevar', '');
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $view->assign('order_id', $order_id);
     $view->assign('select_countries', $select_countries);
     $view->assign('select_d_countries', $select_d_countries);
     $view->assign('select_titles', $select_titles);
     $view->assign('select_d_titles', $select_d_titles);
     $view->assign('select_client_types', $select_client_types);
     $view->assign('select_currency', $select_currency);
     $view->assign('display_price_select', $display_price_select);
     $view->assign('shippings_select', $shippings_select);
     $view->assign('payments_select', $payments_select);
     $view->assign('select_language', $select_language);
     $view->assign('delivery_time_select', $delivery_time_select);
     $view->assign('users_list_select', $users_list_select);
     $view->assign('client_id', $client_id);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditOrders', array(&$view));
     $view->displayEdit();
 }
Example #5
0
 function editaccount()
 {
     checkUserLogin();
     $adv_user = JSFactory::getUserShop()->loadDataFromEdit();
     $jshopConfig = JSFactory::getConfig();
     JshopHelpersMetadata::userEditaccount();
     $select_countries = JshopHelpersSelects::getCountry($adv_user->country);
     $select_d_countries = JshopHelpersSelects::getCountry($adv_user->d_country, null, 'd_country');
     $select_titles = JshopHelpersSelects::getTitle($adv_user->title);
     $select_d_titles = JshopHelpersSelects::getTitle($adv_user->d_title, null, 'd_title');
     $select_client_types = JshopHelpersSelects::getClientType($adv_user->client_type);
     $config_fields = $jshopConfig->getListFieldsRegisterType('editaccount');
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('editaccount');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayEditUser', array(&$adv_user));
     filterHTMLSafe($adv_user, ENT_QUOTES);
     if ($config_fields['birthday']['display'] || $config_fields['d_birthday']['display']) {
         JHTML::_('behavior.calendar');
     }
     $view = $this->getView('user');
     $view->setLayout("editaccount");
     $view->assign('config', $jshopConfig);
     $view->assign('select_countries', $select_countries);
     $view->assign('select_d_countries', $select_d_countries);
     $view->assign('select_titles', $select_titles);
     $view->assign('select_d_titles', $select_d_titles);
     $view->assign('select_client_types', $select_client_types);
     $view->assign('live_path', JURI::base());
     $view->assign('user', $adv_user);
     $view->assign('delivery_adress', $adv_user->delivery_adress);
     $view->assign('action', SEFLink('index.php?option=com_jshopping&controller=user&task=accountsave', 0, 0, $jshopConfig->use_ssl));
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $dispatcher->trigger('onBeforeDisplayEditAccountView', array(&$view));
     $view->display();
 }
Example #6
0
 public function getHtmlSelectFilterCategory($fulllist = 0)
 {
     if (JSFactory::getConfig()->show_product_list_filters) {
         $filters = $this->getFilters();
         if (!$fulllist) {
             $filter_categorys = $this->getModel()->getCategorys();
         } else {
             $filter_categorys = buildTreeCategory(1);
         }
         if (isset($filters['categorys'][0])) {
             $active_category = $filters['categorys'][0];
         } else {
             $active_category = 0;
         }
         $categorys_sel = JshopHelpersSelects::getFilterCategory($filter_categorys, $active_category);
     } else {
         $categorys_sel = '';
     }
     return $categorys_sel;
 }