Page 1 of 1
Shipping estimator -- residential or business?
Posted: Fri Feb 29, 2008 12:51 pm
by Will
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?
Posted: Thu Mar 13, 2008 9:45 pm
by ayilmaz
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;
Posted: Fri Mar 14, 2008 7:31 am
by Will
Works great. Thanks!
Re: Shipping estimator -- residential or business?
Posted: Fri Sep 05, 2008 7:19 am
by Robbie@FireFold
I added this, but still get business quotes.
Any thoughts? I really need to get every quote to be residential.
Re: Shipping estimator -- residential or business?
Posted: Fri Sep 05, 2008 7:38 am
by Robbie@FireFold
Just noticed this was an Able 5.5 post.
Thoughts on Able 7?
Re: Shipping estimator -- residential or business?
Posted: Fri Sep 05, 2008 10:04 pm
by mazhar
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
Re: Shipping estimator -- residential or business?
Posted: Sat Sep 06, 2008 9:52 am
by jmestep
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.
Re: Shipping estimator -- residential or business?
Posted: Sat Sep 13, 2008 3:49 pm
by combra
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?
Re: Shipping estimator -- residential or business?
Posted: Sat Sep 13, 2008 5:06 pm
by jmestep
This works from the post above:
estimateAddress.Residence = true;
It just doesn't work if the control is in the Custom folder.
Re: Shipping estimator -- residential or business?
Posted: Tue Nov 18, 2008 2:20 am
by draneb
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.