AngelDisc Posted December 29, 2015 Share Posted December 29, 2015 Bonjour. Le titre dit tout. Comment désactiver ou ne pas afficher un module en fonction du groupe de client (exemple: module loyalty pour pro) ? Bon dev. Link to comment Share on other sites More sharing options...
2FR3 Posted December 29, 2015 Share Posted December 29, 2015 Salut, https://www.prestashop.com/forums/topic/228277-get-customer-group-id-in-smarty/ Link to comment Share on other sites More sharing options...
AngelDisc Posted December 29, 2015 Author Share Posted December 29, 2015 Merci beaucoup. La communauté prestashop est toujours aussi rapide Bon dev Link to comment Share on other sites More sharing options...
AngelDisc Posted December 29, 2015 Author Share Posted December 29, 2015 (edited) J'en ai fais un override Fichier FrontController.php à placer dans "override\classes\controller\" <?php class FrontController extends FrontControllerCore { /** * Initializes page header variables */ public function initHeader() { /** @see P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) */ header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); header('Powered-By: PrestaShop'); // Hooks are voluntary out the initialize array (need those variables already assigned) $this->context->smarty->assign(array( 'time' => time(), 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'static_token' => Tools::getToken(false), 'token' => Tools::getToken(), 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, 'content_only' => (int)Tools::getValue('content_only'), 'customer_groups' => $this->getCurrentCustomerGroups(), )); $this->context->smarty->assign($this->initLogoAndFavicon()); } } Et dans votre tpl: {$view_module = 0} {foreach from=$customer_groups item=customer_group} {if $customer_group == 4} {$view_module = 1} {/if} {/foreach} {if $view_module != 1} J'affiche ou pas mon code. $customer_group = x, x étant l'identifiant du groupe {/if} Bon dev Edited December 29, 2015 by Ridea Bikes (see edit history) Link to comment Share on other sites More sharing options...
coeos.pro Posted December 29, 2015 Share Posted December 29, 2015 Et tu as essayé dans la configuration du groupe de client de désactiver le module en question? Tout simplement 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