This article is also available in:
PayPal is a simple, fast payment gateway to keep your customers ‘s checkout process smoothly. In this section, we will introduce you to a short instruction on how to use PayPal Guest Checkout in your Checkout Page so you can improve your store management as below.



Step by Step Tutorial

Go to Online Store > Themes > Customize > Checkout Page > More Customization > Put your custom JavaScript code here to add and change some content of Checkout pages.


Add these below scripts
For 1-page checkout

sbsdk.page.onContextUpdate(function() {
    var count = 0;
    var readyCheckInterval = setInterval(function() {
        var customTextPaypal = document.querySelector('.custom-text-paypal');
        if (customTextPaypal) {
            clearInterval(readyCheckInterval);
            return;
        }
        var elementText = document.querySelectorAll('fieldset.content-box');
        var el = document.createElement("div");
        el.className = "custom-text-paypal";
        el.style.textAlign = "center";
        el.style.marginTop = "15px";
        el.innerHTML = '<p style="color:#143B82;">After clicking "Continue with PayPal", you will be redirected to PayPal to complete your purchase securely.</p><p>You could pay <strong style="font-weight: 800 !important;">without a Paypal Account</strong> by clicking "Pay with Debit or Credit Card".</p><p>Again, don\'t worry! You <strong style="font-weight: 800 !important;">don\'t need a Paypal account</strong> to make a payment.</p>';
        if (elementText && elementText[1] && elementText[1].lastElementChild) {
            clearInterval(readyCheckInterval);
            elementText[1].lastElementChild.appendChild(el);
        }
        if (count === 4) {
            clearInterval(readyCheckInterval);
        }
        count++;
    }, 500);
});


For 3-page checkout

//
sbsdk.page.onContextUpdate(function() {
  var count = 0;
  var readyCheckInterval = setInterval(function() {
    var elementText = document.querySelectorAll('.blank-slate > p')[0]
    if (typeof elementText !== 'undefined') {
      clearInterval(readyCheckInterval);
      elementText.innerHTML = '<p style="color:#3399cc;">After clicking "Complete order", you will be redirected to PayPal to complete your purchase securely.</p><p>You could pay <strong style="font-weight: 800 !important;">without a Paypal Account</strong> by clicking "Pay with Debit or Credit Card". </p><p>Again, don\'t worry!You don \'t need a Paypal account to make a payment.</p>'
    }
    if (count === 8) {
      clearInterval(readyCheckInterval);
    }
    count++;
  }, 500);
})

//
document.addEventListener("change", function(e) {
  var elementText = document.querySelectorAll('.blank-slate > p')[0]
  if (e.target.value === 'paypal-express' && e.target.checked && typeof elementText !== 'undefined') {
    elementText.innerHTML = '<p style="color:#3399cc;">After clicking "Complete order", you will be redirected to PayPal to complete your purchase securely.</p><p>You could pay <strong style="font-weight: 800 !important;">without a Paypal Account</strong> by clicking "Pay with Debit or Credit Card". </p><p>Again, do not worry! You do not need a Paypal account to make a payment.</p>'
  }
  if (e.target.value === 'faster-pay' && e.target.checked && typeof elementText !== 'undefined') {
    elementText.innerHTML = 'After clicking "Complete order", you will be redirected to FasterPay to complete your purchase securely.'
  }
})

Save. And you're done!
Was this article helpful?
Cancel
Thank you!