ayin Posted January 26, 2015 Share Posted January 26, 2015 Hello, I wonder if you guys any simple way to know the customer group of the customer in while processing the .tpl? E.g. {if $customer->VIP(true)} <p>PRICE!</p> {/if} Else i would need need to crave within .php code and return a processed price within the Product class as explain in this post: https://www.prestashop.com/forums/topic/174802-product-prices-per-group/ - which i think it is not architecturally correct. Thanks for your feedback, Cheers Link to comment Share on other sites More sharing options...
cikcak Posted January 27, 2015 Share Posted January 27, 2015 You should look for module: customergroups. Im using this module and check php file foreach ($groups as $group) {if ($group['id_group'] == 4 or 5 6 7 89 etc... ) {$smarty->assign('VIP', 1);}} $smarty->assign('customerGroups', $groups); and after this in .tpl use: {if $vip} PRICE {/if} 1 Link to comment Share on other sites More sharing options...
ayin Posted January 27, 2015 Author Share Posted January 27, 2015 Hello, I did not quite understand. You mean "prestashop\htdocs\classes\Customer.php"? Which method? You should look for module: customergroups. Im using this module and check php file foreach ($groups as $group) {if ($group['id_group'] == 4 or 5 6 7 89 etc... ) {$smarty->assign('VIP', 1);}} $smarty->assign('customerGroups', $groups); and after this in .tpl use: {if $vip} PRICE {/if} Link to comment Share on other sites More sharing options...
ayin Posted January 27, 2015 Author Share Posted January 27, 2015 So, if I did understand, the thing is to declare/assign a "flag" that tells "product-list.tpl" to display special prices? How it can be achieved? 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