usergroup on order

Hello All,



I would like to display the barcode on my invoice only if the user is a member of my usergroup (id=10).



I have this now… but it isn’t working.




{foreach from=$usergroups item=usergroup}
{if $user_data.usergroups[$usergroup.usergroup_id] == "10"}
{include file="addons/barcode/barcode.tpl" id=$order_info.order_id}
{/if}
{/foreach}








Can someone help me with this?



Thanks in advance!

Hi dennis,



I have question same you too.

I want to display text box coupon code when customer checkout for usergroup_id = 10.





{if $usergroup.usergroup_id == 10}

{include file=“views/checkout/components/promotion_coupon.tpl” location=$location}

{/if}



It doesn't work.



Have anybody help me solve. Thanks advance

Since you're using static values, I don't think there's a need for the foreach loop. You should be able to do something more like:

```php

{if $smarty.session.auth.usergroup_Ids && $smarty.session.auth.usergroup_Ids|in_array:10}

{include file=“addons/barcode/barcode.tpl” id=$order_info.order_id}

{/if}

[/code