the price of an object and the cart object

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

the price of an object and the cart object

Heidi Dehaes - Olagos
Hello,

Can anyone give me a hint on how the price which is visualised at a product
in the ecommerce site comes into the cart object for visualisation on the
cart.
I know it is sent via a form into the "additem" request. Via the controller
it goes to the "addToCart" method in the ShoppingCartEvents.java file and
in that method there it goes via the call "cartHelper.addToCart" further.
But i don't see in detail where the price of the product goes into the cart
object.

Can anyone help me? I don't find it immediately.

Thanks in advance,
Eric


Olagos bvba
Heidi Dehaes
Kerkstraat 34
2570 Duffel
Belgium
Tel. :     015/31 53 04
GSM :    0485/22 35 80
E-mail : [hidden email]
http://www.olagos.eu
http://www.olagos.com
http://www.olagos.be
http://www.olagos.nl
Reply | Threaded
Open this post in threaded view
|

Re: the price of an object and the cart object

taher
First of all, just to get it out of my system, this method is 500
lines long .. OUCH! The file itself is 2000 lines long. We got to
refactor the entire damn thing.

From what I see the cartHelper.addToCart(...) method takes 21
arguments (ouch again) one of them being the price. The price itself
is set from a priceStr variable in the code snippet:

price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr,
"BigDecimal", null, locale);

And priceStr itself is set with:

priceStr = (String) paramMap.remove("PRICE")

I hope I got things right, maybe others can help if I missed something.

On Tue, Jun 27, 2017 at 9:54 PM, Heidi Dehaes - Olagos
<[hidden email]> wrote:

> Hello,
>
> Can anyone give me a hint on how the price which is visualised at a product
> in the ecommerce site comes into the cart object for visualisation on the
> cart.
> I know it is sent via a form into the "additem" request. Via the controller
> it goes to the "addToCart" method in the ShoppingCartEvents.java file and
> in that method there it goes via the call "cartHelper.addToCart" further.
> But i don't see in detail where the price of the product goes into the cart
> object.
>
> Can anyone help me? I don't find it immediately.
>
> Thanks in advance,
> Eric
>
>
> Olagos bvba
> Heidi Dehaes
> Kerkstraat 34
> 2570 Duffel
> Belgium
> Tel. :     015/31 53 04
> GSM :    0485/22 35 80
> E-mail : [hidden email]
> http://www.olagos.eu
> http://www.olagos.com
> http://www.olagos.be
> http://www.olagos.nl
Reply | Threaded
Open this post in threaded view
|

Re: the price of an object and the cart object

Deepak Dixit-3
Hi Heidi Dehaes,

ShoppingCartItem price set from ShoppingCartItem.updatePrice method.

ShoppingCart.addOrIncreaseItem calls the sci.setQuantityand
ShoppingCartItem.setQuantity calls the ShoppingCartItem.updatePrice

and it calls the calculateProductPrice service to get the product price.


for addItem flow its for CSR user, if CSR want to override the price for an
item then CSR can set it. It should be permission driven, IF user has
permission to modify system generated price then only user can modify it.




Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com
www.hotwax.co

On Wed, Jun 28, 2017 at 1:01 PM, Taher Alkhateeb <[hidden email]
> wrote:

> First of all, just to get it out of my system, this method is 500
> lines long .. OUCH! The file itself is 2000 lines long. We got to
> refactor the entire damn thing.
>
> From what I see the cartHelper.addToCart(...) method takes 21
> arguments (ouch again) one of them being the price. The price itself
> is set from a priceStr variable in the code snippet:
>
> price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr,
> "BigDecimal", null, locale);
>
> And priceStr itself is set with:
>
> priceStr = (String) paramMap.remove("PRICE")
>
> I hope I got things right, maybe others can help if I missed something.
>
> On Tue, Jun 27, 2017 at 9:54 PM, Heidi Dehaes - Olagos
> <[hidden email]> wrote:
> > Hello,
> >
> > Can anyone give me a hint on how the price which is visualised at a
> product
> > in the ecommerce site comes into the cart object for visualisation on the
> > cart.
> > I know it is sent via a form into the "additem" request. Via the
> controller
> > it goes to the "addToCart" method in the ShoppingCartEvents.java file and
> > in that method there it goes via the call "cartHelper.addToCart" further.
> > But i don't see in detail where the price of the product goes into the
> cart
> > object.
> >
> > Can anyone help me? I don't find it immediately.
> >
> > Thanks in advance,
> > Eric
> >
> >
> > Olagos bvba
> > Heidi Dehaes
> > Kerkstraat 34
> > 2570 Duffel
> > Belgium
> > Tel. :     015/31 53 04
> > GSM :    0485/22 35 80
> > E-mail : [hidden email]
> > http://www.olagos.eu
> > http://www.olagos.com
> > http://www.olagos.be
> > http://www.olagos.nl
>
Reply | Threaded
Open this post in threaded view
|

