• Welcome to KonaKart Community Forum. Please login or sign up.
 

temporary adddresses for checkout

Started by ryanlynch, September 18, 2008, 05:29:06 pm

Previous topic - Next topic

ryanlynch

Hello,
I would like to use "temporary addresses" for my shipping and billing addresses during checkout. Basically, to better explain, instead of giving the customer the option of adding or using existing addresses in their address book, I want to present two separate address forms --one on the shipping checkout page and one on the billing address page. I am assuming I can create new Address objects from each form, however, my question is: how do I bind these addresses to the order and then ensure they are no stored in the customer's address book?

Thank you

-Ryan

ryan

Get the order in the action class (kkAppEng.getOrderMgr().getCheckoutOrder()) and set the address attributes. e.g.

        checkoutOrder.setBillingCompany();
        checkoutOrder.setBillingStreetAddress();
        checkoutOrder.setBillingCity();

ryanlynch

Ah, thank you -- I see how it works now!

With the code I have available to me (that which is open source), is it possible for me to overload the Order custom fields?

ryan

I'm not quite sure what you are asking  ??? The custom fields can be used to store any information that is important to your business that hasn't been catered for directly by KonaKart.

ryanlynch

I understand, but there are only 5 custom fields on the order object and I have 7 separate checkboxes on the order checkout pages. I was hoping to store them as separate fields in the order object so they will easily persist across checkout pages. For example, in the JSP I could do this:

<html:checkbox name="order" property="custom4" value="<%=order.getCustom4%>"/>
<html:checkbox name="order" property="custom5" value="<%=order.getCustom5%>"/>

The problem comes into play when my custom requirements exceed 5 fields. Therefore, it would be nice to use Java overloading on the custom fields.

Hope that makes more sense :)

Thanks!


ryan

I understand now   :)

I'm afraid that you can't just create more since it has implications inside the engine and in the database. Normally what people do is to group them together using some delimiter and some extra logic during reads and writes. If you require them to be longer than varchar(128), this can be achieved using an alter table on the DB.

I've even seen people serialize objects into XML and store those in the custom fields.

ryanlynch

Ah, ok. I will use a deliminator and parse the strings when I need to read them.
Thank you for the response.

-Ryan

ryanlynch

I have used your suggested method of using:

checkoutOrder.setDeliveryCity(localForm.getCity());
checkoutOrder.setDeliveryName(localForm.getCity());

etc...

It seems to be working because it's storing everything correctly in the database and display correct in the Admin invoice tool.

However, the order confirmation page uses:

checkoutOrder.getDeliveryFormattedAddress()

How do I create this formattedAddress and set it from the delivery and shipping values I have set??

Thanks!