Commit 4060b94d by Tuomas Riihimäki

Automatically added product can not be only product bought.

1 parent 705f45f5
...@@ -44,6 +44,7 @@ import fi.codecrew.moya.model.EventUser; ...@@ -44,6 +44,7 @@ import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEventProperty; import fi.codecrew.moya.model.LanEventProperty;
import fi.codecrew.moya.model.LanEventPropertyKey; import fi.codecrew.moya.model.LanEventPropertyKey;
import fi.codecrew.moya.model.Product; import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.model.ProductFlag;
import fi.codecrew.moya.model.ReaderEvent; import fi.codecrew.moya.model.ReaderEvent;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.cdiview.reader.ReaderView; import fi.codecrew.moya.web.cdiview.reader.ReaderView;
...@@ -398,7 +399,9 @@ public class ProductShopView extends GenericCDIView { ...@@ -398,7 +399,9 @@ public class ProductShopView extends GenericCDIView {
private boolean productsInCart() { private boolean productsInCart() {
Iterator<ProductShopItem> nullcheckIter = shoppingcart.iterator(); Iterator<ProductShopItem> nullcheckIter = shoppingcart.iterator();
while (nullcheckIter.hasNext()) { while (nullcheckIter.hasNext()) {
if (nullcheckIter.next().getCount().compareTo(BigDecimal.ZERO) > 0) { ProductShopItem prod = nullcheckIter.next();
// Autoproduct is not counted as a real product.
if (!prod.getProduct().getProductFlags().contains(ProductFlag.USERSHOP_AUTOPRODUCT) && prod.getCount().compareTo(BigDecimal.ZERO) > 0) {
return true; return true;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!