diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md index 95b4400..7137324 100644 --- a/LabelStoreMax/CHANGELOG.md +++ b/LabelStoreMax/CHANGELOG.md @@ -1,3 +1,8 @@ +## [2.1.1] - 2020-07-23 + +* Bug fix for categories +* Changes to FreeShipping + ## [2.1.0] - 2020-07-22 * Pubspec.yaml update for RazorPay diff --git a/LabelStoreMax/lib/labelconfig.dart b/LabelStoreMax/lib/labelconfig.dart index 446b548..322a9ab 100644 --- a/LabelStoreMax/lib/labelconfig.dart +++ b/LabelStoreMax/lib/labelconfig.dart @@ -16,7 +16,7 @@ import 'dart:ui'; Developer Notes SUPPORT EMAIL - support@woosignal.com - VERSION - 2.1.0 + VERSION - 2.1.1 https://woosignal.com */ diff --git a/LabelStoreMax/lib/pages/checkout_confirmation.dart b/LabelStoreMax/lib/pages/checkout_confirmation.dart index 98918d3..862b046 100644 --- a/LabelStoreMax/lib/pages/checkout_confirmation.dart +++ b/LabelStoreMax/lib/pages/checkout_confirmation.dart @@ -389,11 +389,7 @@ class CheckoutConfirmationPageState extends State { if (doubleTotal < doubleMinimumValue) { showEdgeAlertWith(context, title: trans(context, "Sorry"), - desc: trans(context, "Spend a minimum of") + - " " + - formatDoubleCurrency(total: doubleMinimumValue) + - " ${trans(context, "for")} " + - CheckoutSession.getInstance.shippingType.getTitle(), + desc: "${trans(context, "Spend a minimum of")} ${formatDoubleCurrency(total: doubleMinimumValue)} ${trans(context, "for")} ${CheckoutSession.getInstance.shippingType.getTitle()}", style: EdgeAlertStyle.INFO, duration: 3); return; diff --git a/LabelStoreMax/lib/pages/checkout_shipping_type.dart b/LabelStoreMax/lib/pages/checkout_shipping_type.dart index af0107b..9cad215 100644 --- a/LabelStoreMax/lib/pages/checkout_shipping_type.dart +++ b/LabelStoreMax/lib/pages/checkout_shipping_type.dart @@ -115,23 +115,45 @@ class _CheckoutShippingTypePageState extends State { } if (_shipping.methods.freeShipping != null) { - _shipping.methods.freeShipping + List freeShipping = _shipping.methods.freeShipping .where((t) => t != null) - .toList() - .forEach((freeShipping) { - if (isNumeric(freeShipping.cost) || - freeShipping.cost == 'min_amount') { + .toList(); + + for (int i = 0; i < freeShipping.length; i++) { + if (isNumeric(freeShipping[i].cost) || + freeShipping[i].cost == 'min_amount') { + + if (freeShipping[i].cost == 'min_amount') { + String total = await Cart.getInstance.getTotal(); + if (total != null) { + double doubleTotal = double.parse(total); + double doubleMinimumValue = + double.parse(freeShipping[i].minimumOrderAmount); + + if (doubleTotal < doubleMinimumValue) { + continue; + } + } + } + Map tmpShippingOption = {}; tmpShippingOption = { - "id": freeShipping.id, + "id": freeShipping[i].id, "method_id": "free_shipping", - "title": freeShipping.title, + "title": freeShipping[i].title, "cost": "0.00", - "min_amount": freeShipping.minimumOrderAmount, - "object": freeShipping + "min_amount": freeShipping[i].minimumOrderAmount, + "object": freeShipping[i] }; _wsShippingOptions.add(tmpShippingOption); } + } + + _shipping.methods.freeShipping + .where((t) => t != null) + .toList() + .forEach((freeShipping) async { + }); } } diff --git a/LabelStoreMax/lib/pages/home.dart b/LabelStoreMax/lib/pages/home.dart index 5b61c02..db4a23c 100644 --- a/LabelStoreMax/lib/pages/home.dart +++ b/LabelStoreMax/lib/pages/home.dart @@ -60,7 +60,7 @@ class _HomePageState extends State { _fetchCategories() async { _categories = - await appWooSignal((api) => api.getProductCategories(page: 100)); + await appWooSignal((api) => api.getProductCategories(perPage: 100)); } _fetchMoreProducts() async { diff --git a/LabelStoreMax/pubspec.yaml b/LabelStoreMax/pubspec.yaml index 3e6cb53..89176c4 100644 --- a/LabelStoreMax/pubspec.yaml +++ b/LabelStoreMax/pubspec.yaml @@ -1,5 +1,5 @@ # Label StoreMax -# Version 2.1.0 +# Version 2.1.1 #authors: - "Anthony Gordon" #documentation: https://woosignal.com/docs/app/ios/label-storemax #homepage: https://woosignal.com/ diff --git a/README.md b/README.md index 2522dc0..42b3670 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v2.1.0 +### Label StoreMax - v2.1.1 [Official WooSignal WooCommerce App](https://woosignal.com)