Page 1 of 1

1.7 version -createDiscreteOrderItem question/issue

Posted: Sat Jun 02, 2012 12:23 pm
by sai
Hi
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

Re: 1.7 version -createDiscreteOrderItem question/issue

Posted: Mon Jun 04, 2012 8:00 am
by bpolster
As of today (June 4th, 2012, 1.7 is in early development and should not be considered stable for development). The defect that you mention will also be ported back to 1.6 and you can expect 1.6.2 to be out sometime this week with a fix for merge-cart.

We are completely reworking bundles within the development branch. We will try our best to maintain backward compatibility. If you are early in your development cycle, you can take a look at the new ProductBundle entity which will give you some insight into where we are headed. We will still support programmatic bundles in a manner similar to 1.6.

Also, we are introducing a ProductOption concept in the development branch which will better support multi-skud products (e.g. t-shirt).

Re: 1.7 version -createDiscreteOrderItem question/issue

Posted: Tue Jun 05, 2012 10:56 pm
by sai
Thank you for the insights and placing fixes in 1.6.

I have one quick question. Will you be updating 1.6 with the Tax changes as well

Re: 1.7 version -createDiscreteOrderItem question/issue

Posted: Wed Jun 06, 2012 10:15 am
by aazzolini
Sai, at this time, I don't believe we are indenting to backport the tax changes.