fawad Posted October 31, 2010 Share Posted October 31, 2010 Hi,When install loyalty module from admin. In the product page it displays some text after "Add to Cart" button.My question is can we display that loyalty text in cart block.Thanks Link to comment Share on other sites More sharing options...
rocky Posted November 1, 2010 Share Posted November 1, 2010 Copying that text is not a good idea, since it only relates to that product, not what's currently in the cart. The loyalty module also displays text on the shopping cart summary about how many points you will get. I suggest that you copy the contents of modules/loyalty/shopping-cart.tpl over to modules/blockcart/blockcart.tpl. That won't display anything though, since the number of points isn't being passed in to that TPL file. To get the points, you will need to change the hookRightColumn function of modules/blockcart/blockcart.php (in PrestaShop v1.3.2) to: public function hookRightColumn($params) { global $smarty, $page_name, $cart; $smarty->assign('order_page', $page_name == 'order'); $this->smartyAssigns($smarty, $params); $points = LoyaltyModule::getCartNbPoints($cart); $smarty->assign(array( 'points' => $points, 'voucher' => LoyaltyModule::getVoucherValue($points) )); return $this->display(__FILE__, 'blockcart.tpl'); } Link to comment Share on other sites More sharing options...
Recommended Posts