TGK Posted September 22, 2018 Share Posted September 22, 2018 Hi i created a custom page and im trying that my custom varible work in these custom page can some help me a bit. custom page info: withcrypto.php template file: withcrypto.tpl <?php # Cart Email Verification Hook # Written by brian! use Illuminate\Database\Capsule\Manager as Capsule; function client_email_status_hook($vars) { $client = Menu::context("client"); if ($client && $vars['templatefile'] == 'withcrypto') { $clientemails = Capsule::table('tblclients')->where('id',$client->id)->value('marketing_emails_opt_in'); return array("clientemails" => $clientemails); } } add_hook('ClientAreaPage', 1, 'client_emails_status_hook'); ?> also i know that exist a {$marketing_emails_opt_in} variable but i dont know how to make work in my custom page. thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 23, 2018 Share Posted September 23, 2018 you wouldn't need a hook for this... if the client is logged in, then you can find out the information from an existing Smarty variable.. {if $loggedin} {if $clientsdetails.marketing_emails_opt_in} this client is opting in {else} this client is not opting in {/if} {else} the client is not logged in {/if} so if the client is logged in and they have opted in to email marketing, it will output "this client is opting in"; if they have not opted in, it will output "this client is not opting in" and if they are not logged in, it will say "the client is not logged in". you should then be able to adjust that {if} statement to cover what you want to do under those three circumstances. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.