Smarty help please, "if a string begins with xyz..."?
I want to include usernames in the order_invoice.tpl
This thread shows how. Now, I need to exclude the "anonymous" checkouts, which for my store, all start with "customer". customer-392 customer-1048 customer-21864 etc... How do I ask smarty to look for the phrase "customer-XYZ" and if it sees a username that begins with "customer" to let me know... {if $order.login BEGINS WITH 'customer'} do this {/if} Smarty experts? Thank you in advance. Jeremy |
Re: Smarty help please, "if a string begins with xyz..."?
Code:
{if $order.login|strpos:'customer-'===0} |
Re: Smarty help please, "if a string begins with xyz..."?
Bill,
That's just brilliant! Thank you. If anyone's interested... file: skin1/mail/html/order_invoice.tpl FIND: Code:
{foreach from=$_userinfo.additional_fields item=v} Code:
{if $order.login|strpos:'customer-'===0} Replace 'customer' with whatever you've named your anonymous customers... in config.php $anonymous_username_prefix="customer"; Another very nice addition to the customer invoice. Thanks Bill! Jeremy |
Re: Smarty help please, "if a string begins with xyz..."?
hey thanks
:mrgreen: Quote:
|
All times are GMT -8. The time now is 11:07 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.