public function display($tpl = null) { $app = JFactory::getApplication(); $jinput = $app->input; $this->value = $jinput->get('value', null, 'string'); if (!empty($this->value)) { $doc = JFactory::getDocument(); $params = JComponentHelper::getParams('com_ksenmart'); $path = $app->getPathway(); $this->state = $this->get('State'); $this->params = $params; $this->ajax_search = $jinput->get('ajax_search', 0, 'int'); $path->addItem(JText::_('KSM_SEARCH_PATHWAY_ITEM'), ''); $doc->setTitle(JText::_('KSM_SEARCH_PATHWAY_ITEM') . ' - "' . $this->value . '"'); $doc->addScript(JURI::base() . 'components/com_ksenmart/js/catalog.js', 'text/javascript', true); $this->getResult($this->value); if ($this->ajax_search) { $this->setLayout('module'); } else { $this->setLayout('dafault'); $pagination = $this->get('Pagination'); $this->assign('pagination', $pagination); } $session = JFactory::getSession(); $layout_view = $session->get('layout', 'list_ext'); $this->assignRef('layout_view', $layout_view); parent::display($tpl); } }
function display($tpl = null) { $document = JFactory::getDocument(); $app = JFactory::getApplication(); $path = $app->getPathway(); $this->params = JComponentHelper::getParams('com_ksenmart'); $session = JFactory::getSession(); $user = KSUsers::getUser(); $this->state = $this->get('State'); $layout_view = $session->get('layout', $user->settings->catalog_layout); $layout = $this->getLayout(); switch ($layout) { case 'items': $rows = $this->get('Items'); $this->assignRef('rows', $rows); $this->setLayout('catalog_ajax_items'); break; case 'manufacturers': $model = $this->getModel(); $brands = $this->get('Manufacturers'); $brands = $model->groupBrandsByLet($brands); $letters = $model->getLetters($brands); $document->setTitle(JText::_('KSM_MANUFACTURERS_PATHWAY_ITEM')); $path->addItem(JText::_('KSM_MANUFACTURERS_PATHWAY_ITEM'), JRoute::_('index.php?option=com_ksenmart&view=catalog&layout=manufacturers')); $document->addScript(JURI::base() . 'components/com_ksenmart/js/manufactures.js', 'text/javascript', true); $this->assignRef('brands', $brands); $this->assignRef('letters', $letters); break; case 'countries': $model = $this->getModel(); $brands = $this->get('ManufacturersListGroupByCountry'); $document->setTitle(JText::_('KSM_MANUFACTURERS_PATHWAY_ITEM')); $path->addItem(JText::_('KSM_MANUFACTURERS_PATHWAY_ITEM'), JRoute::_('index.php?option=com_ksenmart&view=catalog&layout=manufacturers')); $this->assignRef('brands', $brands); break; default: $model = $this->getModel(); $document->addScript(JURI::base() . 'components/com_ksenmart/js/catalog.js', 'text/javascript', true); $document->addScript(JURI::base() . 'components/com_ksenmart/js/highslide/highslide-with-gallery.js', 'text/javascript', true); $document->addScript(JURI::base() . 'components/com_ksenmart/js/highslide.js', 'text/javascript', true); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/js/highslide/highslide.css'); if (count($this->state->get('com_ksenmart.categories', array())) == 1) { $category = $this->get('Category'); $title = $this->get('CategoryTitle'); if (!$category) { JError::raiseError(404, 'Категории не существует'); } $document->setTitle($title); $model->setCategoryMetaData(); $this->assignRef('category', $category); $this->setLayout('category'); } elseif (count($this->state->get('com_ksenmart.manufacturers', array())) == 1) { $manufacturer = $this->get('Manufacturer'); $title = $this->get('ManufacturerTitle'); if (!$manufacturer) { JError::raiseError(404, 'Производитель не существует'); } $document->setTitle($title); $path->addItem(JText::_('KSM_MANUFACTURERS_PATHWAY_ITEM'), JRoute::_('index.php?option=com_ksenmart&view=catalog&layout=manufacturers')); $model->setManufacturerMetaData(); $this->assignRef('manufacturer', $manufacturer); $this->setLayout('manufacturer'); } elseif (count($this->state->get('com_ksenmart.countries', array())) == 1) { $country = $this->get('Country'); $title = $this->get('CountryTitle'); if (!$country) { JError::raiseError(404, 'Страна не существует'); } $document->setTitle($title); $model->setCountryMetaData(); $this->assignRef('country', $country); $this->setLayout('country'); } elseif (count($this->state->get('com_ksenmart.users', array())) == 1) { $manufacturer = $this->get('Manufacturer'); $title = $this->get('ManufacturerTitle'); $document->setTitle($title); $model->setManufacturerMetaData(); $this->assignRef('manufacturer', $manufacturer); $this->setLayout('manufacturer'); } else { $title = $this->get('CatalogTitle'); $document->setTitle($title); if ($layout == 'default') { $this->setLayout('catalog'); } } if (!JFactory::getConfig()->get('config.caching', 0)) { $catalog_path = $this->get('CatalogPath'); $k = 0; foreach ($catalog_path as $c_path) { $k++; if ($k == count($catalog_path)) { $path->addItem($c_path['title']); } else { $path->addItem($c_path['title'], $c_path['link']); } } } $pagination = $this->get('Pagination'); $rows = $this->get('Items'); $sort_links = $this->get('SortLinks'); $this->assignRef('sort_links', $sort_links); $this->assignRef('rows', $rows); $this->assignRef('pagination', $pagination); $this->assignRef('sort_links', $sort_links); break; } $this->assignRef('layout_view', $layout_view); parent::display($tpl); }
function display($tpl = null) { $app = JFactory::getApplication(); $path = $app->getPathway(); $document = JFactory::getDocument(); $this->params = JComponentHelper::getParams('com_ksenmart'); $shop_name = $this->params->get('shop_name', 'магазине'); $pref = $this->params->get('path_separator', '-'); $doc_title = $shop_name . $pref . 'Отзывы'; $id = $app->input->get('id', 0, 'int'); $layout = $this->getLayout(); $document->setTitle($doc_title); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/shop_reviews.css'); switch ($layout) { case 'comments': if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_REVIEWS_LIST_PATH_TITLE')); } $comments = $this->get('comments'); $pagination = $this->get('Pagination'); $this->assignRef('pagination', $pagination); $this->assignRef('rows', $comments); break; case 'comment': if ($id > 0) { if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_REVIEWS_LIST_PATH_TITLE'), 'index.php?option=com_ksenmart&view=comments&layout=comments&Itemid=' . KSSystem::getShopItemid()); $path->addItem(JText::_('KSM_REVIEW_ITEM_PATH_TITLE')); } $comment = $this->get('Comment'); if (!$comment) { JError::raiseError(404, 'Page not found'); return false; } $this->assignRef('comment', $comment); } else { JError::raiseError(404, 'Page not found'); return false; } break; case 'reviews': if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_SHOP_REVIEWS_PATH_TITLE')); } $reviews = $this->get('ShopReviewsList'); $user = KSUsers::getUser(); $isset_review = KSSystem::issetReview($user->id); $this->assignRef('reviews', $reviews); $this->assignRef('user', $user); $this->assignref('show_shop_review', $isset_review); break; case 'review': if ($id > 0) { $user = KSUsers::getUser(); $this->params = JComponentHelper::getParams('com_ksenmart'); $model = $this->getModel(); $review = $model->getShopReviewById($id); if (!$review) { JError::raiseError(404, 'Page not found'); return false; } $isset_review = KSSystem::issetReview($user->id); $this->assignRef('review', $review); $this->assignRef('user', $user); $this->assignref('show_shop_review', $isset_review); $document->setTitle(JText::sprintf('KSM_SHOP_REVIEW_PATH_TITLE_TEXT', $review->user->name, $shop_name)); if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_SHOP_REVIEWS_PATH_TITLE'), 'index.php?option=com_ksenmart&view=comments&layout=reviews&Itemid=' . KSSystem::getShopItemid()); $path->addItem(JText::sprintf('KSM_SHOP_REVIEW_PATH_TITLE_TEXT', $review->user->name, $shop_name)); } } else { JError::raiseError(404, 'Page not found'); return false; } break; } parent::display($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $this->params = JComponentHelper::getParams('com_ksenmart'); $pref = $this->params->get('path_separator'); $id = JRequest::getVar('id', 0); $names_komponent = $this->params->get('shop_name'); $path = $app->getPathway(); $doc_title = $names_komponent . $pref . 'Оформление заказа'; if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem('Оформление заказа'); } $document->setTitle($doc_title); if ($id == 0) { $this->setLayout('choose_product'); } switch ($this->getLayout()) { case 'congratulation': $order_id = JRequest::getVar('order_id', 0); $this->assignRef('order_id', $order_id); $this->setLayout('order_congratulation'); $document->addScript(JURI::base() . 'components/com_ksenmart/js/openorder_close.js', 'text/javascript', false); break; case 'close_congratulation': $order_id = JRequest::getVar('order_id', 0); $this->assignRef('order_id', $order_id); $this->setLayout('order_close_congratulation'); break; case 'choose_product': $this->setLayout('choose_product'); break; default: $close_order = JRequest::getVar('close_order', 0); if ($close_order == 1) { $document->addScript(JURI::base() . 'components/com_ksenmart/js/openorder_close.js', 'text/javascript', false); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/map.css'); $document->addScript('http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU', 'text/javascript', false); $document->addScript(JURI::base() . 'administrator/components/com_ksenmart/js/map.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/map_config.js', 'text/javascript', false); $product = $this->get('Product'); $user = $this->get('User'); $fields = $this->get('Fields'); $regions = $this->get('Regions'); $shippings = $this->get('Shippings'); $payments = $this->get('Payments'); $this->assignRef('product', $product); $this->assignRef('user', $user); $this->assignRef('fields', $fields); $this->assignRef('regions', $regions); $this->assignRef('shippings', $shippings); $this->assignRef('payments', $payments); $this->setLayout('openorder_close'); } else { $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.bind-first-0.1.min.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask-multi.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/openorder.js', 'text/javascript', false); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/openorder.css'); $product = $this->get('Product'); $user = KSUsers::getUser(); $customer_fields = $this->get('CustomerFields'); $this->assignRef('product', $product); $this->assignRef('customer_fields', $customer_fields); $this->assignRef('user', $user); $this->setLayout('openorder'); } break; } parent::display($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $this->params = JComponentHelper::getParams('com_ksenmart'); $path = $app->getPathway(); $model = $this->getModel(); $this->state = $this->get('State'); $document->addScript(JURI::base() . 'components/com_ksenmart/js/highslide/highslide-with-gallery.js', 'text/javascript', true); $document->addScript(JURI::base() . 'components/com_ksenmart/js/highslide.js', 'text/javascript', true); $document->addScript(JURI::base() . 'components/com_ksenmart/js/slides.min.jquery.js', 'text/javascript', true); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/js/highslide/highslide.css'); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/slides.css'); if ($model->_id && $this->getLayout() != 'comment_congratulation') { $this->product = $model->getProduct(); if ($this->product) { if (!JFactory::getConfig()->get('config.caching', 0)) { $cat_path = $this->get('CategoriesPath'); foreach ($cat_path as $cat) { $path->addItem($cat->title, $cat->link); } } $title = $model->getProductTitle(); $this->images = $model->getImages(); $this->related = KSMProducts::getRelated($this->product->id); $this->links = KSMProducts::getLinks($this->product->id); $document->setTitle($title); $model->setProductMetaData(); if ($this->product->type == 'set') { $document->addScript(JURI::base() . 'components/com_ksenmart/js/set.js', 'text/javascript', true); $this->set_related = KSMProducts::getSetRelated($this->product->id, true); } else { $document->addScript(JURI::base() . 'components/com_ksenmart/js/product.js', 'text/javascript', true); } if ($this->product->is_parent) { $template = $this->params->get('parent_products_template', 'list'); if ($template == 'list') { $this->childs_groups = $model->getChildsGroups(); } elseif ($template == 'select') { $this->childs_titles = $model->getChildsTitles(); $this->childs_title = $model->getChildsTitle(); if (!count($this->images)) { $model->_id = $this->product->parent_id; $this->images = $model->getImages(); $model->_id = $this->product->id; } } $this->setLayout('parent_product_' . $template); } elseif ($this->product->parent_id != 0) { $this->product->parent = KSMProducts::getProduct($this->product->parent_id); if ($this->params->get('parent_products_template', 'list') != 'list') { $template = $this->params->get('parent_products_template', 'list'); $this->product->title = $this->product->parent->title; $this->assign('childs_titles', $model->getChildsTitles($this->product->parent_id)); $this->assign('childs_title', $model->getChildsTitle($this->product->parent_id)); $this->setLayout('parent_product_' . $template); } else { $this->setLayout($this->product->type); } if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem($this->product->parent->title, $this->product->parent->link); } } else { $this->setLayout($this->product->type); } if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem($this->product->title); } $model->form = 'review'; $this->reviewform = $model->getForm(); } else { $this->setLayout('no_product'); } } else { if ($this->getLayout() == 'product_comment_form') { $document->addScript(JURI::base() . 'components/com_ksenmart/js/product.js', 'text/javascript', true); $this->product->id = JRequest::getVar('id', 0); $this->setLayout('product_comment_form'); } elseif ($this->getLayout() == 'comment_congratulation') { echo '<script> window.parent.location.reload();</script>'; $this->setLayout('product_comment_form'); } else { $this->setLayout('no_product'); } } parent::display($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $this->params = JComponentHelper::getParams('com_ksenmart'); $session = JFactory::getSession(); $path = $app->getPathway(); $names_komponent = $this->params->get('shop_name'); $pref = $this->params->get('path_separator', '-'); $doc_title = $names_komponent . $pref . JText::_('KSM_CART_YOUR_ORDER_DOC_TITLE'); $this->state = $this->get('State'); $order_id = $session->get('shop_order_id', 0); $layout = $this->getLayout(); if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_CART_YOUR_ORDER_PATHWAY_ITEM')); } $document->setTitle($doc_title); switch ($layout) { case 'receipt': $document = JFactory::getDocument(); $model = $this->getModel(); $model->order_id = JRequest::getVar('id', 0); $order = $model->getOrderInfo(); $document->setTitle(JText::_('KSM_CART_ORDER_INVOICE_DOC_TITLE')); $document->addStyleSheet(JURI::base() . 'administrator/components/com_ksenmart/css/printforms.css'); $this->assignRef('order', $order); $this->setLayout('default_receipt'); break; case 'pay_success': $this->setLayout('default_pay_success'); break; case 'pay_error': $this->setLayout('default_pay_error'); break; case 'congratulation': if ($order_id) { $model = $this->getModel(); $model->_order_id = $order_id; $order = $model->getOrderInfo(); $this->assignRef('order', $order); $this->setLayout('default_congratulation'); $session->set('shop_order_id', null); } else { $this->setLayout('default_empty'); } break; case 'minicart': $cart = $this->get('Cart'); $this->assignRef('cart', $cart); if (empty($cart->items)) { $this->setLayout('minicart_empty'); } else { $this->setLayout('minicart'); } break; case 'content': $cart = $this->get('Cart'); $this->assignRef('cart', $cart); if (!empty($cart->items)) { $this->setLayout('default_content'); } break; case 'cart_shipping': $session = JFactory::getSession(); $this->regions = $this->get('Regions'); $this->shippings = $this->get('Shippings'); $this->customer_fields = $this->get('CustomerFields'); $this->address_fields = $this->get('AddressFields'); $this->cart = $this->get('Cart'); $this->addresses = $this->get('Addresses'); $this->selected_address = $session->get('selected_address', 0); break; case 'cart_payments': $this->payments = $this->get('Payments'); break; case 'cart_total': $this->cart = $this->get('Cart'); break; default: $cart = $this->get('Cart'); if (!$cart->total_prds) { $this->setLayout('default_empty'); break; } $session = JFactory::getSession(); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.bind-first-0.1.min.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask-multi.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/opencart.js', 'text/javascript', false); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/map.css'); $document->addScript('//api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU', 'text/javascript', false); $document->addScript(JURI::base() . 'administrator/components/com_ksenmart/js/map.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/map_config.js', 'text/javascript', false); $fields = $this->get('Fields'); $regions = $this->get('Regions'); $shippings = $this->get('Shippings'); $payments = $this->get('Payments'); $addresses = $this->get('Addresses'); $selected_address = $session->get('selected_address', 0); $this->customer_fields = $this->get('CustomerFields'); $this->address_fields = $this->get('AddressFields'); $this->assignRef('cart', $cart); $this->assignRef('fields', $fields); $this->assignRef('shippings', $shippings); $this->assignRef('payments', $payments); $this->assignRef('regions', $regions); $this->assignRef('addresses', $addresses); $this->assignRef('selected_address', $selected_address); $this->setLayout($layout); break; } $this->system_customer_fields = $this->get('SystemCustomerFields'); parent::display($tpl); }
public function display($tpl = null) { $user = JFactory::getUser(); $layout = $this->getLayout(); if ($user->id == 0 && $layout != 'registration' && $layout != 'module_shipping') { header('Location:/'); } $app = JFactory::getApplication(); $document = JFactory::getDocument(); $this->params = JComponentHelper::getParams('com_ksenmart'); $path = $app->getPathway(); $names_komponent = $this->params->get('shop_name', ''); $pref = $this->params->get('path_separator', ''); $doc_title = $names_komponent . $pref . JText::_('KSM_PROFILE_PATHWAY_ITEM'); if (!JFactory::getConfig()->get('config.caching', 0) && $layout != 'registration') { $path->addItem(JText::_('KSM_PROFILE_PATHWAY_ITEM'), ''); } $document->setTitle($doc_title); $this->assign('params', $this->params); switch ($layout) { case 'registration': $doc_title = $names_komponent . $pref . JText::_('KSM_PROFILE__REGISTRATION_PATHWAY_ITEM'); $document->setTitle($doc_title); if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('KSM_PROFILE__REGISTRATION_PATHWAY_ITEM'), ''); } $this->fields = KSUsers::getFields(); $this->setLayout('profile_registration'); break; case 'profile_order': $id = JRequest::getVar('id', 0); if (!JFactory::getConfig()->get('config.caching', 0)) { $path->addItem(JText::_('profile_orders'), 'index.php?option=com_ksenmart&view=profile&layout=profile_orders'); $path->addItem('Заказ №' . $id); } $document->addScript(JURI::base() . 'components/com_ksenmart/js/profile_order.js', 'text/javascript', false); $order = $this->get('Order'); $fields = KSUsers::getFields(); $regions = $this->get('Regions'); $this->assign('order', $order); $this->assign('fields', $fields); $this->assign('regions', $regions); $this->setLayout('profile_order'); break; case 'module_shipping': break; default: $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.bind-first-0.1.min.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.inputmask-multi.js', 'text/javascript', false); $document->addScript(JURI::base() . 'components/com_ksenmart/js/jquery.Jcrop.min.js', 'text/javascript', true); $document->addScript(JURI::base() . 'components/com_ksenmart/js/profile.js', 'text/javascript', false); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/map.css'); $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/jquery.Jcrop.min.css'); $model = $this->getModel('profile'); $user = KSUsers::getUser(); $fields = KSUsers::getFields(); $regions = $this->get('Regions'); $favorities = $this->get('Favorities'); $watched = $this->get('Watched'); $orders = $this->get('Orders'); $addresses = $this->get('Addresses'); $reviews = $this->get('Comments'); $pagination = $this->get('Pagination'); $user_review = $model->getShopReview($user->id); $this->assign('user', $user); $this->assign('fields', $fields); $this->assign('regions', $regions); $this->assign('favorities', $favorities); $this->assign('watched', $watched); $this->assign('orders', $orders); $this->assign('addresses', $addresses); $this->assign('reviews', $reviews); $this->assign('user_review', $user_review); $this->assign('pagination', $pagination); $this->assign('model_profile', $model); $this->assign('show_shop_review', KSSystem::issetReview($user->id)); $this->setLayout('profile'); break; } parent::display($tpl); }