Search the Community
Showing results for tags 'viewedproducts'.
-
Will be suitable for those who has removed the seen goods from columns and wants to bring them only in a footer of products (where goods in this category there). For a start we need to disconnect the module from excess hook in arrangements of modules (displayleftcolumn и displayrightcolumn). further we come in blockviewed. php ( public_html/modules/blockviewed) and insert this code: public function hookProductFooter($params){return $this->hookRightColumn($params);} we save file and attach the module to the created Hook. Further in the same folder we change blockviewed. tpl and blockviewed. css for files which I have attached (blockviewed1. tpl и blockviewed1. css). further we come in public_html/themes/default-bootstrap/modules/blockviewed and change blockviewed. tpl for file i have attached blockviewed2. tpl. the following step, we come in public_html/themes/default-bootstrap/css/modules/blockviewed and change file blockviewed. css for file i have attached blockviewed2. css. we go to settings of the module and we put for example goods 12. we clean a cache and everything is ready. what turns out as a result: we have 12 seen goods with a slider to the left to the right. blockviewedfiles.zip
-
- productpage
- design
-
(and 3 more)
Tagged with:
-
How should I set the Hooks in blockviewed.php to appear listed in my Cshometab. I know that after I set the TabClass.php in cshometab module... What I have done ... : BlockViewed.php: .... public function hookdisplayHomeTabContent($params) { } public function hookdisplayHomeTab($params) { }.... TabClass.php ..... elseif(strpos($this->product_type, "products_viewed") !== false) { unset($this->product_list); /*$this->product_list = BlockViewed::getProductsViewed((int)($cookie->id_lang), 0, $nb); $link=new Link(); $this->view_more= '';*/ $productsViewed = (isset($cookie->viewed) && !empty($cookie->viewed)) ? array_slice(array_reverse(explode(',', $cookie->viewed)), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); if (count($productsViewed)) { $defaultCover = Language::getIsoById($cookie->id_lang).'-default'; $productIds = implode(',', array_map('intval', $productsViewed)); $count = count($productsViewed); for($i = 0; $i < $count; $i++){ $productsImages[] = Db::getInstance()->getRow(' SELECT MAX(image_shop.id_image) id_image, p.*, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite FROM '._DB_PREFIX_.'product p '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.' LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product = p.id_product)'. Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = image_shop.id_image AND il.id_lang = '.(int)($cookie->id_lang).') LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').') WHERE p.id_product = '.$productsViewed[$i].' AND pl.id_lang = '.(int)($cookie->id_lang).' AND cl.id_lang = '.(int)($cookie->id_lang).' GROUP BY product_shop.id_product' ); } $productsImagesArray = array(); foreach ($productsImages as $pi){ $productsImagesArray[$pi['id_product']] = $pi; $productsImagesArray[$pi['id_product']]['link'] = _PS_BASE_URL_.__PS_BASE_URI__.$pi['category_rewrite'].'/'.$pi['link_rewrite'].'-'.$pi['id_product'].'.html'; $productsImagesArray[$pi['id_product']]['quantity_all_versions'] = $pi['quantity']; $productsImagesArray[$pi['id_product']]['allow_oosp'] = Product::isAvailableWhenOutOfStock($pi['out_of_stock']); $productsImagesArray[$pi['id_product']]['reduction'] = Product::getPriceStatic((int)$pi['id_product'],(bool)$usetax,(int)$PI['id_product_attribute'], 6,null,true,true,1,true,null,null,null,$specific_prices); $productsImagesArray[$pi['id_product']]['specific_prices'] = $specific_prices; $ipa_default = Product::getDefaultAttribute($pi['id_product']); $productsImagesArray[$pi['id_product']]['id_product_attribute'] = $ipa_default; //echo "<br><br><br>".$ipa_default."<br><br><br>"; $productsImagesArray[$pi['id_product']]['price_without_reduction'] = Product::getPriceStatic((int)$pi['id_product'],false, ((isset($ipa_default) && !empty($ipa_default)) ? (int)$ipa_default : null),2,null,false,false); } $this->productsViewed = count($productsViewed); //var_dump($productsImagesArray); foreach($productsImagesArray as $item) $this->product_list[] = $item; //var_dump($this->product_list); } } .... This almost ready , just do not know how to set the hooks , someone give me a light?
- 2 replies
-
- configurehooks
- hooks
-
(and 2 more)
Tagged with: