Business and Residential flags

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Business and Residential flags

Post by William_firefold » Thu Nov 06, 2008 10:08 am

It seems like a few different things depend on whether an address is set as business or residential. When an address is residential, the system charges a different rate on checkout for shipping. We have already made it so that the same rate is applied to the customer whether they select business or residential(the value gets set to 1 in either selection on checkout). The problem now is that when the orders get pulled up on our shipper, some have flags for residential and some have flags for business. If someone doesnt uncheck the Residential box, we get charged more. How can we set these flags to make it be residential in our system, but have our shipper think it is business.

User avatar
calvis
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 710
Joined: Tue Jan 27, 2004 3:57 pm
Location: Redmond, WA

Re: Business and Residential flags

Post by calvis » Thu Nov 06, 2008 11:48 am

Hi William,

I can tell you how we approach this problem which may not be the most eloquent solution, but it does work for us. We charge everyone at residential rate, but when we ship, we ship everything as if it was a business address. Then when UPS delivers a package at a residential address they will mark it as residential and then UPS will do an adjustment on the next week's bill for the residential fee.

We basically let UPS make the decision whether the address is business or residential. I know this puts a great amount of faith in UPS, but our studies have shown they are pretty good about getting it right. In addition, UPS has a pretty narrow definition on what a commercial address constitutes For example home offices are not commercial.

We are using Worldship so it is easy for us to use this methodology.
Able Customer Since 1999 Currently Running on GOLD R12 SR1 and PCI Certified.

Robbie@FireFold
Commodore (COMO)
Commodore (COMO)
Posts: 433
Joined: Wed May 28, 2008 9:42 am
Location: Concord, NC
Contact:

Re: Business and Residential flags

Post by Robbie@FireFold » Thu Nov 06, 2008 12:54 pm

Calvis that is right on the money.

Our issue is we use Shipper 3(great program btw) and it passes the flag to Shiprush(like worldship).

I want Able to NOT pass the flag over.
Robbie Hodge
General Manager
Robbie@FireFold.com
http://www.FireFold.com

afm
Captain (CAPT)
Captain (CAPT)
Posts: 339
Joined: Thu Nov 03, 2005 11:52 pm
Location: Portland, OR
Contact:

Re: Business and Residential flags

Post by afm » Thu Nov 06, 2008 9:05 pm

Here's one way of forcing every address to business. This assumes you are using ConLib/OnePageCheckout.ascx.

1. Copy ConLib/EditMyAddressPage.ascx and EditMyAddressPage.ascx.cs to ConLib/Custom/.
2. After line 49 in Custom/EditMyAddressPage.ascx.cs, insert the code shown (the part between the comments),

Code: Select all

                    _Address.Residence = true;
                    //AFM Default is business
                    _Address.Residence = false;
                    //AFM End
3. After line 141 in Custom/EditMyAddressPage.ascx.cs, insert the code shown,

Code: Select all

            address.Residence = (Residence.SelectedIndex == 0);
            //AFM Force business address
            address.Residence = false;
            //AFM End
4. In line 111 of Custom/EditMyAddressPage.ascx, add Visible="false" as shown:

Code: Select all

<asp:Label ID="ResidenceLabel" runat="server" Text="Type:" AssociatedControlID="Residence" EnableViewState="false" Visible="false"></asp:Label>
5. In line 114 of Custom/EditMyAddressPage.ascx, add Visible="false" as shown:

Code: Select all

<asp:DropDownList ID="Residence" runat="server" EnableViewState="false" Visible="false">
6. Using Manage Content and Layout (Scriptlets), change the "Edit My Address Page" scriptlet to use [[ConLib:Custom/EditMyAddressPage]].

7. Copy ConLib/OnePageCheckout.ascx and OnePageCheckout.ascx.cs to ConLib/Custom/.
8. Insert the following code after line 1240 in Custom/OnePageCheckout.ascx.cs,

Code: Select all

        billingAddress.Residence = (BillToAddressType.SelectedIndex == 0);
        //AFM Force business address type
        billingAddress.Residence = false;
        //AFM End        
9. Insert the following code after line 1272 in Custom/OnePageCheckout.ascx.cs,

Code: Select all

        shippingAddress.Residence = (AlwaysConvert.ToInt(ShipToAddressType.SelectedValue) == 1);
        //AFM Force business address type
        shippingAddress.Residence = false;
        //AFM End
10. Add runat="server" visible="false" to line 143 in Custom/OnePageCheckout.ascx as shown,

Code: Select all

<tr runat="server" visible="false">
*Note that this table row surrounds the BillToAddressType fields.
11. Add runat="server" visible="false" to line 310 in Custom/OnePageCheckout.ascx as shown,

Code: Select all

<tr runat="server" visible="false">
*Note that this table row surrounds the ShipToAddressType fields.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Business and Residential flags

Post by William_firefold » Fri Nov 07, 2008 9:17 am

Thank you for your help, but for whatever reason, this didnt work.
I heard that you wrote shipper, so im sure you can help.
Could you tell me what value from ABLE that shipper uses to determine whether or not to set the residential checkbox.
Basically we want everyone to be treated as residential on the site, and everyone to be treated as business on shipper.

If there is no static way to do it, the value could even just "become" residential for a second during checkout until they get charged and the order sent on to shipper, and then switched back to whatever.

Hopefully this makes sense.

afm
Captain (CAPT)
Captain (CAPT)
Posts: 339
Joined: Thu Nov 03, 2005 11:52 pm
Location: Portland, OR
Contact:

Re: Business and Residential flags

Post by afm » Fri Nov 07, 2008 12:35 pm

The changes I made only affect new orders, and they only work if you use the OnePageCheckout.ascx checkout from AC. Even then, the changes treat every address as a business address throughout the life of the basket/order.

If the changes are not affecting new orders, then you are probably using a different checkout control than the one you modified.

To treat every address as a residence (for shipping cost calculation), you could use true instead of false everywhere I wrote Residense = false (i.e. you would write Residence = true).

To change the address to business after the order is placed, you could make the change in the payment controls (that is where the order is created after payment is made). I have not looked for this specifically, but I would look for the order save and insert some lines immediately before that change the shipping address residence flag to false.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Business and Residential flags

Post by draneb » Fri Jan 02, 2009 10:04 pm

Okay, unfortunately, this busy Christmas shopping season taught me that I can no longer trust in the "honor system" in regards to letting the customers select whether they are Business or Residential.

The lower commercial rates were coming through consistantly. It must be too easy for them to try each one and notice the cheaper shipping when selecting commercial. The first thing I did was add the Address Type to the email confirmation under the Shipping Method. Then I started getting emails from customers saying, "ohhhh, could you please change this from commercial to residential?" (busted) but that doesn't deter anyone from selecting the proper type because they don't see that until the checkout process is complete and they read their confirmation email.

I have decided for 2009 I want to charge every customer as a Residential address. It's okay if the option to select Residential or Business still stays in the OnePageCheckout but I just want it to charge residential rates regardless of which one they select...

So, could I just follow Andy's instructions above
To treat every address as a residence (for shipping cost calculation), you could use true instead of false everywhere I wrote Residense = false (i.e. you would write Residence = true).
to accomplish this?

Thank you.
AC 7.0.3 build 13937

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Business and Residential flags

Post by mazhar » Sat Jan 03, 2009 5:00 am

You can try the Andy's code by using Residence = true

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Business and Residential flags

Post by compunerdy » Sat Jan 03, 2009 1:13 pm

I want to see a option to turn off business rates period..one little click of the mouse. How many people have made threads about this now..lets get it fixed once and for all :wink:

User avatar
calvis
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 710
Joined: Tue Jan 27, 2004 3:57 pm
Location: Redmond, WA

Re: Business and Residential flags

Post by calvis » Sat Jan 03, 2009 2:46 pm

compunerdy wrote:I want to see a option to turn off business rates period..one little click of the mouse. How many people have made threads about this now..lets get it fixed once and for all :wink:
I agree there needs to be an easy 'switch' to take care of this because of the rampant abuse. I do remember the days when U)nited P)arcel S)urcharge did not have a residential fee then there would be no worries. Customer are sly and they are trying to get the best deal. (I can't blame them in this economy). It would be nice if the cart would have this built in.

draneb:

In addition to making it where new customers are not able to select commercial. You also need to change the abusers back to residential as well. Also you need to make sure that it can not be abused via multiple addresses as well. I had one customer that was able to get his cheaper commercial rates by using the multiple address page. So you need to cover all angles.

Giving you all this advice might make me sound anti-consumer which I am not, but rather I am more anti-UPS. I wish my business was able to raise rates the first of the every year. Pass along costs immediately. ie fuel surcharge. UPS uses a surcharge fee based model because your UPS discounts are not applicable to surcharges - just on base shipping fee. I have never been able to negotiate a discount on surcharges. Its a very clever way of doing business especially when surcharges can equate to a huge percentage of the total shipping charge. From now remember that UPS - United Parcel Surcharge.
Able Customer Since 1999 Currently Running on GOLD R12 SR1 and PCI Certified.

Robbie@FireFold
Commodore (COMO)
Commodore (COMO)
Posts: 433
Joined: Wed May 28, 2008 9:42 am
Location: Concord, NC
Contact:

Re: Business and Residential flags

Post by Robbie@FireFold » Mon Jan 05, 2009 7:18 am

calvis wrote:
compunerdy wrote:I want to see a option to turn off business rates period..one little click of the mouse. How many people have made threads about this now..lets get it fixed once and for all :wink:
I agree there needs to be an easy 'switch' to take care of this because of the rampant abuse. I do remember the days when U)nited P)arcel S)urcharge did not have a residential fee then there would be no worries. Customer are sly and they are trying to get the best deal. (I can't blame them in this economy). It would be nice if the cart would have this built in.

draneb:

In addition to making it where new customers are not able to select commercial. You also need to change the abusers back to residential as well. Also you need to make sure that it can not be abused via multiple addresses as well. I had one customer that was able to get his cheaper commercial rates by using the multiple address page. So you need to cover all angles.

Giving you all this advice might make me sound anti-consumer which I am not, but rather I am more anti-UPS. I wish my business was able to raise rates the first of the every year. Pass along costs immediately. ie fuel surcharge. UPS uses a surcharge fee based model because your UPS discounts are not applicable to surcharges - just on base shipping fee. I have never been able to negotiate a discount on surcharges. Its a very clever way of doing business especially when surcharges can equate to a huge percentage of the total shipping charge. From now remember that UPS - United Parcel Surcharge.
Having the same issues. Google Checkout will hand our Commercial rates also.

Need a switch to control all of these.
Robbie Hodge
General Manager
Robbie@FireFold.com
http://www.FireFold.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Business and Residential flags

Post by mazhar » Mon Jan 05, 2009 8:00 am

I want to see a option to turn off business rates period..one little click of the mouse. How many people have made threads about this now..lets get it fixed once and for all :wink:
You can create a store setting for this purpose. Here is the modified store settings file with an extra checkbox setting. Unzip the attachment and place the StoreSettings.aspx file in your Website\Admin\Store directory. Then edit your Website\App_Code\PageHelper.cs file and add following method to it.

Code: Select all

public static bool GetUseResidentialAddressValue()
    {
        string value = Token.Instance.Store.Settings.GetValueByKey("UseResidentialAddress");
        if (!String.IsNullOrEmpty(value))
        {
            bool result = AlwaysConvert.ToBool(value, false);
            return result;
        }
        return false;
    }
Now all the support for one click switching is there. You just need to update the pages mentioned in Andy's post. Instead of using

Code: Select all

_Address.Residence = true;
you now need to use

Code: Select all

_Address.Residence = PageHelper.GetUseResidentialAddressValue();

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Business and Residential flags

Post by draneb » Mon Jan 05, 2009 2:48 pm

Mazhar to the rescue :D

Would we still be able to keep the drop down list for the customer to select Business or Residential on the onepagecheckout? It looks like Andy's method above hides all of that. I'll take whatever I can get but ideally I would like to keep the look the same and still let the customer choose Commercial or Residential (for UPS labeling purposes) but just have it charge Residential regardless of which one they choose.

If this is possible could you tell me what to edit?

Thanks a million!
AC 7.0.3 build 13937

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Business and Residential flags

Post by compunerdy » Mon Jan 05, 2009 2:55 pm

Do all the coding minus the visable=false changes

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Business and Residential flags

Post by William_firefold » Tue Jan 06, 2009 8:49 am

_Address.Residence = PageHelper.GetUseResidentialAddressValue();
Where do I need to change this specifically to make your code work?

The previous comment was a little unclear:
This doesnt seem quite right.
_Address.Residence = true;
//AFM Default is business
_Address.Residence = false;
//AFM End
Also, wouldnt you need a modification for onepagecheckout since they can choose address type there as well?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Business and Residential flags

Post by mazhar » Tue Jan 06, 2009 8:58 am

All I posted is to help you provide a setting that can be used to flag wheather to use residential address or not instead of hard coding it. For example if some wants to use the residential address then he will change the code

Code: Select all

 _Address.ResidentialAddress = true;
and if some one don't want to use it then he will made the code to look like

Code: Select all

 _Address.ResidentialAddress = false;
So instead of hard coding this I created a setting in the above post so that merchant can enable/disable the residential address just through mouse click instead of changing the code in file. As the below code

Code: Select all

_Address.Residence = PageHelper.GetUseResidentialAddressValue();
So you have to made the other changes if you have some where else or as mentioned by the Andy's post. My code just makes the ResidentialAddress = true or ResidentialAddress = false part dynamic.

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Business and Residential flags

Post by Carolharry » Thu Jan 08, 2009 4:31 pm

Hi Mazhar,

The customization by adding shipping setting, Is it possible for us to do, or do we need to get a control from you according to our requirements.
How are we gonna be able to add new columsn to the database?

Thanks,
Carol

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Business and Residential flags

Post by mazhar » Fri Jan 09, 2009 6:51 am

I didn't get your point. Please explain the question in detail. regarding
How are we gonna be able to add new columsn to the database?

If you want to add a store wide setting then you can create a store setting for it. As I created in the above posted code. Also read the following thread as well
viewtopic.php?f=42&t=9427
If you want to create something that could be linked to order or can have more then one occurring for example some shipping information for each order then you can use ac_CustomFields table
viewtopic.php?f=42&t=8684

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Business and Residential flags

Post by kastnerd » Fri Jan 09, 2009 10:58 am

Ideally we would have some system to check the address to see. But that's just wishfully thinking.

I have some wholesale customers who are part of a user group. Some of these customers are commercial addresses. What i guess would be best, is have it so the user can not control there address setting at any part. With these wholesale customers i would manually go to the admin and change there setting, and have it save it for there account. This way they are quoted correctly.

Regular customers shipping to a business address i would not worry about my self.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Business and Residential flags

Post by mazhar » Fri Jan 09, 2009 11:55 am

With these wholesale customers i would manually go to the admin and change there setting, and have it save it for there account. This way they are quoted correctly.
If you want to keep the address flag setting at user level then you will have to save this information in user settings. For example the code will be very similar to the above posted code for store settings. You will need this code on Admin/People/Users/EditUser.aspx so that you can enable/disable it at user level and instead of store settings you will make use of User.Settings.SetValueByKey() and User.Settings.GetValueByKey() methods.

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Business and Residential flags

Post by Carolharry » Fri Jan 09, 2009 1:02 pm

In Able Commerce, when a product template is created we add some fields like textbox and value,list box and values etc.
My requirement is we have product distribution types(online,download,online 30 days usage etc)
When a product template for a product like "practice test" is created , we have give available product distribution types from the
above lookup values,instead of giving the ability to add other distribution types.

So I thought of creating a store wide setting "product distribution types=<listbox>{"online,download,online 30 days usage"}
and pull that into Editproducttemplate.aspx by default

Am I following the right method to do it?

Anymore suggestions, please let me know.

Thanks
Carol

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Business and Residential flags

Post by kastnerd » Tue Feb 10, 2009 6:08 pm

warmoth.com has used the UPS XML address validation on there site.
see this poll
viewtopic.php?f=45&t=9430
I have registered for a key to the XML api

SecretSpin
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Thu Oct 29, 2009 5:34 am

Re: Business and Residential flags

Post by SecretSpin » Thu Oct 29, 2009 5:36 am

I'm on 7.0.3. and none of these files work. It appears the code has changed.

Is there an update out there? I need to have one standard set of shipping options for my customers.

SecretSpin
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Thu Oct 29, 2009 5:34 am

Re: Business and Residential flags

Post by SecretSpin » Mon Nov 16, 2009 7:30 am

No one looking to tackle this one?

Wish there was a simple way out of the box.

SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Re: Business and Residential flags

Post by SamsSteins » Tue Dec 08, 2009 11:42 am

Is there anyway to remove commercial as an option all together and have all rates returned be residential rates?

Post Reply