Ejemplo n.º 1
0
/**
 * Categories map
 */
require 'header.php';
$GLOBALS['current_category'] = -1;
$xoopsOption['template_main'] = 'myshop_map.html';
require_once XOOPS_ROOT_PATH . '/header.php';
require_once MYSHOP_PATH . 'class/tree.php';
$xoopsTpl->assign('mod_pref', $mod_pref);
$categories = array();
$categories = $h_myshop_cat->getAllCategories();
$mytree = new Myshop_XoopsObjectTree($categories, 'cat_cid', 'cat_pid');
$tree = $mytree->makeTreeAsArray('cat_title', '-');
foreach ($tree as $key => $value) {
    if (isset($categories[$key])) {
        $category = $categories[$key];
        $xoopsTpl->append('categories', array('cat_url_rewrited' => $category->getLink(), 'cat_href_title' => $category->getHrefTitle(), 'cat_title' => $value));
    }
}
myshop_utils::setCSS();
if (file_exists(MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php')) {
    require_once MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php';
} else {
    require_once MYSHOP_PATH . 'language/english/modinfo.php';
}
$xoopsTpl->assign('global_advert', myshop_utils::getModuleOption('advertisement'));
$xoopsTpl->assign('breadcrumb', myshop_utils::breadcrumb(array(MYSHOP_URL . basename(__FILE__) => _MI_MYSHOP_SMNAME4)));
$title = _MI_MYSHOP_SMNAME4 . ' - ' . myshop_utils::getModuleName();
myshop_utils::setMetas($title, $title);
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 2
0
Archivo: cgv.php Proyecto: naao/myshop
<?php

/**
 * conditions
 */
require 'header.php';
$GLOBALS['current_category'] = -1;
$xoopsOption['template_main'] = 'myshop_cgv.html';
require_once XOOPS_ROOT_PATH . '/header.php';
require_once MYSHOP_PATH . 'class/registryfile.php';
$registry = new myshop_registryfile();
$xoopsTpl->assign('nostock_msg', myshop_utils::getModuleOption('nostock_msg'));
$xoopsTpl->assign('mod_pref', $mod_pref);
$xoopsTpl->assign('cgv_msg', $registry->getfile(MYSHOP_TEXTFILE2));
$xoopsTpl->assign('global_advert', myshop_utils::getModuleOption('advertisement'));
$xoopsTpl->assign('breadcrumb', myshop_utils::breadcrumb(array(MYSHOP_URL . basename(__FILE__) => _MYSHOP_CGV)));
myshop_utils::setCSS();
myshop_utils::setMetas(_MYSHOP_CGV . ' ' . myshop_utils::getModuleName(), _MYSHOP_CGV . ' ' . myshop_utils::getModuleName());
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 3
0
// VAT
$vatArray = $h_myshop_vat->getAllVats();
// Products
$xoopsTpl->assign('total_products_count', sprintf(_MYSHOP_THEREARE, $h_myshop_products->getTotalPublishedProductsCount()));
if ($limit > 0) {
    $itemsCount = $h_myshop_products->getRecentProductsCount();
    if ($itemsCount > $limit) {
        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        $pagenav = new XoopsPageNav($itemsCount, $limit, $start);
        $xoopsTpl->assign('pagenav', $pagenav->renderNav());
    }
    $myshop_shelf_parameters->resetDefaultValues()->setProductsType('recent')->setStart($start)->setLimit($limit)->setSort('product_submitted DESC, product_title')->setWithXoopsUser(true)->setWithRelatedProducts(true);
    $products = $myshop_shelf->getProducts($myshop_shelf_parameters);
    if (isset($products['lastTitle'])) {
        $lastTitle = strip_tags($products['lastTitle']);
        unset($products['lastTitle']);
    }
    $xoopsTpl->assign('products', $products);
}
// Parent category
$count = 1;
$categories = $h_myshop_cat->getMotherCategories();
foreach ($categories as $category) {
    $tmp = $category->toArray();
    $tmp['count'] = $count;
    $xoopsTpl->append('categories', $tmp);
    $count++;
}
myshop_utils::setCSS();
myshop_utils::setMetas($lastTitle . ' - ' . myshop_utils::getModuleName(), myshop_utils::getModuleName());
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 4
0
    $tbl_tmp[] = "<a href='" . MYSHOP_URL . "index.php' title='" . myshop_utils::makeHrefTitle(myshop_utils::getModuleName()) . "'>" . myshop_utils::getModuleName() . '</a>';
    foreach ($ancestors as $item) {
        $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . myshop_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
    }
    // Add current category
    $tbl_tmp[] = "<a href='" . $category->getLink() . "' title='" . myshop_utils::makeHrefTitle($category->getVar('cat_title')) . "'>" . $category->getVar('cat_title') . '</a>';
    $breadcrumb = implode(' &raquo; ', $tbl_tmp);
    $xoopsTpl->assign('breadcrumb', $breadcrumb);
    // Meta
    $title = strip_tags($breadcrumb);
    if (!myshop_utils::getModuleOption('manual_meta')) {
        myshop_utils::setMetas($title, $title, str_replace('&raquo;', ',', $title));
    } else {
        $pageTitle = xoops_trim($category->getVar('cat_metatitle')) == '' ? $title : $category->getVar('cat_metatitle');
        $metaDescription = xoops_trim($category->getVar('cat_metadescription')) != '' ? $category->getVar('cat_metadescription') : $title;
        $metaKeywords = xoops_trim($category->getVar('cat_metakeywords'));
        myshop_utils::setMetas($pageTitle, $metaDescription, $metaKeywords);
    }
    // Products Data
    $products = array();
    $myshop_shelf_parameters->resetDefaultValues()->setProductsType('recent')->setCategory($cat_cid)->setStart($start)->setLimit($limit)->setSort('product_submitted DESC, product_title');
    $products = $myshop_shelf->getProducts($myshop_shelf_parameters);
    if (count($products) > 0) {
        if (isset($products['lastTitle'])) {
            unset($products['lastTitle']);
        }
        $xoopsTpl->assign('products', $products);
    }
}
myshop_utils::setCSS();
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 5
0
            $xoopsTpl->assign('bestwith', $tmp);
        }
    }
}
// Product vote
if (myshop_utils::getModuleOption('rateproducts') == 1) {
    $canRate = true;
    if ($currentUser != 0) {
        $canRate = $h_myshop_votedata->hasUserAlreadyVoted($currentUser, $product->getVar('product_id'));
    } else {
        $canRate = $h_myshop_votedata->hasAnonymousAlreadyVoted('', $product->getVar('product_id'));
    }
    $xoopsTpl->assign('userCanRate', $canRate);
}
// Meta et CSS
myshop_utils::setCSS();
if (myshop_utils::getModuleOption('manual_meta')) {
    $pageTitle = xoops_trim($product->getVar('product_metatitle')) == '' ? $title : $product->getVar('product_metatitle');
    $metaDescription = xoops_trim($product->getVar('product_metadescription')) != '' ? $product->getVar('product_metadescription') : $title;
    $metaKeywords = xoops_trim($product->getVar('product_metakeywords')) != '' ? $product->getVar('product_metakeywords') : myshop_utils::createMetaKeywords($product->getVar('product_title') . ' ' . $product->getVar('product_summary') . ' ' . $product->getVar('product_description'));
    myshop_utils::setMetas($pageTitle, $metaDescription, $metaKeywords);
} else {
    myshop_utils::setMetas($title, $title, myshop_utils::createMetaKeywords($product->getVar('product_title') . ' ' . $product->getVar('product_summary') . ' ' . $product->getVar('product_description')));
}
if (!isset($_GET['op'])) {
    require_once XOOPS_ROOT_PATH . '/include/comment_view.php';
    require_once XOOPS_ROOT_PATH . '/footer.php';
} elseif (isset($_GET['op']) && $_GET['op'] == 'print') {
    $xoopsTpl->display('db:myshop_product.html');
    xoops_footer();
}
Ejemplo n.º 6
0
    $tmp = $categories = array();
    foreach ($products as $product) {
        $tmp[] = $product->getVar('product_cid');
    }
    $tmp = array_unique($tmp);
    sort($tmp);
    if (count($tmp) > 0) {
        $categories = $h_myshop_cat->getCategoriesFromIds($tmp);
    }
    $cpt = 1;
    foreach ($products as $product) {
        $productForTemplate = array();
        $productForTemplate = $product->toArray();
        $productForTemplate['count'] = $cpt;
        $productForTemplate['product_category'] = isset($categories[$product->getVar('product_cid')]) ? $categories[$product->getVar('product_cid')]->toArray() : null;
        $xoopsTpl->append('products', $productForTemplate);
        $cpt++;
    }
}
myshop_utils::setCSS();
if (file_exists(MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php')) {
    require_once MYSHOP_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php';
} else {
    require_once MYSHOP_PATH . 'language/english/modinfo.php';
}
$xoopsTpl->assign('global_advert', myshop_utils::getModuleOption('advertisement'));
$breadcrumb = array(MYSHOP_URL . 'whoswho.php' => _MYSHOP_MANUFACTURERS, MYSHOP_URL . basename(__FILE__) => $manufacturer->getVar('manu_name') . ' ' . $manufacturer->getVar('manu_commercialname'));
$xoopsTpl->assign('breadcrumb', myshop_utils::breadcrumb($breadcrumb));
$title = $manufacturer->getVar('manu_name') . ' ' . $manufacturer->getVar('manu_commercialname') . ' - ' . myshop_utils::getModuleName();
myshop_utils::setMetas($title, $title, myshop_utils::createMetaKeywords($manufacturer->getVar('manu_name') . ' ' . $manufacturer->getVar('manu_commercialname') . ' ' . $manufacturer->getVar('manu_bio')));
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 7
0
    if (isset($_POST['product_stores'])) {
        $stores = intval($_POST['product_stores']);
        if ($stores > 0) {
            $sql .= ' AND product_store_id = ' . $stores;
        }
    }
    $sql .= ' GROUP BY b.product_id ORDER BY product_submitted DESC';
    $result = $xoopsDB->query($sql);
    $ret = array();
    $tempProduct = $h_myshop_products->create(true);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $ret = array();
        $ret['link'] = $tempProduct->getLink($myrow['product_id'], $myrow['product_title']);
        $ret['title'] = $myts->htmlSpecialChars($myrow['product_title']);
        $ret['href_title'] = myshop_utils::makeHrefTitle($myts->htmlSpecialChars($myrow['product_title']));
        $ret['time'] = $myrow['product_submitted'];
        $ret['uid'] = $myrow['product_submitter'];
        $xoopsTpl->append('products', $ret);
    }
    unset($tempProduct);
} else {
    $xoopsTpl->assign('search_results', false);
    $xoopsTpl->assign('global_advert', myshop_utils::getModuleOption('advertisement'));
    $xoopsTpl->assign('breadcrumb', myshop_utils::breadcrumb(array(MYSHOP_URL . basename(__FILE__) => _MYSHOP_SEARCHFOR)));
    myshop_utils::setMetas(myshop_utils::getModuleName() . ' - ' . _MYSHOP_SEARCHFOR, myshop_utils::getModuleName() . ' - ' . _MYSHOP_SEARCHFOR);
}
require_once MYSHOP_PATH . 'include/product_search_form.php';
$sform = myshop_utils::formMarkRequiredFields($sform);
$xoopsTpl->assign('search_form', $sform->render());
myshop_utils::setCSS();
require_once XOOPS_ROOT_PATH . '/footer.php';
Ejemplo n.º 8
0
// script URL
$myshop_Currency =& myshop_Currency::getInstance();
$registry = new myshop_registryfile();
// VAT
$vatArray = array();
$vatArray = $h_myshop_vat->getAllVats();
// Template options
$xoopsTpl->assign('nostock_msg', myshop_utils::getModuleOption('nostock_msg'));
$xoopsTpl->assign('mod_pref', $mod_pref);
$xoopsTpl->assign('welcome_msg', nl2br($registry->getfile(MYSHOP_TEXTFILE3)));
// Total products in DB
$itemsCount = $h_myshop_products->getRecommendedCount();
if ($itemsCount > $limit) {
    $pagenav = new XoopsPageNav($itemsCount, $limit, $start);
    $xoopsTpl->assign('pagenav', $pagenav->renderNav());
}
if ($limit > 0) {
    // Recent products
    $myshop_shelf_parameters->resetDefaultValues()->setProductsType('recommended')->setStart($start)->setLimit($limit)->setSort('product_recommended')->setOrder('DESC')->setCategory(0)->setWithXoopsUser(true)->setWithRelatedProducts(true);
    $products = $myshop_shelf->getProducts($myshop_shelf_parameters);
    if (isset($products['lastTitle'])) {
        $lastTitle = strip_tags($products['lastTitle']);
        unset($products['lastTitle']);
    }
    $xoopsTpl->assign('products', $products);
}
$xoopsTpl->assign('global_advert', myshop_utils::getModuleOption('advertisement'));
$xoopsTpl->assign('breadcrumb', myshop_utils::breadcrumb(array(MYSHOP_URL . basename(__FILE__) => _MYSHOP_RECOMMENDED)));
myshop_utils::setCSS();
myshop_utils::setMetas(_MYSHOP_RECOMMENDED . ' - ' . myshop_utils::getModuleName(), myshop_utils::getModuleName());
require_once XOOPS_ROOT_PATH . '/footer.php';