本文整理汇总了PHP中KSSystem::getShopItemid方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::getShopItemid方法的具体用法?PHP KSSystem::getShopItemid怎么用?PHP KSSystem::getShopItemid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSSystem
的用法示例。
在下文中一共展示了KSSystem::getShopItemid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_order
public function load_order()
{
$session = JFactory::getSession();
$model = $this->getModel('profile');
$order = $model->getOrder();
$session->set('shopcart_discount', $order->coupon);
$session->set('shop_order_id', $order->id);
$this->setRedirect(JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . KSSystem::getShopItemid(), false));
}
示例2: close_order
function close_order()
{
$session = JFactory::getSession();
$order_id = $session->get('shop_order_id', 0);
if ($order_id != 0) {
$model = $this->getModel('cart');
$model->closeOrder();
$this->setRedirect(JRoute::_('index.php?option=com_ksenmart&view=cart&layout=congratulation&Itemid=' . KSSystem::getShopItemid(), false));
}
}
示例3: add_comment
public function add_comment()
{
$app = JFactory::getApplication();
$model = $this->getModel('Product', 'KsenmartModel');
$comments_model = $this->getModel('Comments', 'KsenmartModel');
$return_url = JRoute::_('index.php?option=com_ksenmart&view=product&id=' . $model->_id . '&Itemid=' . KSSystem::getShopItemid());
$requestData = $this->input->post->get('jform', array(), 'array');
$data = array();
if (count($requestData)) {
$model->form = 'review';
$form = $model->getForm();
if (!$form) {
JError::raiseError(500, $model->getError());
return false;
}
$data = $model->validate($form, $requestData);
if ($data === false) {
$errors = $model->getErrors();
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
if ($errors[$i] instanceof Exception) {
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
} else {
$app->enqueueMessage($errors[$i], 'warning');
}
}
$this->setRedirect($return_url);
return false;
}
} else {
$data = array();
$data['comment_name'] = $this->input->post->get('comment_name', $user->name, 'string');
$data['comment_rate'] = $this->input->post->get('comment_rate', 0, 'int');
$data['comment_comment'] = $this->input->post->get('comment_comment', null, 'string');
$data['comment_good'] = $this->input->post->get('comment_good', null, 'string');
$data['comment_name'] = $this->input->post->get('comment_bad', null, 'string');
}
$data['product_id'] = $model->_id;
$comments_model->addComment($data);
if (!isset($_SESSION['rated']) || !is_array($_SESSION['rated'])) {
$_SESSION['rated'] = array();
}
$_SESSION['rated'][$model->_id] = 1;
$this->setMessage('Ваш отзыв принят');
$this->setRedirect($return_url);
return true;
}
示例4: AddHeadTags
public static function AddHeadTags()
{
if (self::$_headAdded == true) {
return;
}
$session = JFactory::getSession();
$document = JFactory::getDocument();
JDispatcher::getInstance()->trigger('onLoadKsen', array('ksenmart.KSM', array('common'), array(), array('angularJS' => 0)));
KSLoader::loadLocalHelpers(array('common'));
$params = JComponentHelper::getParams('com_ksenmart');
$document->addScript(JURI::base() . 'administrator/components/com_ksenmart/js/jquery.custom.min.js');
$document->addScript(JURI::base() . 'components/com_ksenmart/js/common.js');
$document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/common.css');
if ($params->get('include_css', 1)) {
$document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/template.css');
}
$js = "\n var URI_ROOT='" . JURI::root() . "';\n var km_cart_link='" . JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . KSSystem::getShopItemid()) . "';\n var shopItemid='" . KSSystem::getShopItemid() . "';\n var order_type='ordering';\n var order_dir='asc'; \n var limit=" . $params->get('site_product_limit', 30) . ";\n var limitstart=0; \n var use_pagination=" . $params->get('site_use_pagination', 0) . ";\n var order_process=" . $params->get('order_process', 0) . ";\n var cat_id=" . JRequest::getInt('id', 0) . ";\n var user_id=" . JFactory::getUser()->id . ";\n var page=1;\n var session_id='" . $session->getId() . "';\n ";
$document->addScriptDeclaration($js);
self::$_headAdded = true;
KSSystem::loadPlugins();
}
示例5: getInput
public function getInput()
{
$db = JFactory::getDBO();
$this->value = is_array($this->value) ? $this->value : array();
$html = '<style>.form-horizontal .controls {margin:0px;}</style>';
$html .= '<table class="table table-striped" id="articleList">';
$html .= ' <thead>';
$html .= ' <tr>';
$html .= ' <th class="title">' . JText::_('ksm_plugin_modules_module_title') . '</th>';
$html .= ' <th width="10%" class="nowrap hidden-phone">' . JText::_('ksm_plugin_modules_module_position') . '</th>';
$html .= ' <th width="30%" class="nowrap hidden-phone">' . JText::_('ksm_plugin_modules_module_pages') . '</th>';
$html .= ' <th width="30%" class="hidden-phone">' . JText::_('ksm_plugin_modules_module_categories') . '</th>';
$html .= ' </tr>';
$html .= ' </thead>';
$query = $db->getQuery(true);
$query->select('a.id, a.title, a.position, a.published, map.menuid')->from('#__modules AS a')->join('LEFT', sprintf('#__modules_menu AS map ON map.moduleid = a.id AND map.menuid IN (0, %1$d, -%1$d)', KSSystem::getShopItemid()))->select('(SELECT COUNT(*) FROM #__modules_menu WHERE moduleid = a.id AND menuid < 0) AS ' . $db->quoteName('except'));
$query->select('ag.title AS access_title')->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access')->where('a.published >= 0')->where('a.client_id = 0')->where('a.title != ' . $db->quote(''))->order('a.position, a.ordering');
$db->setQuery($query);
$modules = $db->loadObjectList();
$page_options = array(JHtml::_('select.option', 0, JText::_('JALL')), JHtml::_('select.option', -1, JText::_('ksm_plugin_modules_noone')));
foreach ($this->pages as $key => $page) {
$page_options[] = JHtml::_('select.option', $key, JText::_('ksm_plugin_modules_page_' . $page));
}
$cat_options = $this->getCatOptions();
foreach ($modules as $module) {
if (is_null($module->menuid) && (!$module->except || $module->menuid < 0)) {
continue;
}
$selected_pages = isset($this->value[$module->position][$module->id]['pages']) ? $this->value[$module->position][$module->id]['pages'] : array(0);
$selected_cats = isset($this->value[$module->position][$module->id]['categories']) ? $this->value[$module->position][$module->id]['categories'] : array(0);
$html .= '<tr>';
$html .= ' <td class="title">' . $module->title . '</th>';
$html .= ' <td width="10%" class="nowrap hidden-phone">' . $module->position . '</th>';
$html .= ' <td width="30%" class="nowrap hidden-phone">' . JHtml::_('select.genericlist', $page_options, $this->name . '[' . $module->position . '][' . $module->id . '][pages][]', 'multiple="multiple"', 'value', 'text', $selected_pages) . '</th>';
$html .= ' <td width="30%" class="hidden-phone">' . JHtml::_('select.genericlist', $cat_options, $this->name . '[' . $module->position . '][' . $module->id . '][categories][]', 'multiple="multiple"', 'value', 'text', $selected_cats) . '</th>';
$html .= '</tr>';
}
$html .= '</table>';
return $html;
}
示例6: getManufacturers
function getManufacturers($group)
{
$db = JFactory::getDBO();
$session_manufacturers = JRequest::getVar('manufacturers', array());
JArrayHelper::toInteger($session_manufacturers);
$query = $db->getQuery(true);
$query->select('
km.*,
kf.filename,
kf.folder,
kf.params
')->from('#__ksenmart_manufacturers as km')->leftjoin("#__ksenmart_countries as kc on km.country=kc.id")->leftjoin("#__ksenmart_files as kf on kc.id=kf.owner_id and kf.owner_type='country'")->where('km.published=1')->order('km.title');
if ($group) {
$query->select('
kc.id AS country_id,
kc.title AS country_title
');
} else {
$query->group('km.id');
}
$db->setQuery($query);
$manufacturers = $db->loadObjectList('id');
$tmpManufacturers = array();
foreach ($manufacturers as &$manufacturer) {
$manufacturer->selected = in_array($manufacturer->id, $session_manufacturers) ? true : false;
if (!empty($manufacturer->folder)) {
$manufacturer->small_img = KSMedia::resizeImage($manufacturer->filename, $manufacturer->folder, 25, 30, json_decode($manufacturer->params, true));
}
unset($manufacturer->filename);
unset($manufacturer->folder);
$manufacturer->link = JRoute::_('index.php?option=com_ksenmart&view=catalog&manufacturers[]=' . $manufacturer->id . '&Itemid=' . KSSystem::getShopItemid());
if ($group) {
$tmpManufacturers[$manufacturer->country_title][] = $manufacturer;
}
}
if (!$tmpManufacturers) {
$tmpManufacturers = $manufacturers;
}
return $tmpManufacturers;
}
示例7: foreach
<td align="center"><b><?php
echo JText::_('KSM_ORDER_MAIL_PRODUCT_PRICE');
?>
</b></td>
<td align="center"><b><?php
echo JText::_('KSM_ORDER_MAIL_PRODUCT_SUM');
?>
</b></td>
</tr>
<?php
foreach ($this->order->items as $item) {
?>
<tr class="row_odd">
<td class="vid_produkt">
<a class="title_lookp" href="<?php
echo JURI::root() . JRoute::_('index.php?option=com_ksenmart&view=product&id=' . $item->product_id . ':' . $item->product->alias . '&Itemid=' . KSSystem::getShopItemid());
?>
" ><?php
echo $item->product->title;
?>
</a>
<?php
if ($item->product->product_code != '') {
?>
<i><?php
echo JText::_('KSM_ORDER_MAIL_PRODUCT_SKU');
?>
<?php
echo $item->product->product_code;
?>
</i>
示例8: defined
<?php
defined('_JEXEC') or die;
$user = KSUsers::getUser();
$profile_link = JRoute::_('index.php?option=com_ksenmart&view=profile&Itemid=' . KSSystem::getShopItemid());
?>
<div class="accordion catalog-menu" id="dropdownCat">
<h3><?php
echo $module->title;
?>
</h3>
<div class="user-info">
<div class="avatar">
<img src="<?php
echo $user->logo_thumb;
?>
" alt="<?php
echo $user->name;
?>
" class="border_ksen" />
</div>
<div class="user_name"><?php
echo $user->name;
?>
</div>
<br clear="both">
</div>
<div class="left-menu">
<ul class="nav nav-list">
<li><a href="<?php
echo $profile_link;
示例9:
echo $this->product->tag;
?>
</a></span>
</div>
</div>
<?php
}
?>
<?php
if (isset($this->product->manufacturer->country) && count($this->product->manufacturer->country) > 0) {
?>
<div class="control-group">
<label class="control-label"><?php
echo JText::_('KSM_PRODUCT_COUNTRY');
?>
</label>
<div class="controls">
<span><a href="<?php
echo JRoute::_('index.php?option=com_ksenmart&view=catalog&countries[]=' . $this->product->manufacturer->country->id . '&Itemid=' . KSSystem::getShopItemid() . '&clicked=countries');
?>
"><?php
echo $this->product->manufacturer->country->title;
?>
</a></span>
</div>
</div>
<?php
}
?>
示例10: getCart
public function getCart()
{
$this->onExecuteBefore('getCart');
$Itemid = KSSystem::getShopItemid();
if (!empty($this->order_id)) {
$cart = KSMOrders::getOrder($this->order_id);
$this->setDefaultCartValues($cart);
$cart->items = KSMOrders::getOrderItems($this->order_id);
for ($k = 0; $k < count($cart->items); $k++) {
$cart->items[$k]->del_link = JRoute::_('index.php?option=com_ksenmart&view=cart&task=cart.update_cart&item_id=' . $cart->items[$k]->id . '&count=0&Itemid=' . $Itemid);
$cart->total_prds += $cart->items[$k]->count;
$cart->products_sum += $cart->items[$k]->count * $cart->items[$k]->price;
}
} else {
$this->setDefaultCartValues($cart);
}
$cart->products_sum_val = KSMPrice::showPriceWithTransform($cart->products_sum);
$cart->total_sum = $cart->products_sum;
$cart->total_sum_val = KSMPrice::showPriceWithTransform($cart->total_sum);
$this->onExecuteAfter('getCart', array(&$cart));
return $cart;
}
示例11: defined
<?php
defined('_JEXEC') or die;
$link = JRoute::_('index.php?option=com_ksenmart&view=cart&layout=congratulation&order_id=' . $this->order_id . '&Itemid=' . KSSystem::getShopItemid());
?>
<script>
window.parent.location = '<?php
echo $link;
?>
';
</script>
示例12: display
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);
}
示例13: getResult
private function getResult()
{
$Itemid = KSSystem::getShopItemid();
$this->value = trim(htmlspecialchars($this->value));
if (!empty($this->value)) {
if (empty($this->model)) {
$this->model = $this->getModel('search');
}
$affected_rows = false;
$p_ids = $this->model->getItemsSearch($this->value);
if ($p_ids) {
$affected_rows = true;
}
$cat_search = $this->model->getCatSearch($this->value);
$manufacture_search = $this->model->getManufactureSearch($this->value);
if ($this->ajax_search) {
$relevant_search = $this->model->getRelevantSearches($this->value);
}
if ($affected_rows) {
if (!$cat_search) {
if (!is_numeric($this->value)) {
$this->model->setRelevants($this->value);
}
}
} else {
$p_ids = $this->model->getItemsSearch($this->value, true);
if ($p_ids) {
$affected_rows = true;
}
if (!$cat_search) {
$cat_search = $this->model->getCatSearch($this->model->_correct_string);
}
if (!$manufacture_search) {
$manufacture_search = $this->model->getManufactureSearch($this->model->_correct_string);
}
if ($this->ajax_search) {
$relevant_search = $this->model->getRelevantSearches($this->model->_correct_string);
}
if ($affected_rows) {
if (!$cat_search) {
if (!is_numeric($this->model->_correct_string)) {
$this->model->setRelevants($this->model->_correct_string);
}
}
}
}
if (!empty($results)) {
//$results = $this->model->setImages($results);
//echo $this->model->generateSearchResult($results);
}
if (!empty($cat_search)) {
foreach ($cat_search as $key => $item) {
$item->product_total = $this->model->getProductTotalCategory($item->cat_id);
if (!$item->product_total) {
unset($cat_search[$key]);
}
}
sort($cat_search);
}
$mids = array();
if (!empty($manufacture_search)) {
foreach ($manufacture_search as $key => $item) {
$mids[$item->id] = $item->id;
$item->product_total = $this->model->getProductTotalManufacture($item->id);
if (!$item->product_total) {
unset($manufacture_search[$key]);
}
}
sort($manufacture_search);
}
$manufacture_products = $this->model->getProductManufacturs($mids);
$p_ids = array_merge($p_ids, $manufacture_products);
if ($this->ajax_search) {
if (!empty($relevant_search)) {
foreach ($relevant_search as $key => $item) {
$item->product_total = $this->model->getCountRelevantsResult($item->title);
if (!$item->product_total) {
unset($relevant_search[$key]);
}
}
sort($relevant_search);
}
$this->assign('relevant_search', $relevant_search);
}
$products = $this->model->getProductsObject($p_ids);
$this->assignRef('cat_search', $cat_search);
$this->assignRef('manufacture_search', $manufacture_search);
$this->assignRef('products', $products);
$this->assignRef('shop_id', $Itemid);
}
return false;
}
示例14: make_tree
private function make_tree($category, $level = 1, $params)
{
if (isset($category->children) && !empty($category->children)) {
$categories = $params->get('categories', array());
$children = array_keys($category->children);
$intersect = array_intersect($children, $categories);
$filter = count($intersect) ? true : false;
foreach ($category->children as $key => $child) {
if ($filter && !in_array($key, $categories)) {
unset($category->children[$key]);
continue;
}
$child->level = $level;
$child->deeper = false;
$child->shallower = false;
$child->level_diff = 0;
$child->link = JRoute::_('index.php?option=com_ksenmart&view=catalog&categories[0]=' . $child->id . '&Itemid=' . KSSystem::getShopItemid());
if (isset($this->tree[count($this->tree) - 1])) {
$this->tree[count($this->tree) - 1]->deeper = $child->level > $this->tree[count($this->tree) - 1]->level;
$this->tree[count($this->tree) - 1]->shallower = $child->level < $this->tree[count($this->tree) - 1]->level;
$this->tree[count($this->tree) - 1]->level_diff = $this->tree[count($this->tree) - 1]->level - $child->level;
}
$this->tree[] = $child;
if (isset($this->tree[count($this->tree) - 1])) {
$this->tree[count($this->tree) - 1]->deeper = 1 > $this->tree[count($this->tree) - 1]->level;
$this->tree[count($this->tree) - 1]->shallower = 1 < $this->tree[count($this->tree) - 1]->level;
$this->tree[count($this->tree) - 1]->level_diff = $this->tree[count($this->tree) - 1]->level - 1;
}
$this->make_tree($this->menu[$child->id], $level + 1, $params);
}
}
}
示例15: getAddToCartLink
public static function getAddToCartLink()
{
$params = JComponentHelper::getParams('com_ksenmart');
$Itemid = KSSystem::getShopItemid();
if ($params->get('order_process', 0) == 1) {
$session = JFactory::getSession();
$order_id = $session->get('shop_order_id', 0);
if ($order_id == 0) {
$add_link_cart = JRoute::_('index.php?option=com_ksenmart&view=order&Itemid=' . $Itemid);
} else {
$add_link_cart = JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . $Itemid);
}
} else {
$add_link_cart = JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . $Itemid);
}
return $add_link_cart;
}