snco Posted March 26, 2010 Share Posted March 26, 2010 Hello,I want to display the price for products in 'Viewed products block', as it is displayed for special products in the 'Specials block'.Can anyone help with this case?Regards,Alex Link to comment Share on other sites More sharing options...
ivankaa Posted March 28, 2012 Share Posted March 28, 2012 Hello, I need also help with this topic. Any help please? Thnx Link to comment Share on other sites More sharing options...
Valérie Assetskaya Posted March 29, 2012 Share Posted March 29, 2012 Hello, modules/blockviewed/blockviewed.php->hookRightColumn(){ ... $productsViewedObj = array(); foreach ($productsViewed AS $productViewed) { $obj = (object)'Product'; if (!isset($productsImagesArray[$productViewed]) || (!$obj->active = $productsImagesArray[$productViewed]['active'])) continue; else { $obj->id = (int)($productsImagesArray[$productViewed]['id_product']); $product_obj = new Product($obj->id); $obj->cover = (int)($productsImagesArray[$productViewed]['id_product']).'-'.(int)($productsImagesArray[$productViewed]['id_image']); $obj->legend = $productsImagesArray[$productViewed]['legend']; $obj->name = $productsImagesArray[$productViewed]['name']; $obj->description_short = $productsImagesArray[$productViewed]['description_short']; $obj->link_rewrite = $productsImagesArray[$productViewed]['link_rewrite']; $obj->category_rewrite = $productsImagesArray[$productViewed]['category_rewrite']; $obj->product_obj_price = $product_obj->price; if (!isset($obj->cover) || !$productsImagesArray[$productViewed]['id_image']) { $obj->cover = $defaultCover; $obj->legend = ''; } $productsViewedObj[] = $obj; } } ... } Now in blockviewed.tpl you should refer to the field product_obj_price, object productsViewedObj. If you need to take into account taxes, sales (price reduction), then you need to modify the code above following the example of function Product :: getPriceStatic () Best regards Link to comment Share on other sites More sharing options...
gwenn Posted August 2, 2012 Share Posted August 2, 2012 Hello valerie_BelVG, Thanks you for your answer. But it's possible to give me a example how do you make to display the reduce price? Because i try it for a day and i don't found the solution. Thank's a lot and Best regards. Link to comment Share on other sites More sharing options...
mouse1 Posted August 31, 2013 Share Posted August 31, 2013 (edited) Also check these two topics: http://www.prestashop.com/forums/index.php?/topic/49877-how-to-display-product-price-in-the-viewed-products-block/page__view__findpost__p__1360149 http://www.prestashop.com/forums/index.php?/topic/248206-products-price-in-block-viewed/page__view__findpost__p__1360143 Edited August 31, 2013 by mouse1 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts