![]() |
testing for registered or anonymous user
I's like to be able to use an if statement in my invoice template, to display one thing for registered users, and another to anonymous users.
I am assuming I can just test the value of {$order.login}, but anonymous user logins have a number at the end. I really want to do something like {if left({$order.orderid}, 9) eq "anonymous"} stuff here {else} stuff here {/if} but I can't work out what it should actually be? I've tried looking at the smarty site with no success? tia |
Re: testing for registered or anonymous user
Are you talking about the invoice emailed to the customer? I don't think it uses smarty.
|
Re: testing for registered or anonymous user
oops... yes it does :)
Hmm... not sure I'll take a look see. |
Re: testing for registered or anonymous user
I do such a test on order_invoice.tpl (for BCSE reward points - display points only for registered customers):
Code:
{if $order.login|strpos:'customer-'===0} NOTE: I call my anon customers, "customer", as set in config.php -- if you call them "anonymous", then change strpos:'customer-' to strpos:'anonymous-' I also have a 4 digit order number (for now). Hopefully, it will exceed 4 digits some day, and I will have to adjust this code. That's about $11,000,000 of orders from now. Hope this works for you. Jeremy |
Re: testing for registered or anonymous user
Thanks, mine is for BCSE points code too!
|
All times are GMT -8. The time now is 12:42 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.