@ikas/storefront 0.0.165-alpha.4 → 0.0.165-alpha.5

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/build/index.es.js CHANGED
@@ -22885,6 +22885,14 @@ var CheckoutViewModel = /** @class */ (function () {
22885
22885
  this.checkShippingCountries();
22886
22886
  _b.label = 2;
22887
22887
  case 2:
22888
+ // Skip shipping if there is only 1 shipping method
22889
+ if (this.step === CheckoutStep.SHIPPING &&
22890
+ this.checkout.availableShippingMethods.length === 1) {
22891
+ this.step = CheckoutStep.PAYMENT;
22892
+ this.router.replace("/checkout/" + this.checkout.id + "?step=" + this.step, undefined, {
22893
+ shallow: true,
22894
+ });
22895
+ }
22888
22896
  if (!(this.step === CheckoutStep.PAYMENT ||
22889
22897
  this.step === CheckoutStep.SUCCESS)) return [3 /*break*/, 4];
22890
22898
  return [4 /*yield*/, this.listPaymentGateways()];
@@ -61731,7 +61739,8 @@ var Steps = observer(function (_a) {
61731
61739
  createElement(StepSummaryAddress, { vm: vm }),
61732
61740
  createElement("div", { className: styles$5.EditBtn, onClick: vm.onBackToInfoClick }, t("checkout-page:actions.edit")))) : undefined, vm.step !== CheckoutStep.INFO ? (createElement("div", { className: styles$5.AddressStepInfoMobile },
61733
61741
  createElement(StepSummaryAddress, { vm: vm }))) : undefined),
61734
- new Step(t("checkout-page:shipping"), vm.step === CheckoutStep.SHIPPING, vm.step === CheckoutStep.PAYMENT, vm.step === CheckoutStep.PAYMENT ? (createElement("div", { className: styles$5.AdressStepInfo },
61742
+ new Step(t("checkout-page:shipping"), vm.step === CheckoutStep.SHIPPING, vm.step === CheckoutStep.PAYMENT, vm.step === CheckoutStep.PAYMENT &&
61743
+ vm.checkout.availableShippingMethods.length > 1 ? (createElement("div", { className: styles$5.AdressStepInfo },
61735
61744
  createElement(StepSummaryShipping, { vm: vm }),
61736
61745
  createElement("div", { className: styles$5.EditBtn, onClick: vm.onBackToShippingClick }, t("checkout-page:actions.edit")))) : undefined, vm.step === CheckoutStep.PAYMENT ? (createElement("div", { className: styles$5.AddressStepInfoMobile },
61737
61746
  createElement(StepSummaryShipping, { vm: vm }))) : undefined),
package/build/index.js CHANGED
@@ -22894,6 +22894,14 @@ var CheckoutViewModel = /** @class */ (function () {
22894
22894
  this.checkShippingCountries();
22895
22895
  _b.label = 2;
22896
22896
  case 2:
22897
+ // Skip shipping if there is only 1 shipping method
22898
+ if (this.step === CheckoutStep.SHIPPING &&
22899
+ this.checkout.availableShippingMethods.length === 1) {
22900
+ this.step = CheckoutStep.PAYMENT;
22901
+ this.router.replace("/checkout/" + this.checkout.id + "?step=" + this.step, undefined, {
22902
+ shallow: true,
22903
+ });
22904
+ }
22897
22905
  if (!(this.step === CheckoutStep.PAYMENT ||
22898
22906
  this.step === CheckoutStep.SUCCESS)) return [3 /*break*/, 4];
22899
22907
  return [4 /*yield*/, this.listPaymentGateways()];
@@ -61711,7 +61719,8 @@ var Steps = mobxReactLite.observer(function (_a) {
61711
61719
  React.createElement(StepSummaryAddress, { vm: vm }),
61712
61720
  React.createElement("div", { className: styles$5.EditBtn, onClick: vm.onBackToInfoClick }, t("checkout-page:actions.edit")))) : undefined, vm.step !== CheckoutStep.INFO ? (React.createElement("div", { className: styles$5.AddressStepInfoMobile },
61713
61721
  React.createElement(StepSummaryAddress, { vm: vm }))) : undefined),
61714
- new Step(t("checkout-page:shipping"), vm.step === CheckoutStep.SHIPPING, vm.step === CheckoutStep.PAYMENT, vm.step === CheckoutStep.PAYMENT ? (React.createElement("div", { className: styles$5.AdressStepInfo },
61722
+ new Step(t("checkout-page:shipping"), vm.step === CheckoutStep.SHIPPING, vm.step === CheckoutStep.PAYMENT, vm.step === CheckoutStep.PAYMENT &&
61723
+ vm.checkout.availableShippingMethods.length > 1 ? (React.createElement("div", { className: styles$5.AdressStepInfo },
61715
61724
  React.createElement(StepSummaryShipping, { vm: vm }),
61716
61725
  React.createElement("div", { className: styles$5.EditBtn, onClick: vm.onBackToShippingClick }, t("checkout-page:actions.edit")))) : undefined, vm.step === CheckoutStep.PAYMENT ? (React.createElement("div", { className: styles$5.AddressStepInfoMobile },
61717
61726
  React.createElement(StepSummaryShipping, { vm: vm }))) : undefined),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.165-alpha.4",
3
+ "version": "0.0.165-alpha.5",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",