Example #1
0
 /**
  * Shows the Number of Products in category $category_id
  *
  * @param int $category_id
  * @return string The number in brackets
  */
 function products_in_category($category_id)
 {
     if (PSHOP_SHOW_PRODUCTS_IN_CATEGORY == '1' || vmIsAdminMode()) {
         $num = ps_product_category::product_count($category_id);
         if (empty($num) && ps_product_category::has_childs($category_id)) {
             $db = new ps_DB();
             $q = "SELECT category_child_id FROM #__{vm}_category_xref ";
             $q .= "WHERE category_parent_id='{$category_id}' ";
             $db->query($q);
             while ($db->next_record()) {
                 $num += ps_product_category::product_count($db->f("category_child_id"));
             }
         }
         return " ({$num}) ";
     } else {
         return "";
     }
 }
Example #2
0
if ($parent_id_link != 0) {
    $q = "SELECT product_name FROM #__{vm}_product WHERE product_id = '{$product_parent_id}' LIMIT 0,1";
    $db->query($q);
    $db->next_record();
    $product_parent_name = $db->f("product_name");
    $return_link = "&nbsp;<a class=\"pathway\" href=\"";
    $return_link .= $sess->url($_SERVER['PHP_SELF'] . "?page=shop.product_details&product_id={$parent_id_link}");
    $return_link .= "\">";
    $return_link .= $product_parent_name;
    $return_link .= "</a>";
    $return_link .= " " . vmCommonHTML::pathway_separator() . " ";
}
$tpl->set('return_link', $return_link);
// Create the pathway for our template
$navigation_pathway = $tpl->fetch('common/pathway.tpl.php');
if ($ps_product_category->has_childs($category_id)) {
    $category_childs = $ps_product_category->get_child_list($category_id);
    $tpl->set('categories', $category_childs);
    $navigation_childlist = $tpl->fetch('common/categoryChildlist.tpl.php');
}
// Set Dynamic Page Title
if (function_exists('mb_substr')) {
    $page_title = mb_substr($product_name, 0, 64, vmGetCharset());
} else {
    $page_title = substr($product_name, 0, 64);
}
$vm_mainframe->setPageTitle(@html_entity_decode($page_title, ENT_QUOTES, vmGetCharset()));
// Prepend Product Short Description Meta Tag "description"
if (vmIsJoomla('1.5')) {
    $document = JFactory::getDocument();
    $document->setDescription(strip_tags($db_product->f("product_s_desc")));