WebSphere Commerce suite - How to save extra Attributes of Product in Session?

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Commerce suite > December 2005 > How to save extra Attributes of Product in Session?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to save extra Attributes of Product in Session?

2005-12-14, 2:55 am

Hi all,

I need to save extra attributes for a product, which can be input as a textfield (not a drop down as normal attribute), I need to add them in session so I can get them in OrderProcessCmd. Any Idea what should I do? I tried to forward it in responsePropert
ies off all the susequent pages (from ProductDisplay to OrderProcess) but I think it is not appropriate?

Best Regards,
Aziz Ahmed Khan
Royal Cyber Inc.
Robert Brown

2005-12-14, 2:55 am

Why not store it in ORDERITEMS.FIELD2 (or another ORDERITEMS field that
is unused) when adding to the cart and retrieve from the database during
order processing? Any reason this has to be in a session? If so, I do
have some code around here somewhere for a command to access session
data by attribute name if you need it.

R

> Hi all,
>
> I need to save extra attributes for a product, which can be input as a textfield (not a drop down as normal attribute), I need to add them in session so I can get them in OrderProcessCmd. Any Idea what should I do? I tried to forward it in responsePrope

rties off all the susequent pages (from ProductDisplay to OrderProcess) but I think it is not appropriate?
>
> Best Regards,
> Aziz Ahmed Khan
> Royal Cyber Inc.

2005-12-14, 2:55 am

I want to send email to customer as a product (a soft good). I have to save To, From and Email content and there may be some additional attribute also. I dont think that there are so many extra field.
I also found a code snippest for getting session
HttpSession session =
((com.ibm.commerce.webcontroller. HttpControllerRequestObject)getCommandCo
ntext().getRequest())
.getHttpRequest().getSession();

Tell me if it is appropriate and send me ur code snippest.

Best Regards

Robert Brown

2005-12-14, 8:51 pm

That creates you a session object...I prefer a custom getter. If you
have many session objects perhaps having a local session object can
speed things up.

protected String getMyVariable() { return (String)
((HttpControllerRequestObject)
getCommandContext().getRequest()).getHttpRequest().getSession().getAttribute("MyVariable");
}

R

> I want to send email to customer as a product (a soft good). I have to save To, From and Email content and there may be some additional attribute also. I dont think that there are so many extra field.
> I also found a code snippest for getting session
> HttpSession session =
> ((com.ibm.commerce.webcontroller. HttpControllerRequestObject)getCommandCo
ntext().getRequest())
> .getHttpRequest().getSession();
>
> Tell me if it is appropriate and send me ur code snippest.
>
> Best Regards
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com