Example #1
0
require_once PAGEPATH . "shop_browse_queries.php";
$db_browse->query($count);
$num_rows = $db_browse->f("num_rows");
if ($limitstart > 0 && $limit >= $num_rows) {
    $list = str_replace('LIMIT ' . $limitstart, 'LIMIT 0', $list);
}
if ($category_id) {
    /**
     * CATEGORY DESCRIPTION
     */
    $db->query("SELECT category_id, category_name FROM #__{vm}_category WHERE category_id='{$category_id}'");
    $db->next_record();
    $category_name = shopMakeHtmlSafe($db->f('category_name'));
    /* Set Dynamic Page Title */
    $mainframe->setPageTitle($db->f("category_name"));
    $desc = $ps_product_category->get_description($category_id);
    $desc = vmCommonHTML::ParseContentByPlugins($desc);
    /* Prepend Product Short Description Meta Tag "description" when applicable */
    $mainframe->prependMetaTag("description", substr(strip_tags($desc), 0, 255));
}
// when nothing has been found we tell this here and say goodbye
if ($num_rows == 0 && (!empty($keyword) || !empty($keyword1))) {
    echo $VM_LANG->_('PHPSHOP_NO_SEARCH_RESULT');
} elseif ($num_rows == 0 && empty($product_type_id) && !empty($child_list)) {
    echo $VM_LANG->_('EMPTY_CATEGORY');
} elseif ($num_rows == 1 && (!empty($keyword) || !empty($keyword1))) {
    // If just one product has been found, we directly show the details page of it
    $db_browse->query($list);
    $db_browse->next_record();
    $flypage = $db_browse->sf("category_flypage") ? $db_browse->sf("category_flypage") : FLYPAGE;
    $url_parameters = "page=shop.product_details&flypage={$flypage}&product_id=" . $db_browse->f("product_id") . "&category_id=" . $db_browse->f("category_id");