Subversion Repositories SmartDukaan

Rev

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

Rev 11980 Rev 12616
Line 161... Line 161...
161
			} catch (Exception e) {
161
			} catch (Exception e) {
162
				log.error("Unable to create or add to cart because of: ", e);
162
				log.error("Unable to create or add to cart because of: ", e);
163
			}
163
			}
164
 
164
 
165
		}
165
		}
166
		DataLogger.logData(EventType.ADD_TO_CART, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
166
//		DataLogger.logData(EventType.ADD_TO_CART, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
167
				Long.toString(cartId), itemIds);
167
//				Long.toString(cartId), itemIds);
168
		return "success";
168
		return "success";
169
	}		
169
	}		
170
 
170
 
171
 
171
 
172
	// DELETE /entity
172
	// DELETE /entity
Line 181... Line 181...
181
		if(userinfo.getCartId() == -1)	{
181
		if(userinfo.getCartId() == -1)	{
182
			log.info("Cart does not exist. Nothing to delete.");
182
			log.info("Cart does not exist. Nothing to delete.");
183
		} else	{
183
		} else	{
184
			if(deleteItemFromCart(userinfo.getCartId(), itemId, userinfo.getUserId(), userinfo.isSessionId()))	{
184
			if(deleteItemFromCart(userinfo.getCartId(), itemId, userinfo.getUserId(), userinfo.isSessionId()))	{
185
				updateUserSessionInfo(userinfo.getCartId());
185
				updateUserSessionInfo(userinfo.getCartId());
186
				DataLogger.logData(EventType.DELETE_FROM_CART, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
186
//				DataLogger.logData(EventType.DELETE_FROM_CART, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
187
						Long.toString(userinfo.getCartId()), itemIdString);
187
//						Long.toString(userinfo.getCartId()), itemIdString);
188
				return "redirect";
188
				return "redirect";
189
			}
189
			}
190
		}
190
		}
191
		return "redirect";
191
		return "redirect";
192
	}
192
	}
Line 204... Line 204...
204
 
204
 
205
		if(quantity <= 0)	{
205
		if(quantity <= 0)	{
206
			log.info("Not valid item quantity. Unable to change item quantity.");
206
			log.info("Not valid item quantity. Unable to change item quantity.");
207
		} else	{
207
		} else	{
208
			if(updateItemQuantityInCart(userinfo.getCartId(), itemId, quantity))	{
208
			if(updateItemQuantityInCart(userinfo.getCartId(), itemId, quantity))	{
209
				DataLogger.logData(EventType.UPDATE_CART_QUANTITY, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
209
//				DataLogger.logData(EventType.UPDATE_CART_QUANTITY, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
210
						Long.toString(userinfo.getCartId()), Long.toString(itemId), Long.toString(quantity));
210
//						Long.toString(userinfo.getCartId()), Long.toString(itemId), Long.toString(quantity));
211
				return "redirect";
211
				return "redirect";
212
			}
212
			}
213
		}
213
		}
214
		DataLogger.logData(EventType.UPDATE_CART_QUANTITY_FAILED, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
214
//		DataLogger.logData(EventType.UPDATE_CART_QUANTITY_FAILED, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
215
				Long.toString(userinfo.getCartId()), Long.toString(itemId), Long.toString(quantity));
215
//				Long.toString(userinfo.getCartId()), Long.toString(itemId), Long.toString(quantity));
216
		addActionError("Unable to update the quantity");
216
		addActionError("Unable to update the quantity");
217
		return "redirect";
217
		return "redirect";
218
	}
218
	}
219
 
219
 
220
	public void printParams(){
220
	public void printParams(){