Adilis Posted July 10, 2008 Share Posted July 10, 2008 Bonjour, quelqu'un saurait t'il comment faire apparaitre le prix TTC dans le bloc "déja vu".Le prix HT s'affiche sans problème, mais pas moyen d'arriver a avoir le TTCMerci beaucoup Link to comment Share on other sites More sharing options...
SLB-ECOMMERCE Posted July 11, 2008 Share Posted July 11, 2008 Bonjour,pourriez-vous placer ici le code que vous avez mis ?Cordialement.François Link to comment Share on other sites More sharing options...
Adilis Posted July 11, 2008 Author Share Posted July 11, 2008 J'utilise le module par defaut de la RC4, soit : function hookRightColumn($params) { global $link, $smarty; $id_product = intval(Tools::getValue('id_product')); if ($id_product) $product = new Product($id_product); $productsViewed = (isset($params['cookie']->viewed) AND !empty($params['cookie']->viewed)) ? array_slice(explode(',', $params['cookie']->viewed), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); if (sizeof($productsViewed)) { $productsViewedObj = array(); foreach ($productsViewed AS $productViewed) { $obj = new Product(intval($productViewed), false, intval($params['cookie']->id_lang)); if (!Validate::isLoadedObject($obj)) continue; else { $images = $obj->getImages(intval($params['cookie']->id_lang)); foreach ($images AS $k => $image) { if ($image['cover']) { $obj->cover = $obj->id.'-'.$image['id_image']; $obj->legend = $image['legend']; break; } } if (!isset($obj->cover)) { $obj->cover = Language::getIsoById($params['cookie']->id_lang).'-default'; $obj->legend = ''; } $productsViewedObj[] = $obj; } } if (isset($product) AND $product AND !in_array($product->id, $productsViewed)) array_unshift($productsViewed, $product->id); $viewed = ''; foreach ($productsViewed AS $id_product_viewed) $viewed .= intval($id_product_viewed).','; $params['cookie']->viewed = rtrim($viewed, ','); if (!sizeof($productsViewedObj)) return ; print_r($productsViewedObj); $smarty->assign('productsViewedObj', $productsViewedObj); return $this->display(__FILE__, 'blockviewed.tpl'); } elseif (isset($product) AND Validate::isLoadedObject($product)) $params['cookie']->viewed = intval($product->id); return ; } Lorsque je fait un print_r de $productsViewedObj je n'ai a aucun moment le pric TTC. Link to comment Share on other sites More sharing options...
FranWeb Posted July 11, 2008 Share Posted July 11, 2008 et si tu fais appel à la classe our_price_display ? tu devrais avoir le prix TTC Link to comment Share on other sites More sharing options...
Adilis Posted July 12, 2008 Author Share Posted July 12, 2008 Je n'ai pas trouvé la classe our_price_display, mais j'ai trouvé ma solution en regardant le module bestsellers function hookRightColumn($params) { global $link, $smarty; $id_product = intval(Tools::getValue('id_product')); if ($id_product) $product = new Product($id_product); $productsViewed = (isset($params['cookie']->viewed) AND !empty($params['cookie']->viewed)) ? array_slice(explode(',', $params['cookie']->viewed), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); if (sizeof($productsViewed)) { $productsViewedObj = array(); foreach ($productsViewed AS $productViewed) { $obj = new Product(intval($productViewed), false, intval($params['cookie']->id_lang)); if (!Validate::isLoadedObject($obj)) continue; else { $images = $obj->getImages(intval($params['cookie']->id_lang)); foreach ($images AS $k => $image) { if ($image['cover']) { $obj->cover = $obj->id.'-'.$image['id_image']; $obj->legend = $image['legend']; break; } } if (!isset($obj->cover)) { $obj->cover = Language::getIsoById($params['cookie']->id_lang).'-default'; $obj->legend = ''; } $obj->price = $obj->getPriceStatic(intval($productViewed)); $productsViewedObj[] = $obj; } } if (isset($product) AND $product AND !in_array($product->id, $productsViewed)) array_unshift($productsViewed, $product->id); $viewed = ''; foreach ($productsViewed AS $id_product_viewed) $viewed .= intval($id_product_viewed).','; $params['cookie']->viewed = rtrim($viewed, ','); if (!sizeof($productsViewedObj)) return ; $smarty->assign('productsViewedObj', $productsViewedObj); return $this->display(__FILE__, 'blockviewed.tpl'); } elseif (isset($product) AND Validate::isLoadedObject($product)) $params['cookie']->viewed = intval($product->id); return ; } La solution est dans le rajout de la ligne : $obj->price = $obj->getPriceStatic(intval($productViewed)); Merci encore, et vive Presta. Link to comment Share on other sites More sharing options...
FranWeb Posted July 12, 2008 Share Posted July 12, 2008 Donc ton problème est résolu ? Link to comment Share on other sites More sharing options...
Adilis Posted July 12, 2008 Author Share Posted July 12, 2008 yep, merci Link to comment Share on other sites More sharing options...
FranWeb Posted July 14, 2008 Share Posted July 14, 2008 merci à toi pour avoir remonter la soluce Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now