/** Virtuemart support */
 function &getCategoryTree(&$xmap, &$parent, &$params, $catid = 0)
 {
     $database =& JFactory::getDBO();
     $mosConfig_absolute_path = JPATH_SITE;
     $query = "SELECT a.category_id, a.category_name, a.mdate,a.category_flypage " . "\n FROM #__vm_category AS a, #__vm_category_xref AS b " . "\n WHERE a.category_publish='Y' " . "\n AND b.category_parent_id = {$catid} " . "\n AND a.category_id=b.category_child_id " . "\n ORDER BY a.list_order ASC, a.category_name ASC";
     $database->setQuery($query);
     $rows = $database->loadObjectList();
     $xmap->changeLevel(1);
     foreach ($rows as $row) {
         $node = new stdclass();
         $node->id = $parent->id;
         $node->uid = $parent->uid . 'c' . $row->category_id;
         $node->browserNav = $parent->browserNav;
         $node->name = stripslashes($row->category_name);
         $node->modified = intval($row->mdate);
         $node->priority = $params['cat_priority'];
         $node->changefreq = $params['cat_changefreq'];
         $node->expandible = true;
         $node->link = $parent->link . '&page=shop.browse&category_id=' . $row->category_id . '&Itemid=' . $params['Itemid'];
         if ($xmap->printNode($node) !== FALSE) {
             xmap_com_virtuemart::getCategoryTree($xmap, $parent, $params, $row->category_id);
         }
     }
     $xmap->changeLevel(-1);
     if ($params['include_products']) {
         $query = "SELECT a.product_id, a.product_name,a.mdate, b.category_id,d.category_flypage " . "\n FROM #__vm_product AS a, #__vm_product_category_xref AS b, #__vm_category d" . "\n WHERE a.product_publish='Y'" . "\n AND b.category_id={$catid} " . "\n AND a.product_parent_id=0 " . "\n AND a.product_id=b.product_id " . "\n AND b.category_id=d.category_id " . "\n ORDER BY a.product_name";
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $xmap->changeLevel(1);
         foreach ($rows as $row) {
             $node = new stdclass();
             $node->id = $parent->id;
             $node->uid = $parent->uid . 'c' . $row->category_id . 'p' . $row->product_id;
             $node->browserNav = $parent->browserNav;
             $node->priority = $params['prod_priority'];
             $node->changefreq = $params['prod_changefreq'];
             $node->name = $row->product_name;
             $node->modified = intval($row->mdate);
             $node->expandible = false;
             $node->link = 'index.php?option=com_virtuemart&page=shop.product_details&flypage=' . ($row->category_flypage ? $row->category_flypage : FLYPAGE) . '&category_id=' . $row->category_id . '&product_id=' . $row->product_id . '&Itemid=' . $params['Itemid'];
             $xmap->printNode($node);
         }
         $xmap->changeLevel(-1);
     }
     return $list;
 }
Ejemplo n.º 2
0
 protected static function initialize()
 {
     if (self::$initialized) {
         return;
     }
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
         VmConfig::loadConfig();
     }
     JTable::addIncludePath(JPATH_VM_ADMINISTRATOR . DS . 'tables');
     if (!class_exists('VirtueMartModelCategory')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'category.php';
     }
     self::$categoryModel = new VirtueMartModelCategory();
     if (!class_exists('VirtueMartModelProduct')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'product.php';
     }
     self::$productModel = new VirtueMartModelProduct();
 }
Ejemplo n.º 3
0
 protected static function initialize()
 {
     if (self::$initialized) {
         return;
     }
     $app = JFactory::getApplication();
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php';
         VmConfig::loadConfig();
     }
     JTable::addIncludePath(JPATH_VM_ADMINISTRATOR . '/tables');
     VmConfig::set('llimit_init_FE', 9000);
     $app->setUserState('com_virtuemart.htmlc-1.limit', 9000);
     $app->setUserState('com_virtuemart.htmlc0.limit', 9000);
     $app->setUserState('com_virtuemart.xmlc0.limit', 9000);
     if (!class_exists('VirtueMartModelCategory')) {
         require JPATH_VM_ADMINISTRATOR . '/models/category.php';
     }
     self::$categoryModel = new VirtueMartModelCategory();
     if (!class_exists('VirtueMartModelProduct')) {
         require JPATH_VM_ADMINISTRATOR . '/models/product.php';
     }
     self::$productModel = new VirtueMartModelProduct();
 }
