DimaK Posted February 12, 2008 Share Posted February 12, 2008 Was announced in V3.6 that it will work with Google Conversion Tracking. How do you use it? 0 Quote Link to comment Share on other sites More sharing options...
railto Posted February 12, 2008 Share Posted February 12, 2008 yeah have been looking for this myself 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 12, 2008 WHMCS CEO Share Posted February 12, 2008 templates/orderforms/cart/complete.tpl is the file. There is a section in there: {if $ispaid} <!-- Enter any HTML code which needs to be displayed once a user has completed the checkout of their order here - for example conversion tracking and affiliate tracking scripts --> {/if} The HTML code you place there only runs once the user has paid and fully completed the order process. Matt 0 Quote Link to comment Share on other sites More sharing options...
DimaK Posted February 12, 2008 Author Share Posted February 12, 2008 In your example it's for "/cart/" Will it work with /singlepage/order-complete.tpl ? Or even if I use "/singlepage/" I have to add tracking code to /cart/complete.tpl ? Will this code runs always or we have to enable it in "GENERAL SETTINGS" ? (for example "Auto Redirect on Checkout" I use "automatically redirect the user to the invoice", will it work for me? What variables can we use for tracking codes? like payment amount, domain name, invoice num etc. 0 Quote Link to comment Share on other sites More sharing options...
DimaK Posted February 12, 2008 Author Share Posted February 12, 2008 I have tested, and for "/singlepage/" we can add tracking code to /cart/complete.tpl without additional settings, But it's not work with Braces {, } in the tracking codes. And still question how to add payment sum ? 0 Quote Link to comment Share on other sites More sharing options...
DimaK Posted February 12, 2008 Author Share Posted February 12, 2008 oh, "Just need to enclose it in {literal} and {/literal} ..." and it works 0 Quote Link to comment Share on other sites More sharing options...
tracktor Posted February 12, 2008 Share Posted February 12, 2008 Hi Dimak, the code in complete.tpl work with "Auto Redirect on Checkout"?? regards 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 12, 2008 WHMCS CEO Share Posted February 12, 2008 No matter what checkout option is used, the order process will now always end on the order complete page once paid for - that was the new feature. Matt 0 Quote Link to comment Share on other sites More sharing options...
D9Hosting Posted February 13, 2008 Share Posted February 13, 2008 Does anyone know what variables are available to use on this page? I'm sure there is a Smarty command you can use that will show the variables that are available for you, but my mind has gone blank 0 Quote Link to comment Share on other sites More sharing options...
JasonO Posted February 13, 2008 Share Posted February 13, 2008 I'm not sure, but I think it's {debug} - i've seen it posted around a lot here. 0 Quote Link to comment Share on other sites More sharing options...
D9Hosting Posted February 13, 2008 Share Posted February 13, 2008 Cheers, That's it I've got a list of variables here, one thing that's missing is the order total, which would be very useful for Google Analytics, would this be possible to include Matt? Here's the list for the rest of you, I'm copy/pasting straight from the debug console so lets see how it comes out.... {$SCRIPT_NAME} /clients/cart.php {$breadcrumbnav} <a href="cart.php">Shopping Cart</a> {$charset} iso-8859-1 {$clientsdetails} Array (3) id => 152 firstname => Dan lastname => Thompson {$companyname} D9 Hosting {$currency} USD {$currencysymbol} $ {$invoiceid} empty {$ispaid} empty {$langchange} true {$language} English {$loggedin} true {$orderid} 160 {$ordernumber} 7939606241 {$pageicon} images/support/order.gif {$pagetitle} Shopping Cart {$setlanguage} <form method="post" action="/clients/... {$systemsslurl} empty {$systemurl} http://www.d9hosting.com/clients {$template} d9hosting {$todaysdate} Wednesday, 13th February 2008 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted February 13, 2008 Share Posted February 13, 2008 Odd... shouldn't $invoiceid and $ispaid not be empty after the person has paid? Or did you get his from a different step? 0 Quote Link to comment Share on other sites More sharing options...
D9Hosting Posted February 13, 2008 Share Posted February 13, 2008 I paid with credit rather than a standard gateway if that makes any difference? I'll do another check tomorrow using a normal gateway and see what the results are. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 14, 2008 WHMCS CEO Share Posted February 14, 2008 If you need the total amount the order was for then you would use a code block like the below one to assign the {$amount} variable for use elsewhere in the template {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} So that would then enable you to do something like this in your tracking code: <img src="http://order-tracker.com/?ordernumber={$orderid}&amount={$amount}" width="1" height="1" border="0" /> Matt 0 Quote Link to comment Share on other sites More sharing options...
D9Hosting Posted February 14, 2008 Share Posted February 14, 2008 Cheers Matt, That looks like it should do the trick 0 Quote Link to comment Share on other sites More sharing options...
allynne Posted February 16, 2008 Share Posted February 16, 2008 Matt, would the following also work? {php} $orderid = $smarty->get_template_vars('orderid'); $result = select_query("tblorders","amount",array("id"=>$orderid)); $data = mysql_fetch_array($result); $amount = $data["amount"]; $this->assign('amount',$amount); $clientid = $smarty->get_template_vars('clientsdetails.id'); $result = select_query("tblclients","city,state,country",array("id"=>$clientid)); $data = mysql_fetch_array($result); $this->assign('city',$data["city"]); $this->assign('state',$data["state"]); $this->assign('country',$data["country"]); {/php} 0 Quote Link to comment Share on other sites More sharing options...
simplehelix Posted February 18, 2008 Share Posted February 18, 2008 I have placed the code for sharesale (basically an img tag) in the orderforms/cart/complete.tpl but it's not working for me. i do a view source on it and it seems to be different from the complete.tpl file. for instance, at the end, it supposed to show: <p align="center"><a href="clientarea.php">{$LANG.ordergotoclientarea}</a></p> but that is not anywhere in the view source of the page: cart.php?a=complete am i doing something wrong? btw im using 3.6. i also using a different template for frontend but i think it would still use orderforms/cart/complete.tpl no? can someone please help me out? 0 Quote Link to comment Share on other sites More sharing options...
simplehelix Posted February 18, 2008 Share Posted February 18, 2008 Ok I've just done another test and found out that it is indeed loading the complete.tpl However! Even after sucessfully paying with a credit card, it seems to me that: {if $ispaid} ... {/if} block is not being triggered at all. Why could this be? Anyone else have the same problem? I am in a limbo here. someone help me out. THanks. 0 Quote Link to comment Share on other sites More sharing options...
simplehelix Posted February 18, 2008 Share Posted February 18, 2008 Now I've done more tests and i found a bug. // doing this will not echo hi {php} $orderid = $smarty->get_template_vars('orderid'); echo "hi"; {/php} // But doing this WILL echo hi {php} echo "hi"; $orderid = $smarty->get_template_vars('orderid'); {/php} can someone please confirm this? Matt, can you please give me your take on this? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
DimaK Posted February 18, 2008 Author Share Posted February 18, 2008 Yes, with code: ------------ {php} $orderid = $smarty->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} ------------ it's not work correctly...not show {if $ispaid} block 0 Quote Link to comment Share on other sites More sharing options...
Tech Entrance Posted February 22, 2008 Share Posted February 22, 2008 I'm waiting to get a final working code out of this thread 0 Quote Link to comment Share on other sites More sharing options...
NextLevel Posted February 24, 2008 Share Posted February 24, 2008 I'm using Pro Rata billing. Using {$amount} just gives me the first payment amount rather than the total product monthly amount. Anyway of changing this or querying another table? If you need the total amount the order was for then you would use a code block like the below one to assign the {$amount} variable for use elsewhere in the template {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} So that would then enable you to do something like this in your tracking code: <img src="http://order-tracker.com/?ordernumber={$orderid}&amount={$amount}" width="1" height="1" border="0" /> Matt 0 Quote Link to comment Share on other sites More sharing options...
pdpd Posted March 5, 2008 Share Posted March 5, 2008 No matter what checkout option is used, the order process will now always end on the order complete page once paid for - that was the new feature. Matt Do we need any special settings in WorldPay or will this script get called no matter what happens after the customer goes off to WorldPay to complete payment? 0 Quote Link to comment Share on other sites More sharing options...
landexcorp Posted May 23, 2008 Share Posted May 23, 2008 I tried to make this work, with out success. Is it possible they could integrate right into the code as an optional feature? Quite a bit of other software has that. 0 Quote Link to comment Share on other sites More sharing options...
ksstudio Posted August 9, 2008 Share Posted August 9, 2008 What if client didn't pay on the spot, such as they select other offline payment method? 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.