Subversion Repositories SmartDukaan

Rev

Rev 5456 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5456 Rev 5464
Line 261... Line 261...
261
			if(cart == null) {
261
			if(cart == null) {
262
				log.error("No cart found for Id : " + cartId);
262
				log.error("No cart found for Id : " + cartId);
263
				throw new ShoppingCartException(101, "no cart attached to this id");
263
				throw new ShoppingCartException(101, "no cart attached to this id");
264
			}
264
			}
265
			for(in.shop2020.user.domain.Line line : cart.getLines()) {
265
			for(in.shop2020.user.domain.Line line : cart.getLines()) {
266
				cartMapper.removeLineDiscount(line.getCart_id(), line.getItem_id());
266
				cartMapper.removeLineDiscount(cart.getId(), line.getItem_id());
267
			}
267
			}
268
			
268
			
269
			deleteDiscountsFromCart(cart.getId());
269
			deleteDiscountsFromCart(cart.getId());
270
		    cart.setDiscounted_price(0);
270
		    cart.setDiscounted_price(0);
271
		    cart.setCoupon_code(null);
271
		    cart.setCoupon_code(null);
Line 379... Line 379...
379
				log.error("No cart found for Id : "+cartId);
379
				log.error("No cart found for Id : "+cartId);
380
				throw new ShoppingCartException(101, "No cart found for Id : "+cartId);
380
				throw new ShoppingCartException(101, "No cart found for Id : "+cartId);
381
			}
381
			}
382
			if(cart.getLines()!=null && !cart.getLines().isEmpty()) {
382
			if(cart.getLines()!=null && !cart.getLines().isEmpty()) {
383
				for(in.shop2020.user.domain.Line line : cart.getLines()) {
383
				for(in.shop2020.user.domain.Line line : cart.getLines()) {
384
					deleteDiscountsForLine(line.getCart_id(), line.getItem_id());
384
					deleteDiscountsForLine(cart.getId(), line.getItem_id());
385
				}
385
				}
386
			} else {
386
			} else {
387
				log.info("No lines found for cart : " + cartId);
387
				log.info("No lines found for cart : " + cartId);
388
			}
388
			}
389
		} catch(Exception e) {
389
		} catch(Exception e) {