Jump to content
  • 0

blank page with hook


Waqas Saeed

Question

<?php
if (!defined("WHMCS"))
    die("This file cannot be accessed directly");

function facebookPixelCheckOut()
{
$pixelID1 = "843460539109207";
$codepixel = "<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '".$pixelID1."');
fbq('track', \"InitiateCheckout\");
</script>
<noscript>
<img height=\"1\" width=\"1\" style=\"display:none\"
src=\"https://www.facebook.com/tr?id=".$pixelID1."&ev=InitiateCheckout&noscript=1\" />";
echo $codepixel;
}

//add_hook("ClientAreaPageViewInvoice",1,"facebookPixelCheckOut");
add_hook("AfterShoppingCartCheckout",0,"facebookPixelCheckOut");


?>

Hello.

This conversion works but if user click on the button Check Out, it shows blank page to user, and after user refresh the page it shows the page. What is causing due to hook that it is bringing up the blank page. but no error. 

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

@Kian thanks buddy, oh! I didn't got the goodie bag . 😞 

Anyways, I'm new to WHMCS code, framwork

What to do here if I want this script to run. Could you help me using my code to run at the point where it can return/echo without interrupting the redirect. the point the customer completes the checkout and receives the unpaid invoice. 

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
Answer this question...

×   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