Jump to content

Loyalty text at product page


Recommended Posts

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

×
×
  • Create New...