Re: the price of an object and the cart object

Heidi Dehaes - Olagos
Thanks Deepak,

I will investigate it further.
I seems understandable.

Regards,
Eric

Olagos bvba
Heidi Dehaes
Kerkstraat 34
2570 Duffel
Belgium
Tel. :     015/31 53 04
GSM :    0485/22 35 80
E-mail : [hidden email]
http://www.olagos.eu
http://www.olagos.com
http://www.olagos.be
http://www.olagos.nl



2017-06-28 10:01 GMT+02:00 Deepak Dixit <[hidden email]>:

> Hi Heidi Dehaes,
>
> ShoppingCartItem price set from ShoppingCartItem.updatePrice method.
>
> ShoppingCart.addOrIncreaseItem calls the sci.setQuantityand
> ShoppingCartItem.setQuantity calls the ShoppingCartItem.updatePrice
>
> and it calls the calculateProductPrice service to get the product price.
>
>
> for addItem flow its for CSR user, if CSR want to override the price for an
> item then CSR can set it. It should be permission driven, IF user has
> permission to modify system generated price then only user can modify it.
>
>
>
>
> Thanks & Regards
> --
> Deepak Dixit
> www.hotwaxsystems.com
> www.hotwax.co
>
> On Wed, Jun 28, 2017 at 1:01 PM, Taher Alkhateeb <
> [hidden email]
> > wrote:
>
> > First of all, just to get it out of my system, this method is 500
> > lines long .. OUCH! The file itself is 2000 lines long. We got to
> > refactor the entire damn thing.
> >
> > From what I see the cartHelper.addToCart(...) method takes 21
> > arguments (ouch again) one of them being the price. The price itself
> > is set from a priceStr variable in the code snippet:
> >
> > price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr,
> > "BigDecimal", null, locale);
> >
> > And priceStr itself is set with:
> >
> > priceStr = (String) paramMap.remove("PRICE")
> >
> > I hope I got things right, maybe others can help if I missed something.
> >
> > On Tue, Jun 27, 2017 at 9:54 PM, Heidi Dehaes - Olagos
> > <[hidden email]> wrote:
> > > Hello,
> > >
> > > Can anyone give me a hint on how the price which is visualised at a
> > product
> > > in the ecommerce site comes into the cart object for visualisation on
> the
> > > cart.
> > > I know it is sent via a form into the "additem" request. Via the
> > controller
> > > it goes to the "addToCart" method in the ShoppingCartEvents.java file
> and
> > > in that method there it goes via the call "cartHelper.addToCart"
> further.
> > > But i don't see in detail where the price of the product goes into the
> > cart
> > > object.
> > >
> > > Can anyone help me? I don't find it immediately.
> > >
> > > Thanks in advance,
> > > Eric
> > >
> > >
> > > Olagos bvba
> > > Heidi Dehaes
> > > Kerkstraat 34
> > > 2570 Duffel
> > > Belgium
> > > Tel. :     015/31 53 04
> > > GSM :    0485/22 35 80
> > > E-mail : [hidden email]
> > > http://www.olagos.eu
> > > http://www.olagos.com
> > > http://www.olagos.be
> > > http://www.olagos.nl
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: the price of an object and the cart object

Heidi Dehaes - Olagos
In reply to this post by taher
Thanks Taher,

But i need specially to know where cart.price = price is set.

Deepak gave me also more information.

Thanks,
Eric

Olagos bvba
Heidi Dehaes
Kerkstraat 34
2570 Duffel
Belgium
Tel. :     015/31 53 04
GSM :    0485/22 35 80
E-mail : [hidden email]
http://www.olagos.eu
http://www.olagos.com
http://www.olagos.be
http://www.olagos.nl



2017-06-28 9:31 GMT+02:00 Taher Alkhateeb <[hidden email]>:

