Understanding Product Promotions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Understanding Product Promotions

Vikas Mayur-2
I was exploring the code flow for product promotions, being applied when a
product is added to the cart through ordermgr.
Can any one help me out where the flow goes after
>>  2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
ShoppingCartHelper.java:173:INFO ] parent productid null
so that I could reach to the code which is finally doing adjustments
(Promotions)
Please refer to the log below.

2007-12-14 16:31:29,021 (http-0.0.0.0-8443-Processor4) [
RequestHandler.java:243:INFO ] [Processing Request]: additem sessionId=
811E8557E6181FEC12CEDAA6EA3C6F04.jvm1
2007-12-14 16:31:29,023 (http-0.0.0.0-8443-Processor4 ) [
ShoppingCartEvents.java:166:INFO ] adding item product WG-1111
2007-12-14 16:31:29,023 (http-0.0.0.0-8443-Processor4) [
ShoppingCartEvents.java:167:INFO ] adding item parent product null
2007-12-14 16:31:29,028 ( http-0.0.0.0-8443-Processor4) [
ProductStoreWorker.java:484:INFO ] getSurvey for product WG-1111
2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
ShoppingCartHelper.java:172:INFO ] carthelper productid WG-1111
2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
ShoppingCartHelper.java:173:INFO ] parent productid null
2007-12-14 16:31:29,207 (http-0.0.0.0-8443-Processor4) [
GenericEntity.java:408:WARN ] In entity field [ OrderAdjustment.amount] set
the value passed in [java.math.BigDecimal] is not compatible with the Java
type of the field [Double]
2007-12-14 16:31:29,210 (http-0.0.0.0-8443-Processor4) [
GenericEntity.java:408:WARN ] In entity field [ OrderAdjustment.amount] set
the value passed in [java.math.BigDecimal] is not compatible with the Java
type of the field [Double]

Thank you,
--
Vikas Mayur
Reply | Threaded
Open this post in threaded view
|

Re: Understanding Product Promotions

Scott Gray
Hi Vikas

Most of the action takes place here:
applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

I think from memory that runProductPromos is the entry point you're looking
for.  If you add a breakpoint to that you should be able to see what called
it.

Regards
Scott

On 15/12/2007, Vikas Mayur <[hidden email]> wrote:

>
> I was exploring the code flow for product promotions, being applied when a
> product is added to the cart through ordermgr.
> Can any one help me out where the flow goes after
> >>  2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
> ShoppingCartHelper.java:173:INFO ] parent productid null
> so that I could reach to the code which is finally doing adjustments
> (Promotions)
> Please refer to the log below.
>
> 2007-12-14 16:31:29,021 (http-0.0.0.0-8443-Processor4) [
> RequestHandler.java:243:INFO ] [Processing Request]: additem sessionId=
> 811E8557E6181FEC12CEDAA6EA3C6F04.jvm1
> 2007-12-14 16:31:29,023 (http-0.0.0.0-8443-Processor4 ) [
> ShoppingCartEvents.java:166:INFO ] adding item product WG-1111
> 2007-12-14 16:31:29,023 (http-0.0.0.0-8443-Processor4) [
> ShoppingCartEvents.java:167:INFO ] adding item parent product null
> 2007-12-14 16:31:29,028 ( http-0.0.0.0-8443-Processor4) [
> ProductStoreWorker.java:484:INFO ] getSurvey for product WG-1111
> 2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
> ShoppingCartHelper.java:172:INFO ] carthelper productid WG-1111
> 2007-12-14 16:31:29,033 (http-0.0.0.0-8443-Processor4) [
> ShoppingCartHelper.java:173:INFO ] parent productid null
> 2007-12-14 16:31:29,207 (http-0.0.0.0-8443-Processor4) [
> GenericEntity.java:408:WARN ] In entity field [ OrderAdjustment.amount]
> set
> the value passed in [java.math.BigDecimal] is not compatible with the Java
> type of the field [Double]
> 2007-12-14 16:31:29,210 (http-0.0.0.0-8443-Processor4) [
> GenericEntity.java:408:WARN ] In entity field [ OrderAdjustment.amount]
> set
> the value passed in [java.math.BigDecimal] is not compatible with the Java
> type of the field [Double]
>
> Thank you,
> --
> Vikas Mayur
>
Reply | Threaded
Open this post in threaded view
|

Re: Understanding Product Promotions

Bilgin Ibryam
In reply to this post by Vikas Mayur-2

Vikas,

If you follow the code you will that Scott is right.

Here are the main points when adding item to cart for a sales orders:

ShoppingCartHelper.addToCart
ShoppingCart.addOrIncreaseItem
ShoppingCartItem.makeItem
ShoppingCartItem.setQuantity


        // apply/unapply promotions
        if (triggerExternalOps) {
            ProductPromoWorker.doPromotions(cart, dispatcher);
        }

Bilgin
Reply | Threaded
Open this post in threaded view
|

Re: Understanding Product Promotions

Vikas Mayur-2
Thanks Bilgin, Scott.
This is the setQuantity method that I missed :)
I hope from now I will be able to set promotions as well.

Thanks again,



On Dec 15, 2007 4:37 PM, Bilgin Ibryam <[hidden email]> wrote:

>
>
> Vikas,
>
> If you follow the code you will that Scott is right.
>
> Here are the main points when adding item to cart for a sales orders:
>
> ShoppingCartHelper.addToCart
> ShoppingCart.addOrIncreaseItem
> ShoppingCartItem.makeItem
> ShoppingCartItem.setQuantity
>
>
>        // apply/unapply promotions
>        if (triggerExternalOps) {
>            ProductPromoWorker.doPromotions(cart, dispatcher);
>        }
>
> Bilgin
> --
> View this message in context:
> http://www.nabble.com/Understanding-Product-Promotions-tp14335493p14349849.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>


--
Vikas Mayur