dcb1101 Posted May 6, 2016 Share Posted May 6, 2016 Hello everyone. I have searched the forum and found some useful info, but not exactly what I need. Basically I am adding a sales tracker script to my WHMCS. I See I can do this in complete.tpl and that there are a few variables that I can pass. Here is what I have so far. <link rel="stylesheet" type="text/css" href="templates/orderforms/{$carttpl}/style.css" /> <div id="order-boxes"> <div class="header-lined-order"> <h1>{$LANG.orderconfirmation}</h1> </div> <p>{$LANG.orderreceived}</p> <div class="row"> <div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3"> <div class="alert alert-success text-center large-text" role="alert"> {$LANG.ordernumberis} <strong>{$ordernumber}</strong> </div> </div> </div> <p>{$LANG.orderfinalinstructions}</p> {if $invoiceid && !$ispaid} <div class="alert alert-danger" role="alert"> {$LANG.ordercompletebutnotpaid} </div> <div class="line-padded text-center"> <a href="viewinvoice.php?id={$invoiceid}" target="_blank" class="btn btn-success">{$LANG.invoicenumber}{$invoiceid}</a> </div> {/if} {foreach from=$addons_html item=addon_html} <div class="line-padded"> {$addon_html} </div> {/foreach} {if $ispaid} {php} $orderid = $this->get_template_vars('orderid'); $result = select_query("tblorders","amount",array("id"=>$orderid)); $data = mysql_fetch_array($result); $amount = $data["amount"]; $this->assign('amount',$amount); {/php} <span id="_GUARANTEE_GuaranteeSpan"></span> <script type="text/javascript" src="MyUniqueSrc"></script> <script type="text/javascript"> if (window._GUARANTEE && _GUARANTEE.Loaded) { _GUARANTEE.Hash = "MyHash"; _GUARANTEE.Guarantee.order = "{$ordernumber}"; _GUARANTEE.Guarantee.subtotal = '{$amount}'; _GUARANTEE.Guarantee.email = '...buyer email goes here...'; _GUARANTEE.WriteGuarantee("JavaScript", "_GUARANTEE_GuaranteeSpan"); } </script> {/if} <div class="line-padded text-center"> <a href="clientarea.php" class="btn btn-primary btn-lg">{$LANG.ordergotoclientarea}</a> </div> </div> My questions are: 1. Is {$amount} going to give me the total paid for that order, or a single item? 2. How can I get the customers email address used on the order? Thank you all in advance! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 6, 2016 Share Posted May 6, 2016 i'm not sure you need the {php} section - you should be able to do it in Smarty. add {debug} to the end of the code in complete.tpl and you will get a popup window of all the Smarty variables available - that should help you to get the variables you need. 0 Quote Link to comment Share on other sites More sharing options...
dcb1101 Posted May 6, 2016 Author Share Posted May 6, 2016 i'm not sure you need the {php} section - you should be able to do it in Smarty. add {debug} to the end of the code in complete.tpl and you will get a popup window of all the Smarty variables available - that should help you to get the variables you need. Thank you @brian! It looks like $amount is included as a available value now, so I guess I don't need the additional code to get it. (That was a old forum post where I found that) using {debug} I was able to find the $clientdetails array and $clientsdetails["email] worked perfectly for adding in the clients email address. Thank you for your help 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.