本条还可参阅:
PayPal是一种通过互联网进行国际付款和汇款的中介服务。PayPal Guest Checkout允许客户使用信用卡支付而无需登录其PayPal账号以完成交易。本文将指导您将PayPal Guest Checkout添加到结账页面,如下所示:



指南

在ShopBase后台上,选择 Online Store > Themes > Customize > Checkout Page。在 More Customization部分中,查找 Put your custom JavaScript code here to add and change some content of Checkout pages项目。



将下面的代码粘贴到 Put your custom JavaScript code here to add and change some content of Checkout pages 字段。

对于一页结帐的店铺

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);
});


对于三页结账的店铺

//
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以保存。
这篇文章有帮助吗?
取消
谢谢!