Skip to content

Commit cff2af7

Browse files
committed
remove price sorting in encoded codes
1 parent 995d878 commit cff2af7

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.14.8]
5+
- Removed sorting by price in encodedCodes
6+
47
## [0.14.7]
58

69
### Changes

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ allprojects {
2323
}
2424

2525
project.ext {
26-
sdkVersion='0.14.7'
26+
sdkVersion='0.14.8'
2727
versionCode=1
2828

2929
compileSdkVersion=28

core/src/main/java/io/snabble/sdk/encodedcodes/EncodedCodesGenerator.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,6 @@ private void addProducts(final ShoppingCart shoppingCart, boolean ageRestricted)
111111
item.getScannedCode()));
112112
}
113113

114-
Collections.sort(productInfos, new Comparator<ProductInfo>() {
115-
@Override
116-
public int compare(ProductInfo p1, ProductInfo p2) {
117-
int price1 = p1.product.getPrice(options.project.getCustomerCardId());
118-
if (p1.scannedCode.hasPrice()) {
119-
price1 = p1.scannedCode.getPrice();
120-
}
121-
122-
int price2 = p2.product.getPrice(options.project.getCustomerCardId());
123-
if (p2.scannedCode.hasPrice()) {
124-
price2 = p2.scannedCode.getPrice();
125-
}
126-
127-
if (price1 < price2) {
128-
return -1;
129-
} else if (price1 > price2) {
130-
return 1;
131-
}
132-
133-
return 0;
134-
}
135-
});
136-
137114
for (ProductInfo productInfo : productInfos) {
138115
if (ageRestricted != isAgeRestricted(productInfo.product)) {
139116
continue;

0 commit comments

Comments
 (0)