Ejemplo n.º 4
0
 /** Virtuemart support */
 function &getCategoryTree(&$xmap, &$parent, &$params, $catid = 0)
 {
     $database =& JFactory::getDBO();
     global $sess;
     static $urlBase;
     if (!isset($urlBase)) {
         $urlBase = JURI::base();
     }
     $query = "SELECT a.category_id, a.category_name, a.mdate,a.category_flypage " . "\n FROM #__vm_category AS a, #__vm_category_xref AS b " . "\n WHERE a.category_publish='Y' " . "\n AND b.category_parent_id = {$catid} " . "\n AND a.category_id=b.category_child_id " . "\n ORDER BY a.list_order ASC, a.category_name ASC";
     $database->setQuery($query);
     $rows = $database->loadObjectList();
     $xmap->changeLevel(1);
     foreach ($rows as $row) {
         $node = new stdclass();
         $node->id = $params['Itemid'];
         $node->uid = $parent->uid . 'c' . $row->category_id;
         $node->browserNav = $parent->browserNav;
         $node->name = stripslashes($row->category_name);
         $node->modified = intval($row->mdate);
         $node->priority = $params['cat_priority'];
         $node->changefreq = $params['cat_changefreq'];
         $node->expandible = true;
         //$node->link = $parent->link.'&page=shop.browse&category_id='.$row->category_id.'&Itemid='.$params['Itemid'];
         $node->link = $sess->url("index.php?page=shop.browse&category_id=" . $row->category_id);
         if ($xmap->printNode($node) !== FALSE) {
             xmap_com_virtuemart::getCategoryTree($xmap, $parent, $params, $row->category_id);
         }
     }
     $xmap->changeLevel(-1);
     if ($params['include_products']) {
         $query = "SELECT a.product_id, a.product_name,a.mdate, a.product_thumb_image, a.product_full_image, b.category_id,d.category_flypage " . "\n FROM #__vm_product AS a, #__vm_product_category_xref AS b, #__vm_category d" . "\n WHERE a.product_publish='Y'" . "\n AND b.category_id={$catid} " . "\n AND a.product_parent_id=0 " . "\n AND a.product_id=b.product_id " . "\n AND b.category_id=d.category_id " . "\n ORDER BY a.product_name";
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $xmap->changeLevel(1);
         foreach ($rows as $row) {
             $node = new stdclass();
             $node->id = $params['Itemid'];
             $node->uid = $parent->uid . 'c' . $row->category_id . 'p' . $row->product_id;
             $node->browserNav = $parent->browserNav;
             $node->priority = $params['prod_priority'];
             $node->changefreq = $params['prod_changefreq'];
             $node->name = $row->product_name;
             $node->modified = intval($row->mdate);
             $node->expandible = false;
             $node->link = $sess->url("index.php?page=shop.product_details&flypage=" . ($row->category_flypage ? $row->category_flypage : FLYPAGE) . "&category_id=" . $row->category_id . '&product_id=' . $row->product_id);
             //$node->link = 'index.php?option=com_virtuemart&page=shop.product_details&flypage='.($row->category_flypage? $row->category_flypage : FLYPAGE).'&category_id='.$row->category_id . '&product_id=' . $row->product_id. '&Itemid='.$params['Itemid'];
             if ($params['include_product_images']) {
                 // Include the standard product image
                 if (isset($row->product_full_image) && $row->product_full_image != "") {
                     $image = new stdClass();
                     $image->src = $urlBase . "components/com_virtuemart/shop_image/product/" . $row->product_full_image;
                     $image->title = $row->product_name;
                     $image->license = $params['product_image_license_url'];
                     $node->images[] = $image;
                 }
                 // Include additional product images
                 $query = " SELECT file_name FROM #__vm_product_files WHERE file_product_id = ";
                 $query .= $row->product_id;
                 $database->setQuery($query);
                 $additional_images = $database->loadObjectList();
                 foreach ($additional_images as $additional_image) {
                     $image = new stdClass();
                     $image->src = $urlBase . $additional_image->file_name;
                     $image->title = $row->product_name;
                     $node->images[] = $image;
                 }
             }
             $xmap->printNode($node);
         }
         $xmap->changeLevel(-1);
     }
     return $list;
 }