Shipping estimator -- residential or business?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Shipping estimator -- residential or business?

Post by Will » Fri Feb 29, 2008 12:51 pm

Forgive me if this has been covered before, but I couldn't find it through a search.

Right now it looks like the shipping estimator on the Basket page is returning estimates for businesses rather than residential. Is there any way to change this -- do I have it configured wrong somewhere?

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Thu Mar 13, 2008 9:45 pm

In ConLib/BasketShippingEstimate.ascx in method

protected void SubmitButton_Click(object sender, System.EventArgs e)

add this line

estimateAddress.Residence = true;

after

estimateAddress.PostalCode = safePostalCode;

so SubmitButton_Click method would look like

protected void SubmitButton_Click(object sender, System.EventArgs e)
{
if (Page.IsValid)
{
string safePostalCode = StringHelper.StripHtml(PostalCode.Text);
if (!string.IsNullOrEmpty(safePostalCode))
{
safePostalCode = Regex.Replace(safePostalCode.ToUpperInvariant(), "[^A-Z0-9]", string.Empty);
// PACKAGE THE BASKET TO ENSURE ALL SHIPPABLE PRODUCTS ARE IN A SHIPMENT
Basket myBasket = Token.Instance.User.Basket;
myBasket.Package();

// CREATE AN ADDRESS INSTANCE TO HOLD ESTIMATE DESTINATION
Address estimateAddress = new Address();
bool isCA = Regex.Match(safePostalCode, "^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$").Success;
estimateAddress.CountryCode = isCA ? "CA" : "US";
estimateAddress.PostalCode = safePostalCode;
estimateAddress.Residence = true;

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Fri Mar 14, 2008 7:31 am

Works great. Thanks!

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

Re: Shipping estimator -- residential or business?

Post by Robbie@FireFold » Fri Sep 05, 2008 7:19 am

I added this, but still get business quotes.

Any thoughts? I really need to get every quote to be residential.
Robbie Hodge
General Manager
Robbie@FireFold.com
http://www.FireFold.com

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

Re: Shipping estimator -- residential or business?

Post by Robbie@FireFold » Fri Sep 05, 2008 7:38 am

Just noticed this was an Able 5.5 post.

Thoughts on Able 7?
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: Shipping estimator -- residential or business?

Post by mazhar » Fri Sep 05, 2008 10:04 pm

added this, but still get business quotes.

Any thoughts? I really need to get every quote to be residential.
It could be because that you may be modifying the wrong version of control, check related scriptlet to confirm the path of shipping estimate control being used. I mean to say that you may be using it from ConLib/Custom if you have some modified version of this control in ConLib/Custom folder
Last edited by mazhar on Sun Sep 07, 2008 9:24 pm, edited 1 time in total.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Shipping estimator -- residential or business?

Post by jmestep » Sat Sep 06, 2008 9:52 am

I did this and it worked. I'm using UPS only. It didn't work if I tried it in the one in the Custom folder.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

combra
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Thu Jul 31, 2008 7:09 pm

Re: Shipping estimator -- residential or business?

Post by combra » Sat Sep 13, 2008 3:49 pm

Robbie@FireFold wrote:Just noticed this was an Able 5.5 post.

Thoughts on Able 7?
Does anyone have the code for this for AC 7?
AC 7.0.7 build 14600

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Shipping estimator -- residential or business?

Post by jmestep » Sat Sep 13, 2008 5:06 pm

This works from the post above:

estimateAddress.Residence = true;

It just doesn't work if the control is in the Custom folder.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

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

Re: Shipping estimator -- residential or business?

Post by draneb » Tue Nov 18, 2008 2:20 am

Hi Judy,

You created a Custom/BasketShippingEstimate file for me. So, I won't be able to enter that line of code to have it return Residential rates?

Thank you.
AC 7.0.3 build 13937

Post Reply