alamise Posted April 7, 2014 Share Posted April 7, 2014 (edited) Hello everyone, I hope some of you can help . this makes me struggle from a couple of days. I have already found 1-2 similar topics, but nothing worked for me. how can i get current customer group id in produit.tpl Thnaks in advance! prestashop 1.5.6.2 Edited April 15, 2014 by alamise (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 7, 2014 Share Posted April 7, 2014 Hi Alamise, In controllers/front/ProductController.php find function public function initContent() Then just before the call to product.tpl add the current group: 'ENT_NOQUOTES' => ENT_NOQUOTES, 'currentGroup' => (int)Group::getCurrent()->id, 'outOfStockAllowed' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK') )); } $this->context->smarty->assign('errors', $this->errors); $this->setTemplate(_PS_THEME_DIR_.'product.tpl'); } then in themes/<your theme folder>/product.tpl, add somewhere where you need it: <span id="current_group_id">Current group = {$currentGroup}</span> or something like that. Hope this helps, pascal Link to comment Share on other sites More sharing options...
alamise Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) sloved thank you Edited April 7, 2014 by alamise (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 7, 2014 Share Posted April 7, 2014 Perfect! Please mark the topic solved it it works for you, (change the topic title to [sOLVED] see my footer on how). Happy selling, pascal. 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