Jump to content

Custom Link in complete.tpl Template


cdivas

Recommended Posts

Hello guys!

 

I hope you are doing great. I am trying to add a custom link in the complete.tpl template but I need your help.

 

The idea is that after a user buys a service, he can then visit their new site easily without having to wait to get his email.

 

For this I need to add a link for the "$service_domain" variable that I can use in the email templates.

 

I have no idea how I could add this link in the complete.tpl since I am not a coder.

 

Please help me resolve this ;)

 

Thank you!

 

- CD

Link to comment
Share on other sites

Hello,

 

The only issue I see with this is generally there is a propagation period when registering a new domain or the customer will need to update their nameservers so 9 times out of 10 they won't be able to see their website instantly upon ordering.

Link to comment
Share on other sites

Hello guys!

 

I hope you are doing great. I am trying to add a custom link in the complete.tpl template but I need your help.

 

The idea is that after a user buys a service, he can then visit their new site easily without having to wait to get his email.

 

For this I need to add a link for the "$service_domain" variable that I can use in the email templates.

 

I have no idea how I could add this link in the complete.tpl since I am not a coder.

 

Please help me resolve this ;)

 

Thank you!

 

- CD

you may need to explain how you need this to work, but I will provide simple example of how this should go,

 

Create new PHP file inside /includes/hooks/ directory, and place the following code inside it

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

add_hook("ShoppingCartCheckoutCompletePage", 1, function($params){

   if ($params['ispaid']==true){

       $getService = Capsule::table("tblhosting")->where("orderid", $params['orderid'])->where("domain", "!=", "")->take(1);

       if ($getService->count()>0){

           $service = $getService->get();

           return '<a href="'.$service[0]->domain.'" class="btn btn-info">Visit Your Website</a>';

       }

   }

});

this ActionHook function will run when client completes their order

 

if order is paid, and at least one of the hosting services linked to this order has domain name new link will be displayed in /cart.php?a=complete page

 

ordercompleted.png

Link to comment
Share on other sites

  • 7 years later...
On 6/19/2016 at 3:56 AM, sentq said:
<?php

use Illuminate\Database\Capsule\Manager as Capsule;

add_hook("ShoppingCartCheckoutCompletePage", 1, function($params){

   if ($params['ispaid']==true){

       $getService = Capsule::table("tblhosting")->where("orderid", $params['orderid'])->where("domain", "!=", "")->take(1);

       if ($getService->count()>0){

           $service = $getService->get();

           return '<a href="'.$service[0]->domain.'" class="btn btn-info">Visit Your Website</a>';

       }

   }

});

Hello

can you help me and update this code i want to show currency and purchase amount after order ID for google purchase tracking instead of website link 

 

i will be thankful to you 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated