Commit b4954e8e by 孙昱

sunyu::update::fix bug about add singleSpec product to multipleSpec product

parent aea4eb17
......@@ -1047,7 +1047,8 @@ public class ShoppingCartMCoffeeServiceImpl {
allCartGoodsList.forEach(oldCartGoods -> {
int index;
if ((index = nowCartGoodsList.indexOf(oldCartGoods)) >= 0) {
if (nowCartGoodsList.get(index).getSpuId().equals(oldCartGoods.getSpuId())){
if (nowCartGoodsList.get(index).getSpuId().equals(oldCartGoods.getSpuId())
&& nowCartGoodsList.get(index).getSkuId().equals(oldCartGoods.getSkuId())){
nowCartGoodsList.get(index).setQty(nowCartGoodsList.get(index).getQty() + addCartGoods.getQty());
}else{
nowCartGoodsList.add(oldCartGoods);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment