Forums / General Questions / Set default shipping adress when creating a new adress book entry.

Set default shipping adress when creating a new adress book entry.

Started by fehfeh on 15 Aug 2012, 8:40 AM · Views: 627

Results 1 to 2 of 2
15 Aug 2012, 8:40 AM
#1
fehfeh avatar

fehfeh

New Zenner

Join Date:
Feb 2012
Posts:
10
Plugin Contributions:
0

Set default shipping adress when creating a new adress book entry.

I'm surprised I didn't find any results when searching for this (or maybe I just didn't use the right terms).

By default, when a customers signs up, their primary adress is used for both shipping and billing. Many of our customers wants to use alternate shipping adresses and this is fine on the first checkout since they set it up, and it's used for shipping.

Whenever they return to complete a purchase, the billing/primary adress is also used for shipping and many fail to check this resulting in their products being sent to the wrong place. And we've had many requests for function that let's them choose default shipping and billing adresses individually so they don't have tho change the shipping adress everytime they complete a purchase.

Does anyone know a guide or module that does this, or can point me in the right direction to start?

In the databse, there is a field called customers_default_adress_id and this points to an adress in the adress_book table and is used as default for both shipping and billing. I imagine that they only way to fix my issue is to do this:

  1. Create a new column in the customers table and name it customers_default_shipping_adress_id
  2. Add a checkbox on the add adress page that pops up when they change the shipping adress, and at the page where you can add more adresses to your adress book (I guess they're the same page/template file though)
  3. Store that adress ID in the column in step 1
  4. On the checkout page, call the ID from step 3 from field in step 1 for the shipping adress

However, can I do these changes safely (adding the extra column) without f*ing up something else?

16 Aug 2012, 3:02 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Set default shipping adress when creating a new adress book entry.

Those are suitable starting steps.
You'll need to do extensive testing to be sure things are handled correctly by all checkout steps and all your shipping modules and your all payment modules (some handle shipping data too) and all addons you're using.
I suggest you test it on a COPY of your site, and not directly on your live site.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.