$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(); }
$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';