This article is also available in:
How it looks

A short instruction on how to use PayPal Guest Checkout will be added into the Checkout Page as below:



Tutorial

Go to Online Store > Themes > Customize > Checkout Page > More Customization > Custom JavaScript code



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[0] && elementText[0].lastElementChild) {
clearInterval(readyCheckInterval);
elementText[0].lastElementChild.appendChild(el);
}
if (count === 4) {
clearInterval(readyCheckInterval);
}
count++;
}, 500);
});


for 3-page checkout
//store 1 cong thanh toan
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);
})

//store nhieu cong thanh toan
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!

More Power Up Script can be found here
Was this article helpful?
Cancel
Thank you!