I am trying to upgrade from 1.6 to 1.7 as 1.7 has a bug487 fixed( which is to carry over the item attributes during cart merge) and Tax changes in 1.7.
I noticed there were quiet a few changes made, one change I see is below, my question is why would this method need a full blown object of Sku, Product, Category. I was wondering why cannot an ID of these objects suffice. In 1.6 I use to do as below, to get the DiscreteOrderITemRequest directly.
Code: Select all
cartService.createDiscreteOrderItemRequest(addToCartItem.getSkuId(),
addToCartItem.getProductId(),
addToCartItem.getCategoryId(),
addToCartItem.getQuantity());
I see that now in 1.7,( code snippet pasted below), instead of ID's I would now need to get the product using the id... etc and create DiscreteOrderItem and then pass this to create the DiscreteOrderItemRequest
Code: Select all
protected DiscreteOrderItem createDiscreteOrderItem(Sku sku, Product product, Category category, int quantity, Map<String,String> itemAttributes) {
what I did not understand is why number of layers and why can't just the ID's act as input. Also the method is protected which means I cannot access this method to create the DiscreteOrderItem.
with 1.7 how can I create a BundleOrder and add Discrete orders to it?
Any help on this greatly appreciated