Example #1
0
if ($db->num_rows() > 0) {
    $tpl->set('ps_product', $ps_product);
    $tpl->set('products', $db);
    $related_products = $tpl->fetch('/common/relatedProducts.tpl.php');
}
// GET THE PRODUCT NAME
$product_name = shopMakeHtmlSafe($db_product->f("product_name"));
if ($db_product->f("product_publish") == "N") {
    $product_name .= " (" . $VM_LANG->_('CMN_UNPUBLISHED') . ")";
}
$product_description = $db_product->f("product_desc");
if (str_replace("<br />", "", $product_description) == '' && $product_parent_id != 0) {
    $product_description = $dbp->f("product_desc");
    // Use product_desc from Parent Product
}
$product_description = vmCommonHTML::ParseContentByPlugins($product_description);
// Get the CATEGORY NAVIGATION
$navigation_pathway = "";
$navigation_childlist = "";
$pathway_appended = false;
$flypage = vmGet($_REQUEST, "flypage");
// Each Product is assigned to one or more Categories, if category_id was omitted, we must fetch it here
if (empty($category_id) || empty($flypage)) {
    $q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '{$product_id}' AND c.category_id=cx.category_id LIMIT 0,1";
    $db->query($q);
    $db->next_record();
    if (!$db->f("category_id")) {
        // The Product Has no category entry and must be a Child Product
        // So let's get the Parent Product
        $q = "SELECT product_id FROM #__{vm}_product WHERE product_id = '" . $db_product->f("product_parent_id") . "' LIMIT 0,1";
        $db->query($q);
Example #2
0
$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&amp;flypage={$flypage}&amp;product_id=" . $db_browse->f("product_id") . "&amp;category_id=" . $db_browse->f("category_id");
    vmRedirect($sess->url($url_parameters, true, false));
Example #3
0
<?php

if (!defined('_VALID_MOS') && !defined('_JEXEC')) {
    die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');
}
?>

<?php 
defined('vmToolTipCalled') or define('vmToolTipCalled', 1);
echo $vendor_store_desc = vmCommonHTML::ParseContentByPlugins($vendor_store_desc) . "<br />";
echo "<br /><h4>" . $VM_LANG->_('PHPSHOP_CATEGORIES') . "</h4>";
echo $categories;
?>
<div class="vmRecent">
<?php 
echo $recent_products;
?>
</div>
<?php 
// Show Featured Products
if ($this->get_cfg('showFeatured', 1)) {
    /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
       edit featuredproduct.tpl.php to edit layout */
    echo $ps_product->featuredProducts(true, 10, false);
}
// Show Latest Products
if ($this->get_cfg('showlatest', 1)) {
    /* latestproducts(random, no_of_products,month_based,category_based) no_of_products 0 = all else numeric amount
       edit latestproduct.tpl.php to edit layout */
    ps_product::latestProducts(true, 10, false, false);
}