Jump to content

How To Test For Smarty Customer Group


Bill Dalton

Recommended Posts

Need to test for Group id 5, and run this code, however I don't know how to test for customer group.


{if customergroup = 5
{if $order[orders].price_display_method == $order[orders].shop.ps_tax_inc} {* with tax *}
<td class="align-right">{displayPrice price=$price_rounded currency=$order[orders].id_currency}</td>
<td class="align-right">{displayPrice price=$price_rounded*$order[orders].order_detail[detail].product_quantity currency=$order[orders].id_currency}</td>
{else}
<td class="align-right">{displayPrice price=$price_wt_rounded currency=$order[orders].id_currency}</td>
<td class="align-right">{displayPrice price=$price_wt_rounded*$order[orders].order_detail[detail].product_quantity currency=$order[orders].id_currency}</td>
{/if}
{else}
        {if $order[orders].price_display_method == $order[orders].shop.ps_tax_exc} {* without tax *}
<td class="align-right">{displayPrice price=$price_rounded currency=$order[orders].id_currency}</td>
<td class="align-right">{displayPrice price=$price_rounded*$order[orders].order_detail[detail].product_quantity currency=$order[orders].id_currency}</td>
{else}
<td class="align-right">{displayPrice price=$price_wt_rounded currency=$order[orders].id_currency}</td>
<td class="align-right">{displayPrice price=$price_wt_rounded*$order[orders].order_detail[detail].product_quantity currency=$order[orders].id_currency}</td>
{/if}
{/if}
Edited by Bill Dalton (see edit history)
Link to comment
Share on other sites

It is a tpl template used to generate a PDF invoice using module m4pdf.

 

The m4pdf module works fine, but recently I installed a new module called deluxeinvoiceb2b

 

The purpose of this module is to allow for the creating of a tax free group, and it works perfect on the front end and backend, and even send the numbers to m4pdf tax free.

 

Unfortunately m4pdf ends up treating the numbers as taxable, it is not getting the message that tax has been turned off for this order. So I need a way of conditionally running the code above based on the group for the customer being invoiced.

Link to comment
Share on other sites

Do you have customer variable available ?

 

So could use 

{if $customer.id_default_group == 5}

But probably not so easy and customer could be in $order[orders].customer maybe.

So try to test with 

{$order[orders]|var_dump} 

or

{$order[orders].customer|var_dump}
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...