Skip to content

Commit b2df6c5

Browse files
committed
v2.3.0 updates, dependancy version bump and bug fixes
1 parent cdb34c7 commit b2df6c5

File tree

9 files changed

+54
-46
lines changed

9 files changed

+54
-46
lines changed

LabelStoreMax/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [2.3.0] - 2020-11-18
2+
3+
* Option to set if prices include tax
4+
* Pubspec.yaml dependency updates
5+
* Bug fixes
6+
17
## [2.2.2] - 2020-10-30
28

39
* Bug fix for Android build

LabelStoreMax/flutter_application_id.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

LabelStoreMax/lib/labelconfig.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'dart:ui';
1616
Developer Notes
1717
1818
SUPPORT EMAIL - [email protected]
19-
VERSION - 2.2.2
19+
VERSION - 2.3.0
2020
https://woosignal.com
2121
*/
2222

@@ -38,7 +38,11 @@ const app_privacy_url = "https://yourdomain.com/privacy";
3838

3939
const app_currency_symbol = "";
4040
const app_currency_iso = "gbp";
41+
42+
const app_products_prices_include_tax = true;
43+
4144
const Locale app_locale = Locale('en');
45+
4246
const List<Locale> app_locales_supported = [
4347
Locale('en'),
4448
Locale('es'),

LabelStoreMax/lib/models/cart.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import 'dart:convert';
1212

1313
import 'package:label_storemax/helpers/shared_pref.dart';
14+
import 'package:label_storemax/labelconfig.dart';
1415
import 'package:label_storemax/models/cart_line_item.dart';
1516
import 'package:label_storemax/models/checkout_session.dart';
1617
import 'package:label_storemax/models/shipping_type.dart';
@@ -148,9 +149,10 @@ class Cart {
148149
cartItems.where((c) => c.taxStatus == 'taxable').toList();
149150
double cartSubtotal = 0;
150151

151-
if (taxableCartLines.length > 0) {
152+
if (app_products_prices_include_tax == false &&
153+
taxableCartLines.length > 0) {
152154
cartSubtotal = taxableCartLines
153-
.map<double>((m) => parseWcPrice(m.subtotal))
155+
.map<double>((m) => parseWcPrice(m.subtotal) * m.quantity)
154156
.reduce((a, b) => a + b);
155157
}
156158

LabelStoreMax/lib/pages/account_detail.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ class _AccountDetailPageState extends State<AccountDetailPage>
6262
];
6363
_tabController = TabController(vsync: this, length: _tabs.length);
6464
_activeBody = showAppLoader();
65-
_fetchWpUserData();
66-
_fetchOrders();
65+
this.init();
66+
}
67+
68+
init() async {
69+
await _fetchWpUserData();
70+
await _fetchOrders();
6771
}
6872

6973
_fetchWpUserData() async {

LabelStoreMax/lib/pages/cart.dart

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,24 @@ class _CartPageState extends State<CartPage> {
8080
return;
8181
}
8282
if (cartLineItems.length <= 0) {
83-
showEdgeAlertWith(context,
84-
title: trans(context, "Cart"),
85-
desc: trans(context,
86-
trans(context, "You need items in your cart to checkout")),
87-
style: EdgeAlertStyle.WARNING,
88-
icon: Icons.shopping_cart);
83+
showEdgeAlertWith(
84+
context,
85+
title: trans(context, "Cart"),
86+
desc: trans(context, "You need items in your cart to checkout"),
87+
style: EdgeAlertStyle.WARNING,
88+
icon: Icons.shopping_cart,
89+
);
8990
return;
9091
}
9192
if (!cartLineItems.every(
9293
(c) => c.stockStatus == 'instock' || c.stockStatus == 'onbackorder')) {
93-
showEdgeAlertWith(context,
94-
title: trans(context, "Cart"),
95-
desc: trans(context, trans(context, "There is an item out of stock")),
96-
style: EdgeAlertStyle.WARNING,
97-
icon: Icons.shopping_cart);
94+
showEdgeAlertWith(
95+
context,
96+
title: trans(context, "Cart"),
97+
desc: trans(context, "There is an item out of stock"),
98+
style: EdgeAlertStyle.WARNING,
99+
icon: Icons.shopping_cart,
100+
);
98101
return;
99102
}
100103
CheckoutSession.getInstance.initSession();
@@ -120,7 +123,7 @@ class _CartPageState extends State<CartPage> {
120123
showEdgeAlertWith(
121124
context,
122125
title: trans(context, "Cart"),
123-
desc: trans(context, trans(context, "Maximum stock reached")),
126+
desc: trans(context, "Maximum stock reached"),
124127
style: EdgeAlertStyle.WARNING,
125128
icon: Icons.shopping_cart,
126129
);
@@ -187,8 +190,10 @@ class _CartPageState extends State<CartPage> {
187190
splashColor: Colors.transparent,
188191
child: Align(
189192
child: Padding(
190-
child: Text(trans(context, "Clear Cart"),
191-
style: Theme.of(context).primaryTextTheme.bodyText1),
193+
child: Text(
194+
trans(context, "Clear Cart"),
195+
style: Theme.of(context).primaryTextTheme.bodyText1,
196+
),
192197
padding: EdgeInsets.only(right: 8),
193198
),
194199
alignment: Alignment.centerLeft,
@@ -217,10 +222,11 @@ class _CartPageState extends State<CartPage> {
217222
color: Colors.black45,
218223
),
219224
Padding(
220-
child: Text(trans(context, "Empty Basket"),
221-
style: Theme.of(context)
222-
.primaryTextTheme
223-
.bodyText2),
225+
child: Text(
226+
trans(context, "Empty Basket"),
227+
style:
228+
Theme.of(context).primaryTextTheme.bodyText2,
229+
),
224230
padding: EdgeInsets.only(top: 10),
225231
)
226232
],
@@ -266,9 +272,11 @@ class _CartPageState extends State<CartPage> {
266272
return Text("");
267273
else
268274
return new Padding(
269-
child: wsRow2Text(context,
270-
text1: trans(context, "Total"),
271-
text2: (_isLoading ? "" : snapshot.data)),
275+
child: wsRow2Text(
276+
context,
277+
text1: trans(context, "Total"),
278+
text2: (_isLoading ? "" : snapshot.data),
279+
),
272280
padding: EdgeInsets.only(bottom: 15, top: 15),
273281
);
274282
}

LabelStoreMax/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ packages:
676676
name: wp_json_api
677677
url: "https://pub.dartlang.org"
678678
source: hosted
679-
version: "0.1.4"
679+
version: "2.0.0"
680680
xdg_directories:
681681
dependency: transitive
682682
description:

LabelStoreMax/pubspec.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
# Official WooSignal App Template for WooCommerce
22

33
# Label StoreMax
4-
# Version 2.2.2
4+
# Version 2.3.0
55
# Homepage: https://woosignal.com
66
# Author: Anthony Gordon <[email protected]>
77
# Documentation: https://woosignal.com/docs/app/ios/label-storemax
88

9-
### App Configuration
10-
# 1 Open: "lib/labelconfig.dart" and edit the variables
11-
# 2 Open: "flutter_application_id.yaml" and update package name and display name
12-
139
### Change App Icon
1410
# 1 Replace: assets/icon/appicon.png (1024px1024px icon size)
1511
# 2 Run this command from terminal: "flutter pub run flutter_launcher_icons:main"
@@ -30,7 +26,7 @@ dependencies:
3026
woosignal: ^1.2.1
3127
woosignal_stripe: ^0.0.6
3228
razorpay_flutter: ^1.2.2
33-
wp_json_api: ^0.1.4
29+
wp_json_api: ^2.0.0
3430
shared_preferences: ^0.5.12
3531
cached_network_image: ^2.3.3
3632
page_transition: ^1.1.7+2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# WooCommerce App: Label StoreMax
66

7-
### Label StoreMax - v2.2.2
7+
### Label StoreMax - v2.3.0
88

99

1010
[Official WooSignal WooCommerce App](https://woosignal.com)

0 commit comments

Comments
 (0)