ng-easycommerce 0.0.643 → 0.0.644
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bundles/ng-easycommerce.umd.js +7 -1
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/services/cart.service.js +8 -2
- package/esm5/lib/services/cart.service.js +8 -2
- package/fesm2015/ng-easycommerce.js +7 -1
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +7 -1
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -4989,14 +4989,20 @@ var CartService = /** @class */ (function () {
|
|
|
4989
4989
|
return true;
|
|
4990
4990
|
};
|
|
4991
4991
|
this.hasSufficientCreditsForCartTotal = function () {
|
|
4992
|
+
var _a, _b;
|
|
4992
4993
|
var balance = _this.balanceCustomerSubject.value;
|
|
4993
4994
|
if (!balance || balance.creditAmount === null || balance.creditAmount === undefined) {
|
|
4994
4995
|
return true;
|
|
4995
4996
|
}
|
|
4997
|
+
if (balance.allowAnyPaymentMethod) {
|
|
4998
|
+
return true;
|
|
4999
|
+
}
|
|
4996
5000
|
if (balance.remainingCredits === undefined) {
|
|
4997
5001
|
return false;
|
|
4998
5002
|
}
|
|
4999
|
-
|
|
5003
|
+
var total = ((_b = (_a = _this.cartSubject.value) === null || _a === void 0 ? void 0 : _a.totals) === null || _b === void 0 ? void 0 : _b.total) || 0;
|
|
5004
|
+
// Si NO puede exceder saldo y el total supera el credito, bloquear
|
|
5005
|
+
if (!balance.allowExceedBalance && total > balance.creditAmount) {
|
|
5000
5006
|
_this.toastrService.show('not-enough-credits');
|
|
5001
5007
|
return false;
|
|
5002
5008
|
}
|