> First of all, just to get it out of my system, this method is 500
> lines long .. OUCH! The file itself is 2000 lines long. We got to
> refactor the entire damn thing.
>
> From what I see the cartHelper.addToCart(...) method takes 21
> arguments (ouch again) one of them being the price. The price itself
> is set from a priceStr variable in the code snippet:
>
> price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr,
> "BigDecimal", null, locale);
>
> And priceStr itself is set with:
>
> priceStr = (String) paramMap.remove("PRICE")
>
> I hope I got things right, maybe others can help if I missed something.
>
> On Tue, Jun 27, 2017 at 9:54 PM, Heidi Dehaes - Olagos
> <[hidden email]> wrote:
> > Hello,
> >
> > Can anyone give me a hint on how the price which is visualised at a
> product
> > in the ecommerce site comes into the cart object for visualisation on the
> > cart.
> > I know it is sent via a form into the "additem" request. Via the
> controller
> > it goes to the "addToCart" method in the ShoppingCartEvents.java file and
> > in that method there it goes via the call "cartHelper.addToCart" further.
> > But i don't see in detail where the price of the product goes into the
> cart
> > object.
> >
> > Can anyone help me? I don't find it immediately.
> >
> > Thanks in advance,
> > Eric
> >
> >
> > Olagos bvba
> > Heidi Dehaes
> > Kerkstraat 34
> > 2570 Duffel
> > Belgium
> > Tel. :     015/31 53 04
> > GSM :    0485/22 35 80
> > E-mail : [hidden email]
> > http://www.olagos.eu
> > http://www.olagos.com
> > http://www.olagos.be
> > http://www.olagos.nl
>
Reply | Threaded
Open this post in threaded view
|

Re: the price of an object and the cart object

Heidi Dehaes - Olagos
In reply to this post by Deepak Dixit-3
Hi Deepak,

Thanks again. I was blocked on ShoppingCart.addOrIncreaseItem . Then i
couldn't find it further.

I will investigate it this evening.

Regards,
Eric

Olagos bvba
Heidi Dehaes
Kerkstraat 34
2570 Duffel
Belgium
Tel. :     015/31 53 04
GSM :    0485/22 35 80
E-mail : [hidden email]
http://www.olagos.eu
http://www.olagos.com
http://www.olagos.be
http://www.olagos.nl



2017-06-28 10:01 GMT+02:00 Deepak Dixit <[hidden email]>:

> Hi Heidi Dehaes,
>
> ShoppingCartItem price set from ShoppingCartItem.updatePrice method.
>
> ShoppingCart.addOrIncreaseItem calls the sci.setQuantityand
> ShoppingCartItem.setQuantity calls the ShoppingCartItem.updatePrice
>
> and it calls the calculateProductPrice service to get the product price.
>
>
> for addItem flow its for CSR user, if CSR want to override the price for an
> item then CSR can set it. It should be permission driven, IF user has
> permission to modify system generated price then only user can modify it.
>
>
>
>
> Thanks & Regards
> --
> Deepak Dixit
> www.hotwaxsystems.com
> www.hotwax.co
>
> On Wed, Jun 28, 2017 at 1:01 PM, Taher Alkhateeb <
> [hidden email]
> > wrote:
>
> > First of all, just to get it out of my system, this method is 500
> > lines long .. OUCH! The file itself is 2000 lines long. We got to
> > refactor the entire damn thing.
> >
> > From what I see the cartHelper.addToCart(...) method takes 21
> > arguments (ouch again) one of them being the price. The price itself
> > is set from a priceStr variable in the code snippet:
> >
> > price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr,
> > "BigDecimal", null, locale);
> >
> > And priceStr itself is set with:
> >
> > priceStr = (String) paramMap.remove("PRICE")
> >
> > I hope I got things right, maybe others can help if I missed something.
> >
> > On Tue, Jun 27, 2017 at 9:54 PM, Heidi Dehaes - Olagos
> > <[hidden email]> wrote:
> > > Hello,
> > >
> > > Can anyone give me a hint on how the price which is visualised at a
> > product
> > > in the ecommerce site comes into the cart object for visualisation on
> the
> > > cart.
> > > I know it is sent via a form into the "additem" request. Via the
> > controller
> > > it goes to the "addToCart" method in the ShoppingCartEvents.java file
> and
> > > in that method there it goes via the call "cartHelper.addToCart"
> further.
> > > But i don't see in detail where the price of the product goes into the
> > cart
> > > object.
> > >
> > > Can anyone help me? I don't find it immediately.
> > >
> > > Thanks in advance,
> > > Eric
> > >
> > >
> > > Olagos bvba
> > > Heidi Dehaes
> > > Kerkstraat 34
> > > 2570 Duffel
> > > Belgium
> > > Tel. :     015/31 53 04
> > > GSM :    0485/22 35 80
> > > E-mail : [hidden email]
> > > http://www.olagos.eu
> > > http://www.olagos.com
> > > http://www.olagos.be
> > > http://www.olagos.nl
> >
>