function display($cachable = false, $urlparams = false) { $mainframe = JFactory::getApplication(); $context = "jshoping.list.admin.coupons"; $limit = $mainframe->getUserStateFromRequest($context . 'limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int'); $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', "C.coupon_code", 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd'); $jshopConfig = JSFactory::getConfig(); $coupons = JSFactory::getModel("coupons"); $total = $coupons->getCountCoupons(); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $rows = $coupons->getAllCoupons($pageNav->limitstart, $pageNav->limit, $filter_order, $filter_order_Dir); $currency = JSFactory::getTable('currency', 'jshop'); $currency->load($jshopConfig->mainCurrency); $view = $this->getView("coupons", 'html'); $view->setLayout("list"); $view->assign('rows', $rows); $view->assign('currency', $currency->currency_code); $view->assign('pageNav', $pageNav); $view->assign('filter_order', $filter_order); $view->assign('filter_order_Dir', $filter_order_Dir); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeDisplayCoupons', array(&$view)); $view->displayList(); }
function start() { $jshopConfig = JSFactory::getConfig(); $key = JRequest::getVar("key"); if ($key != $jshopConfig->securitykey) { die; } $_GET['noredirect'] = 1; $_POST['noredirect'] = 1; $_REQUEST['noredirect'] = 1; $db = JFactory::getDBO(); $time = time(); $query = "SELECT * FROM `#__jshopping_import_export` where `steptime`>0 and (endstart + steptime < {$time}) ORDER BY id"; $db->setQuery($query); $list = $db->loadObjectList(); foreach ($list as $ie) { $alias = $ie->alias; if (!file_exists(JPATH_COMPONENT_ADMINISTRATOR . "/importexport/" . $alias . "/" . $alias . ".php")) { print sprintf(_JSHOP_ERROR_FILE_NOT_EXIST, "/importexport/" . $alias . "/" . $alias . ".php"); return 0; } include_once JPATH_COMPONENT_ADMINISTRATOR . "/importexport/" . $alias . "/" . $alias . ".php"; $classname = 'Ie' . $alias; $controller = new $classname($ie->id); $controller->set('ie_id', $ie->id); $controller->set('alias', $alias); $controller->save(); print $alias . "\n"; } die; }
public function deleteImage($id) { $image = $this->getImage($id); if ($image) { @unlink(JSFactory::getConfig()->image_attributes_path . "/" . $image); } }
function view() { $jshopConfig = JSFactory::getConfig(); $ajax = JRequest::getInt('ajax'); $dispatcher = JDispatcher::getInstance(); $cartpreview = JSFactory::getModel('cartPreview', 'jshop'); $cart = JSFactory::getModel('cart', 'jshop')->init("wishlist", 1); JshopHelpersMetadata::wishlist(); $cartpreview->setCart($cart); $cartpreview->setCheckoutStep(0); $shopurl = $cartpreview->getBackUrlShop(); $view = $this->getView('cart'); $view->setLayout("wishlist"); $view->assign('config', $jshopConfig); $view->assign('products', $cartpreview->getProducts()); $view->assign('image_product_path', $jshopConfig->image_product_live_path); $view->assign('image_path', $jshopConfig->live_path); $view->assign('no_image', $jshopConfig->noimage); $view->assign('href_shop', $shopurl); $view->assign('href_checkout', SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1)); $dispatcher->trigger('onBeforeDisplayWishlistView', array(&$view)); $view->display(); if ($ajax) { die; } }
function edit() { $jshopConfig = JSFactory::getConfig(); $shipping_id = JRequest::getInt("shipping_id"); $shipping = JTable::getInstance('shippingMethod', 'jshop'); $shipping->load($shipping_id); $edit = $shipping_id ? $edit = 1 : ($edit = 0); $_lang = $this->getModel("languages"); $languages = $_lang->getAllLanguages(1); $multilang = count($languages) > 1; $_payments = $this->getModel("payments"); $list_payments = $_payments->getAllPaymentMethods(0); $lists['payments'] = JHTML::_('select.genericlist', $list_payments, 'listpayments[]', 'class="inputbox" size="10" multiple = "multiple"', 'payment_id', 'name', $shipping->getPayments()); $nofilter = array(); JFilterOutput::objectHTMLSafe($shipping, ENT_QUOTES, $nofilter); $view = $this->getView("shippings", 'html'); $view->setLayout("edit"); $view->assign('shipping', $shipping); $view->assign('edit', $edit); $view->assign('languages', $languages); $view->assign('multilang', $multilang); $view->assign('lists', $lists); $view->assign('config', $jshopConfig); $view->assign('etemplatevar', ''); JPluginHelper::importPlugin('jshoppingadmin'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeEditShippings', array(&$view)); $view->displayEdit(); }
function addTitleHead() { $jshopConfig = JSFactory::getConfig(); $vendorinfo = $this->_vendorinfo; $this->Image($jshopConfig->path . 'images/header.jpg', 1, 1, $jshopConfig->pdf_header_width, $jshopConfig->pdf_header_height); $this->Image($jshopConfig->path . 'images/footer.jpg', 1, 265, $jshopConfig->pdf_footer_width, $jshopConfig->pdf_footer_height); $this->SetFont('freesans', '', 8); $this->SetXY(115, 12); $this->SetTextColor($this->pdfcolors[2][0], $this->pdfcolors[2][1], $this->pdfcolors[2][2]); $_vendor_info = array(); $_vendor_info[] = $vendorinfo->adress; $_vendor_info[] = $vendorinfo->zip . " " . $vendorinfo->city; if ($vendorinfo->phone) { $_vendor_info[] = _JSHOP_CONTACT_PHONE . ": " . $vendorinfo->phone; } if ($vendorinfo->fax) { $_vendor_info[] = _JSHOP_CONTACT_FAX . ": " . $vendorinfo->fax; } if ($vendorinfo->email) { $_vendor_info[] = _JSHOP_EMAIL . ": " . $vendorinfo->email; } $str_vendor_info = implode("\n", $_vendor_info); $this->MultiCell(80, 3, $str_vendor_info, 0, 'R'); $this->SetTextColor($this->pdfcolors[0][0], $this->pdfcolors[0][1], $this->pdfcolors[0][2]); }
/** * get list country * * @param int $publish (0-all, 1-publish, 2-unpublish) * @param int $limitstart * @param int $limit * @param int $orderConfig use order config * @return array */ function getAllCountries($publish = 1, $limitstart = null, $limit = null, $orderConfig = 1, $order = null, $orderDir = null) { $db = JFactory::getDBO(); $jshopConfig = JSFactory::getConfig(); if ($publish == 0) { $where = " "; } else { if ($publish == 1) { $where = " WHERE country_publish = '1' "; } else { if ($publish == 2) { $where = " WHERE country_publish = '0' "; } } } $ordering = "ordering"; if ($orderConfig && $jshopConfig->sorting_country_in_alphabet) { $ordering = "name"; } if ($order && $orderDir) { $ordering = $order . " " . $orderDir; } $lang = JSFactory::getLang(); $query = "SELECT country_id, country_publish, ordering, country_code, country_code_2, `" . $lang->get("name") . "` as name FROM `#__jshopping_countries` " . $where . " ORDER BY " . $ordering; $db->setQuery($query, $limitstart, $limit); return $db->loadObjectList(); }
function fetchElement() { require_once JPATH_SITE . "/components/com_jshopping/lib/factory.php"; $jshopConfig = JSFactory::getConfig(); $db = JFactory::getDBO(); $lang = JFactory::getLanguage()->getTag(); $query = "SELECT m.category_id AS id, IF(`name_{$lang}`<>'',`name_{$lang}`,`name_" . $jshopConfig->frontend_lang . "`) AS title, IF(`name_{$lang}`<>'',`name_{$lang}`,`name_" . $jshopConfig->frontend_lang . "`) AS name, m.category_parent_id AS parent_id, m.category_parent_id as parent\n FROM #__jshopping_categories AS m\n LEFT JOIN #__jshopping_products_to_categories AS f\n ON m.category_id = f.category_id\n WHERE m.category_publish = 1\n ORDER BY ordering"; $db->setQuery($query); $menuItems = $db->loadObjectList(); $children = array(); if ($menuItems) { foreach ($menuItems as $v) { $pt = $v->parent_id; $list = isset($children[$pt]) ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } } jimport('joomla.html.html.menu'); $options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0); $this->_xml->addChild('option', 'Root')->addAttribute('value', 0); $optgroup = $this->_xml->addChild('optgroup', ''); $optgroup->addAttribute('label', 'Categories'); if (count($options)) { foreach ($options as $option) { $optgroup->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id); } } $this->_value = $this->_form->get($this->_name, $this->_default); $html = parent::fetchElement(); return $html; }
function edit() { $jshopConfig = JSFactory::getConfig(); $shipping_id = JRequest::getInt("shipping_id"); $shipping = JSFactory::getTable('shippingMethod', 'jshop'); $shipping->load($shipping_id); $edit = $shipping_id ? $edit = 1 : ($edit = 0); $_lang = JSFactory::getModel("languages"); $languages = $_lang->getAllLanguages(1); $multilang = count($languages) > 1; $params = $shipping->getParams(); $_payments = JSFactory::getModel("payments"); $list_payments = $_payments->getAllPaymentMethods(0); $active_payments = $shipping->getPayments(); if (!count($active_payments)) { $active_payments = array(0); } $first = array(); $first[] = JHTML::_('select.option', '0', _JSHOP_ALL, 'id', 'name'); $lists['payments'] = JHTML::_('select.genericlist', array_merge($first, $list_payments), 'listpayments[]', 'class="inputbox" size="10" multiple = "multiple"', 'payment_id', 'name', $active_payments); $nofilter = array(); JFilterOutput::objectHTMLSafe($shipping, ENT_QUOTES, $nofilter); $view = $this->getView("shippings", 'html'); $view->setLayout("edit"); $view->assign('shipping', $shipping); $view->assign('params', $params); $view->assign('edit', $edit); $view->assign('languages', $languages); $view->assign('multilang', $multilang); $view->assign('lists', $lists); $view->assign('config', $jshopConfig); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeEditShippings', array(&$view)); $view->displayEdit(); }
function showEndForm($pmconfigs, $order) { $jshopConfig = JSFactory::getConfig(); $pm_method = $this->getPmMethod(); $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->clear(); $query->update('#__jshopping_orders')->set($db->quoteName('order_created') . ' = 1 ')->where($db->quoteName('order_id') . ' = ' . (int) $order->order_id); $db->setQuery($query); echo '<div id="begateway_erip">'; try { $db->execute(); $model = JSFactory::getModel('orderMail', 'jshop'); $model->setData($order->order_id, 0); $model->send(); if ($pmconfigs['auto'] == '1') { JPluginHelper::importPlugin('PlgSystemJoomShoppingErip'); $dispatcher = JEventDispatcher::getInstance(); $result = $dispatcher->trigger('onBeforeChangeOrderStatusAdmin', array($order->order_id, $this->getStatusId(), 'auto')); if (!$result) { throw new Exception(JText::_('PLG_JSERIPPAYMENT_ORDER_ERROR')); } $instruction = JText::_('PLG_JSERIPPAYMENT_ERIP_INSTRUCTION'); $instruction = str_replace('#TABS#', '<strong>' . $pmconfigs['tree_path_email'] . '</strong>', $instruction); $instruction = str_replace('#ORDER_ID#', '<strong>' . $order->order_id . '</strong>', $instruction); echo nl2br($instruction); } else { echo nl2br(JText::_('PLG_JSERIPPAYMENT_ORDER_CONFIRMATION')); } } catch (RuntimeException $e) { echo JText::_('PLG_JSERIPPAYMENT_ORDER_ERROR'); } echo '</div>'; }
function display($cachable = false, $urlparams = false) { $jshopConfig = JSFactory::getConfig(); $position = JRequest::getInt('position'); $filter = JRequest::getVar('filter'); $path_length = strlen($jshopConfig->image_product_path) + 1; $html = "<div class='images_list_search'><input type='text' id='filter_product_image_name' value='" . $filter . "'> <input type='button' value='" . _JSHOP_SEARCH . "' onclick='product_images_request(" . $position . ", \"index.php?option=com_jshopping&controller=product_images&task=display\", jQuery(\"#filter_product_image_name\").val())'></div>"; $html .= '<div class="images_list">'; foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($jshopConfig->image_product_path), RecursiveIteratorIterator::SELF_FIRST) as $v) { $filename = substr($v, $path_length); if ($filter != '' && !substr_count($filename, $filter)) { continue; } if (file_exists($jshopConfig->image_product_path . '/' . 'thumb_' . $filename)) { $html .= '<div class="one_image">'; $html .= '<table>'; $html .= '<tr><td align="center" valign="middle"><div>'; $html .= $this->_getLinkForImage('<img alt="" title="' . $filename . '" src="' . $jshopConfig->image_product_live_path . '/thumb_' . $filename . '"/>', $filename); $html .= '</div></td></tr>'; $html .= '<tr><td valign="bottom" align="center"><div>'; $html .= $this->_getLinkForImage($filename, $filename); $html .= '</div></td></tr>'; $html .= '</table>'; $html .= '</div>'; } } $html .= '<div style="clear: both"></div>'; $html .= '</div>'; $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeDisplayProductsImagesHTML', array(&$html)); echo $html; die; }
function showEndForm($pmconfigs, $order) { $mainframe =& JFactory::getApplication(); $jshopConfig =& JSFactory::getConfig(); $item_name = sprintf(_JSHOP_PAYMENT_NUMBER, $order->order_number); $notify_url = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_ideal&no_lang=1"; $return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_ideal"; $cancel_return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=cancel&js_paymentclass=pm_ideal"; $params_data = $order->getPaymentParamsData(); $bank_id = $params_data['bank_id']; $amount = intval($order->order_total * 100); $iDEAL = new iDEAL_Payment($pmconfigs['partnerid']); if ($pmconfigs['testmode']) { $iDEAL->setTestMode(); } if ($iDEAL->createPayment($bank_id, $amount, $item_name, $return, $notify_url)) { $order1 =& JTable::getInstance('order', 'jshop'); $order1->load($order->order_id); $order1->transaction = $iDEAL->getTransactionId(); $order1->store(); header("Location: " . $iDEAL->getBankURL()); exit; } else { saveToLog("payment.log", "Error: Order ID " . $order->order_id . ". CODE: " . $iDEAL->getErrorCode() . ". MSG: " . $iDEAL->getErrorMessage()); JError::raiseWarning("", $iDEAL->getErrorMessage()); $mainframe->redirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5', 0, 1, $jshopConfig->use_ssl)); exit; } }
function display($cachable = false, $urlparams = false) { $jshopConfig = JSFactory::getConfig(); $mainframe = JFactory::getApplication(); $context = "jshoping.list.admin.currencies"; $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', "currency_ordering", 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd'); $current_currency = JTable::getInstance('currency', 'jshop'); $current_currency->load($jshopConfig->mainCurrency); if ($current_currency->currency_value != 1) { JError::raiseWarning("", _JSHOP_ERROR_MAIN_CURRENCY_VALUE); } $currencies = $this->getModel("currencies"); $rows = $currencies->getAllCurrencies(0, $filter_order, $filter_order_Dir); $view = $this->getView("currencies", 'html'); $view->setLayout("list"); $view->assign('rows', $rows); $view->assign('config', $jshopConfig); $view->assign('filter_order', $filter_order); $view->assign('filter_order_Dir', $filter_order_Dir); JPluginHelper::importPlugin('jshoppingadmin'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeDisplayCourencies', array(&$view)); $view->displayList(); }
function addTitleHead() { $jshopConfig = JSFactory::getConfig(); $vendorinfo = $this->_vendorinfo; $this->Image($jshopConfig->path . 'images/header.jpg', 1, 1, $jshopConfig->pdf_header_width, $jshopConfig->pdf_header_height); # $this->Image($jshopConfig->path.'images/footer.jpg',1,265,$jshopConfig->pdf_footer_width,$jshopConfig->pdf_footer_height); }
function getProductFieldSorting($order) { if ($order == 4) { $order = 1; } return JSFactory::getConfig()->sorting_products_field_s_select[$order]; }
function edit() { $mainframe = JFactory::getApplication(); $jshopConfig = JSFactory::getConfig(); $db = JFactory::getDBO(); $id = JRequest::getInt("id"); $vendor = JTable::getInstance('vendor', 'jshop'); $vendor->load($id); if (!$id) { $vendor->publish = 1; } $_countries = $this->getModel("countries"); $countries = $_countries->getAllCountries(0); $lists['country'] = JHTML::_('select.genericlist', $countries, 'country', 'class = "inputbox" size = "1"', 'country_id', 'name', $vendor->country); $nofilter = array(); JFilterOutput::objectHTMLSafe($vendor, ENT_QUOTES, $nofilter); $view = $this->getView("vendors", 'html'); $view->setLayout("edit"); $view->assign('vendor', $vendor); $view->assign('lists', $lists); $view->assign('etemplatevar', ''); JPluginHelper::importPlugin('jshoppingadmin'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeEditVendors', array(&$view)); $view->displayEdit(); }
public static function getList(&$params) { $db = JFactory::getDBO(); $jshopConfig = JSFactory::getConfig(); $jshopConfig->cur_lang = $jshopConfig->frontend_lang; JSFactory::loadCssFiles(); JSFactory::loadLanguageFile(); $lang = JSFactory::getLang(); $jshopConfig = JSFactory::getConfig(); $field_sort = $params->get('sort', 'id'); $ordering = $params->get('ordering', 'asc'); $_limit = (int) $params->get('count_cat', 10); $catids = $params->get('catids', 0); $_catids = array(); $list = array(); settype($catids, 'array'); if (!empty($catids)) { $catid = implode(", ", $catids); $list = self::getCategory($catid, $field_sort, $ordering, $_limit, 1); } if (!empty($list)) { foreach ($list as $i => $item) { $item->_short_desc = self::_cleanText($item->short_description); $item->_description = self::_cleanText($item->description); $item->_description = $item->_description != '' ? $item->_description : $item->_short_desc; self::getJSCImages($item, $params, 'imgcfgcat'); } } return $list; }
private function loadOrderLink() { $jshopConfig = JSFactory::getConfig(); foreach ($this->list as $key => $value) { $this->list[$key]->order_href = SEFLink('index.php?option=com_jshopping&controller=user&task=order&order_id=' . $value->order_id, 0, 0, $jshopConfig->use_ssl); } }
function getAllLanguages($publish = 1) { $jshopConfig = JSFactory::getConfig(); $db = JFactory::getDBO(); $where_add = $publish ? "where `publish`='1'" : ""; $query = "SELECT * FROM `#__jshopping_languages` " . $where_add . " order by `ordering`"; extract(js_add_trigger(get_defined_vars(), "before")); $db->setQuery($query); $rowssort = array(); $rows = $db->loadObjectList(); foreach ($rows as $k => $v) { $rows[$k]->lang = substr($v->language, 0, 2); if ($jshopConfig->cur_lang == $v->language) { $rowssort[] = $rows[$k]; } } foreach ($rows as $k => $v) { if (isset($rowssort[0]) && $rowssort[0]->language == $v->language) { continue; } $rowssort[] = $v; } unset($rows); return $rowssort; }
private function buildAdvQuery() { if ($this->buildAdvQuery == 1) { return 0; } $jshopConfig = JSFactory::getConfig(); $dispatcher = JDispatcher::getInstance(); $db = JFactory::getDBO(); $product = JSFactory::getTable('product', 'jshop'); $orderbyq = getQuerySortDirection($this->order, $this->orderby); $adv_query = ""; $adv_from = ""; $adv_result = $product->getBuildQueryListProductDefaultResult(); $product->getBuildQueryListProduct("search", "list", $this->filters, $adv_query, $adv_from, $adv_result); if ($this->date_to && checkMyDate($this->date_to)) { $adv_query .= " AND prod.product_date_added <= '" . $db->escape($this->date_to) . "'"; } if ($this->date_from && checkMyDate($this->date_from)) { $adv_query .= " AND prod.product_date_added >= '" . $db->escape($this->date_from) . "'"; } $where_search = ""; if ($this->search_type == "exact") { $word = addcslashes($db->escape($this->search), "_%"); $tmp = array(); foreach ($jshopConfig->product_search_fields as $field) { $tmp[] = "LOWER(" . getDBFieldNameFromConfig($field) . ") LIKE '%" . $word . "%'"; } $where_search = implode(' OR ', $tmp); } else { $words = explode(" ", $this->search); $search_word = array(); foreach ($words as $word) { $word = addcslashes($db->escape($word), "_%"); $tmp = array(); foreach ($jshopConfig->product_search_fields as $field) { $tmp[] = "LOWER(" . getDBFieldNameFromConfig($field) . ") LIKE '%" . $word . "%'"; } $where_search_block = implode(' OR ', $tmp); $search_word[] = "(" . $where_search_block . ")"; } if ($this->search_type == "any") { $where_search = implode(" OR ", $search_word); } else { $where_search = implode(" AND ", $search_word); } } if ($where_search) { $adv_query .= " AND ({$where_search})"; } $orderbyf = $jshopConfig->sorting_products_field_s_select[$this->order]; $order_query = $product->getBuildQueryOrderListProduct($orderbyf, $orderbyq, $adv_from); $dispatcher->trigger('onBeforeQueryGetProductList', array("search", &$adv_result, &$adv_from, &$adv_query, &$order_query, &$this->filters)); $this->adv_result = $adv_result; $this->adv_from = $adv_from; $this->adv_query = $adv_query; $this->order_query = $order_query; $this->buildAdvQuery == 1; return 1; }
function products() { $jshopConfig = JSFactory::getConfig(); $dispatcher = JDispatcher::getInstance(); $vendor_id = JRequest::getInt("vendor_id"); JSFactory::getModel('productShop', 'jshop')->storeEndPages(); $vendor = JSFactory::getTable('vendor', 'jshop'); $vendor->load($vendor_id); $dispatcher->trigger('onBeforeDisplayVendor', array(&$vendor)); JshopHelpersMetadata::vendorProducts($vendor); $productlist = JSFactory::getModel('productList', 'jshop'); $productlist->setModel($vendor); $productlist->load(); $orderby = $productlist->getOrderBy(); $image_sort_dir = $productlist->getImageSortDir(); $filters = $productlist->getFilters(); $action = $productlist->getAction(); $products = $productlist->getProducts(); $pagination = $productlist->getPagination(); $pagenav = $productlist->getPagenav(); $sorting_sel = $productlist->getHtmlSelectSorting(); $product_count_sel = $productlist->getHtmlSelectCount(); $willBeUseFilter = $productlist->getWillBeUseFilter(); $display_list_products = $productlist->getDisplayListProducts(); $manufacuturers_sel = $productlist->getHtmlSelectFilterManufacturer(1); $categorys_sel = $productlist->getHtmlSelectFilterCategory(1); $allow_review = $productlist->getAllowReview(); $view = $this->getView('vendor'); $view->setLayout("products"); $view->assign('config', $jshopConfig); $view->assign('template_block_list_product', $productlist->getTmplBlockListProduct()); $view->assign('template_no_list_product', $productlist->getTmplNoListProduct()); $view->assign('template_block_form_filter', $productlist->getTmplBlockFormFilter()); $view->assign('template_block_pagination', $productlist->getTmplBlockPagination()); $view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir); $view->assign('filter_show', 1); $view->assign('filter_show_category', 1); $view->assign('filter_show_manufacturer', 1); $view->assign('pagination', $pagenav); $view->assign('pagination_obj', $pagination); $view->assign('display_pagination', $pagenav != ""); $view->assign("rows", $products); $view->assign("count_product_to_row", $productlist->getCountProductsToRow()); $view->assign("vendor", $vendor); $view->assign('action', $action); $view->assign('allow_review', $allow_review); $view->assign('orderby', $orderby); $view->assign('product_count', $product_count_sel); $view->assign('sorting', $sorting_sel); $view->assign('categorys_sel', $categorys_sel); $view->assign('manufacuturers_sel', $manufacuturers_sel); $view->assign('filters', $filters); $view->assign('willBeUseFilter', $willBeUseFilter); $view->assign('display_list_products', $display_list_products); $view->assign('shippinginfo', SEFLink($jshopConfig->shippinginfourl, 1)); $dispatcher->trigger('onBeforeDisplayProductListView', array(&$view)); $view->display(); }
function getText() { $jshopConfig = JSFactory::getConfig(); if ($this->getAllowReview() == -1) { return _JSHOP_REVIEW_NOT_LOGGED; } else { return ''; } }
function fileDemoIsVideo() { $video = 0; $info = pathinfo($this->demo); if (in_array($info['extension'], JSFactory::getConfig()->file_extension_video)) { $video = 1; } return $video; }
public function getView($name) { $jshopConfig = JSFactory::getConfig(); include_once JPATH_JOOMSHOPPING . "/views/" . $name . "/view.html.php"; $config = array("template_path" => $jshopConfig->template_path . $jshopConfig->template . "/" . $name); $viewClass = 'JshoppingView' . $name; $view = new $viewClass($config); return $view; }
function getList() { $jshopConfig = JSFactory::getConfig(); if ($jshopConfig->manufacturer_sorting == 2) { $morder = 'name'; } else { $morder = 'ordering'; } return $this->getAllManufacturers(0, $morder, 'asc'); }
function edit() { $jshopConfig = JSFactory::getConfig(); $sh_pr_method_id = JRequest::getInt('sh_pr_method_id'); $shipping_id_back = JRequest::getInt("shipping_id_back"); $db = JFactory::getDBO(); $sh_method_price = JTable::getInstance('shippingMethodPrice', 'jshop'); $sh_method_price->load($sh_pr_method_id); $sh_method_price->prices = $sh_method_price->getPrices(); if ($jshopConfig->tax) { $taxes = $this->getModel("taxes"); $all_taxes = $taxes->getAllTaxes(); $list_tax = array(); foreach ($all_taxes as $tax) { $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)', 'tax_id', 'tax_name'); } $list_tax[] = JHTML::_('select.option', -1, _JSHOP_PRODUCT_TAX_RATE, 'tax_id', 'tax_name'); $lists['taxes'] = JHTML::_('select.genericlist', $list_tax, 'shipping_tax_id', 'class="inputbox"', 'tax_id', 'tax_name', $sh_method_price->shipping_tax_id); $lists['package_taxes'] = JHTML::_('select.genericlist', $list_tax, 'package_tax_id', 'class="inputbox"', 'tax_id', 'tax_name', $sh_method_price->package_tax_id); } $shippings = $this->getModel("shippings"); $countries = $this->getModel("countries"); $actived = $sh_method_price->shipping_method_id; if (!$actived) { $actived = $shipping_id_back; } $lists['shipping_methods'] = JHTML::_('select.genericlist', $shippings->getAllShippings(0), 'shipping_method_id', 'class = "inputbox" size = "1"', 'shipping_id', 'name', $actived); $lists['countries'] = JHTML::_('select.genericlist', $countries->getAllCountries(0), 'shipping_countries_id[]', 'class = "inputbox" size = "10", multiple = "multiple"', 'country_id', 'name', $sh_method_price->getCountries()); if ($jshopConfig->admin_show_delivery_time) { $_deliveryTimes = $this->getModel("deliveryTimes"); $all_delivery_times = $_deliveryTimes->getDeliveryTimes(); $all_delivery_times0 = array(); $all_delivery_times0[0] = new stdClass(); $all_delivery_times0[0]->id = '0'; $all_delivery_times0[0]->name = _JSHOP_NONE; $lists['deliverytimes'] = JHTML::_('select.genericlist', array_merge($all_delivery_times0, $all_delivery_times), 'delivery_times_id', 'class = "inputbox"', 'id', 'name', $sh_method_price->delivery_times_id); } $currency = JTable::getInstance('currency', 'jshop'); $currency->load($jshopConfig->mainCurrency); $extensions = JSFactory::getShippingExtList($actived); $view = $this->getView("shippingsprices", 'html'); $view->setLayout("edit"); $view->assign('sh_method_price', $sh_method_price); $view->assign('lists', $lists); $view->assign('shipping_id_back', $shipping_id_back); $view->assign('currency', $currency); $view->assign('extensions', $extensions); $view->assign('config', $jshopConfig); $view->assign('etemplatevar', ''); JPluginHelper::importPlugin('jshoppingadmin'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeEditShippingsPrices', array(&$view)); $view->displayEdit(); }
public function getView($name = '', $type = '', $prefix = '', $config = array()) { $jshopConfig = JSFactory::getConfig(); if ($type == '') { $type = getDocumentType(); } if (empty($config)) { $config = array("template_path" => $jshopConfig->template_path . $jshopConfig->template . "/" . $name); } return parent::getView($name, $type, $prefix, $config); }
public function getCheckoutUrl($step, $defaultItemId = 0, $redirect = 1) { $jshopConfig = JSFactory::getConfig(); if (preg_match('/^(\\d)+$/', $step)) { $task = 'step' . $step; } else { $task = $step; } $url = SEFLink('index.php?option=com_jshopping&controller=checkout&task=' . $task, $defaultItemId, $redirect, $jshopConfig->use_ssl); return $url; }
function view() { $mainframe = JFactory::getApplication(); $jshopConfig = JSFactory::getConfig(); $db = JFactory::getDBO(); $session = JFactory::getSession(); $params = $mainframe->getParams(); $ajax = JRequest::getInt('ajax'); $cart = JModelLegacy::getInstance('cart', 'jshop'); $cart->load("wishlist"); $cart->addLinkToProducts(1, "wishlist"); $cart->setDisplayFreeAttributes(); $seo = JTable::getInstance("seo", "jshop"); $seodata = $seo->loadData("wishlist"); if (getThisURLMainPageShop()) { $document = JFactory::getDocument(); appendPathWay(_JSHOP_WISHLIST); if ($seodata->title == "") { $seodata->title = _JSHOP_WISHLIST; } setMetaData($seodata->title, $seodata->keyword, $seodata->description); } else { setMetaData($seodata->title, $seodata->keyword, $seodata->description, $params); } $shopurl = SEFLink('index.php?option=com_jshopping&controller=category', 1); if ($jshopConfig->cart_back_to_shop == "product") { $endpagebuyproduct = xhtmlUrl($session->get('jshop_end_page_buy_product')); } elseif ($jshopConfig->cart_back_to_shop == "list") { $endpagebuyproduct = xhtmlUrl($session->get('jshop_end_page_list_product')); } if (isset($endpagebuyproduct) && $endpagebuyproduct) { $shopurl = $endpagebuyproduct; } JPluginHelper::importPlugin('jshoppingcheckout'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeDisplayWishlist', array(&$cart)); $view_name = "cart"; $view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name); $view = $this->getView($view_name, getDocumentType(), '', $view_config); $view->setLayout("wishlist"); $view->assign('config', $jshopConfig); $view->assign('products', $cart->products); $view->assign('image_product_path', $jshopConfig->image_product_live_path); $view->assign('image_path', $jshopConfig->live_path); $view->assign('no_image', $jshopConfig->noimage); $view->assign('href_shop', $shopurl); $view->assign('href_checkout', SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1)); $dispatcher->trigger('onBeforeDisplayWishlistView', array(&$view)); $view->display(); if ($ajax) { die; } }
function showEndForm($params, $order) { $jshopConfig = JSFactory::getConfig(); $item_name = sprintf(_JSHOP_PAYMENT_NUMBER, $order->order_number); $order->order_total = $this->fixOrderTotal($order); $data = array($params['user_id'], $params['project_id'], '', '', '', '', $order->order_total, $order->currency_code_iso, $item_name, '', $order->order_id, '', '', '', '', '', $params['project_password']); $data_implode = implode('|', $data); $hash = sha1($data_implode); $datajshopping = JApplicationHelper::parseXMLInstallFile($jshopConfig->admin_path . "jshopping.xml"); ?> <form id="paymentform" action="https://www.sofortueberweisung.de/payment/start" name = "paymentform" method = "post"> <input type='hidden' name='user_id' value='<?php print $params['user_id']; ?> ' /> <input type='hidden' name='project_id' value='<?php print $params['project_id']; ?> ' /> <input type="hidden" name="user_variable_0" value="<?php print $order->order_id; ?> "> <input type='hidden' name='reason_1' value='<?php print $item_name; ?> ' /> <input type='hidden' name='amount' value='<?php print $order->order_total; ?> '/> <input type="hidden" name="currency_id" value="<?php print $order->currency_code_iso; ?> " /> <input type='hidden' name='hash' value='<?php print $hash; ?> ' /> <input type='hidden' name='interface_version' value='joomshopping_<?php print $datajshopping['version']; ?> ' /> </form> <?php print _JSHOP_REDIRECT_TO_PAYMENT_PAGE; ?> <br> <script type="text/javascript">document.getElementById('paymentform').submit();</script> <?php die; }