Kiyro Posted October 31, 2013 Share Posted October 31, 2013 Hi everyone, I need help. I want to show a div with a message only for a specific User Group. How can i do? Also, how can i show a group Discount in a product page? Thanks you in advice. Link to comment Share on other sites More sharing options...
vekia Posted October 31, 2013 Share Posted October 31, 2013 hello where you want to display this message? Link to comment Share on other sites More sharing options...
Kiyro Posted October 31, 2013 Author Share Posted October 31, 2013 (edited) In index.tpl and/or in a page, we can do that? Edited October 31, 2013 by Kiyro (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 31, 2013 Share Posted October 31, 2013 hello index.tpl page is a page where the home hook is loaded. if i were you, i will use different file. In index.tpl and/or in a page in page? what page? Link to comment Share on other sites More sharing options...
Kiyro Posted October 31, 2013 Author Share Posted October 31, 2013 I would like to show the message on the homepage, which template I could change? Link to comment Share on other sites More sharing options...
vekia Posted October 31, 2013 Share Posted October 31, 2013 well, it's still not enough for me. So i will show you how to do it for homepage (not modules) - just for theme. open classes/controllers/frontController.php there is a function: public function initContent() { add there this code: $this->context->smarty->assign('checkcustomer',$this->context->customer); example: public function initContent() { $this->context->smarty->assign('checkcustomer',$this->context->customer); then in .tpl files use this code: {if $checkcustomer->id_default_group==3} CONTENT HERE {/if} where 3 is an ID of customer group. 5 Link to comment Share on other sites More sharing options...
Kiyro Posted November 5, 2013 Author Share Posted November 5, 2013 Thank you, It works! Link to comment Share on other sites More sharing options...
vekia Posted November 5, 2013 Share Posted November 5, 2013 you're welcome im glad that i could help you a little in this case I marked this thread as [solved] best regards 1 Link to comment Share on other sites More sharing options...
Dagostino Posted January 28, 2014 Share Posted January 28, 2014 (edited) Hello, I need to do something like this but not on homepage i have installed a module (for display discount price on product page) and i have put this code in product-list.tpl (for display cheapest price on the product list in category) : {if isset($is_agilequantitydiscountindicator_installed)} <script language="javascript" type="text/javascript"> $(document).ready(function() {ldelim} getQDIPriceForList({$product.id_product}); {rdelim} ); </script> So here is my probleme, i have 2 differents groups : normal customers, and VIP For the normal customer, all work fine but for VIP i have a probleme, i want to hide this code (and module) for the VIP group for 2 reasons : first : VIP dont have more than 1 discount price (Normal customer have 5 discount price) so it's useless to display it on product page. second : The price displayed on product list dont work when the discount price is setting on "1" on quantity minimum, the price display on the product list is the higher. So i just want to hide the code for VIP and display for normal it is possible ? Thank's for futures answers and i'm sorry for my bad english, i hope it's understandable ps : Presta 1.5.4.1 Edited January 28, 2014 by Dagostino (see edit history) Link to comment Share on other sites More sharing options...
Roffleman Posted March 29, 2014 Share Posted March 29, 2014 well, it's still not enough for me. So i will show you how to do it for homepage (not modules) - just for theme. open classes/controllers/frontController.php there is a function: public function initContent() { add there this code: $this->context->smarty->assign('checkcustomer',$this->context->customer); example: public function initContent() { $this->context->smarty->assign('checkcustomer',$this->context->customer); then in .tpl files use this code: {if $checkcustomer->id_default_group==3} CONTENT HERE {/if} where 3 is an ID of customer group. Hello there. Thank you for this advice, exactly what i was looking for. However i encountered a little problem. I placed a unique content based on customer`s group id into product-list.tpl and product.tpl. It works fine on both, except when you have more than one page of products and go to second page (processed by script i guess), the condition is not processed anymore and the conditional content is not displayed anymore. My product-list.tpl: {if $logged}{if $checkcustomer->id_default_group==5}<span id="old_price_display">{convertPrice price=$product.price * 1.25}</span><br />{/if}{/if} My frontController.php is exactly to your specifications. THanks for help Link to comment Share on other sites More sharing options...
Jemin Posted December 3, 2015 Share Posted December 3, 2015 Hi everyone, I need help. If I have A Multi shop then how to do display error message on particular shop. Please Replay Thank You. Link to comment Share on other sites More sharing options...
Recommended Posts