?> <?php if ($params->get('item_readmore_display') == 1) { ?> <div class="item-readmore"> <a href="<?php echo $item->link; ?> " title="<?php echo $item->title; ?> " <?php echo SjVMSuperCategoriesHelper::parseTarget($params->get('link_target')); ?> > <?php echo $params->get('item_readmore_text', 'Read More'); ?> </a> </div> <?php } ?> </div> </div> <?php if ($params->get('type_show') == 'slider' && ($i % $params->get('nb_rows') == 0 || $i == $count)) {
if ($params->get('category_sub_title_display', 1) && count($list['category_tree']) > 1) { ?> <div class="cat_slider_title"> <a href="<?php echo $cat_tree->link; ?> " title="<?php echo $cat_tree->category_name; ?> " <?php echo SjVMSuperCategoriesHelper::parseTarget($params->get('target')); ?> > <?php echo SjVMSuperCategoriesHelper::truncate($cat_tree->category_name, $params->get('category_sub_title_max_characs', 25)); ?> </a> </div> <?php } ?> </div> </div> <?php } ?> </div> <?php
if ($spcat_module_id == $module->id) { $result = new stdClass(); ob_start(); $catids = JRequest::getVar('categoryid'); $order = JRequest::getVar('fieldorder', null); $loadmore = JRequest::getVar('load_more', 0); $orderdir = $params->get('product_ordering_direction', 'ASC'); $tag_id = $params->get('tag_id'); $limit_start = JRequest::getVar('ajax_limit_start', 0); $limit = $params->get('count_products', 5); $filters['categorys'] = explode(', ', $catids); if ($loadmore == 1) { $child_items = SjVMSuperCategoriesHelper::_getProductInforLoadMore('*', $params, $order, $limit_start, $limit, $orderdir); } else { $child_items = SjVMSuperCategoriesHelper::_getProductInfor('*', $params, $order); } require JModuleHelper::getLayoutPath($module->module, $layout . '_items'); $buffer = ob_get_contents(); $result->items_markup = preg_replace(array('/ {2,}/', '/<!--.*?-->|\\t|(?:\\r?\\n[ \\t]*)+/s'), array(' ', ''), $buffer); ob_end_clean(); die(json_encode($result)); } } else { if ($params->get('catid') != NULL) { $list = SjVMSuperCategoriesHelper::getList($params); require JModuleHelper::getLayoutPath($module->module, $layout); require JModuleHelper::getLayoutPath($module->module, $layout . '_js'); } else { echo 'Has no item to show'; } }
<?php foreach ($list['tab'] as $key => $tab) { ?> <li class="spcat-tab <?php echo isset($tab->sel) ? ' tab-sel tab-loaded' : ''; ?> " data-active-content=".items-category-<?php echo $tab->_odering; ?> " data-field_order="<?php echo $tab->_odering; ?> " > <span class="spcat-tab-label"> <?php echo SjVMSuperCategoriesHelper::truncate($tab->title, $params->get('tab_max_characters')); ?> </span> </li> <?php } ?> </ul> </div> <?php }
/** * Override function getCategories in model Category */ public static function getCategories($onlyPublished = true, $parentId = false, $childId = false, $keyword = "", $vendorId = false) { $categoryModel = VmModel::getModel('Category'); $select = ' c.`virtuemart_category_id`, l.`category_description`, l.`category_name`, c.`ordering`, c.`published`, cx.`category_child_id`, cx.`category_parent_id`, c.`shared` '; $joinedTables = ' FROM `#__virtuemart_categories_' . VmConfig::$vmlang . '` l JOIN `#__virtuemart_categories` AS c using (`virtuemart_category_id`) LEFT JOIN `#__virtuemart_category_categories` AS cx ON l.`virtuemart_category_id` = cx.`category_child_id` '; $where = array(); if ($onlyPublished) { $where[] = " c.`published` = 1 "; } if ($parentId !== false) { $where[] = ' cx.`category_parent_id` = ' . (int) $parentId; } if ($childId !== false) { $where[] = ' cx.`category_child_id` = ' . (int) $childId; } if ($vendorId === false) { $vendorId = VmConfig::isSuperVendor(); } if ($vendorId == 1) { $where[] = ' (c.`virtuemart_vendor_id` = "' . (int) $vendorId . '" OR c.`shared` = "1") '; } if (!empty($keyword)) { $db = JFactory::getDBO(); $keyword = '"%' . $db->escape($keyword, true) . '%"'; //$keyword = $db->Quote($keyword, false); $where[] = ' ( l.`category_name` LIKE ' . $keyword . ' OR l.`category_description` LIKE ' . $keyword . ') '; } $whereString = ''; if (count($where) > 0) { $whereString = ' WHERE ' . implode(' AND ', $where); } else { $whereString = 'WHERE 1 '; } $ordering = $categoryModel->_getOrdering(); self::$_category_tree = $categoryModel->exeSortSearchListQuery(0, $select, $joinedTables, $whereString, 'GROUP BY virtuemart_category_id', $ordering); return self::$_category_tree; }