|
@@ -212,6 +212,7 @@
|
|
|
const tap = "ontouchstart" in window ? "touchstart" : "click";
|
|
|
|
|
|
var addressId = {$addressId};
|
|
|
+ var cartTotal = {$cartTotal};
|
|
|
var payByPoints = "{$payByPoints}";
|
|
|
//console.log(payByPoints, payByPoints)
|
|
|
|
|
@@ -524,6 +525,12 @@
|
|
|
//支付
|
|
|
$(".payPalButton").on(tap, async function () {
|
|
|
console.log("paypaing")
|
|
|
+ if (cartTotal == 0){
|
|
|
+ showToast('The cart is empty, please add the products first')
|
|
|
+ window.location.replace('/index/index/index.html');
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 支付之前先判断是否有默认地址
|
|
|
if (!addressId) {
|
|
|
showToast('No address')
|