Shipping estimator -- residential or business?
Shipping estimator -- residential or business?
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?
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?
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;
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;
-
- Commodore (COMO)
- Posts: 433
- Joined: Wed May 28, 2008 9:42 am
- Location: Concord, NC
- Contact:
Re: Shipping estimator -- residential or business?
I added this, but still get business quotes.
Any thoughts? I really need to get every quote to be residential.
Any thoughts? I really need to get every quote to be residential.
-
- Commodore (COMO)
- Posts: 433
- Joined: Wed May 28, 2008 9:42 am
- Location: Concord, NC
- Contact:
Re: Shipping estimator -- residential or business?
Just noticed this was an Able 5.5 post.
Thoughts on Able 7?
Thoughts on Able 7?
Re: Shipping estimator -- residential or business?
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 folderadded this, but still get business quotes.
Any thoughts? I really need to get every quote to be residential.
Last edited by mazhar on Sun Sep 07, 2008 9:24 pm, edited 1 time in total.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Shipping estimator -- residential or business?
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
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
Re: Shipping estimator -- residential or business?
Does anyone have the code for this for AC 7?Robbie@FireFold wrote:Just noticed this was an Able 5.5 post.
Thoughts on Able 7?
AC 7.0.7 build 14600
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Shipping estimator -- residential or business?
This works from the post above:
estimateAddress.Residence = true;
It just doesn't work if the control is in the Custom folder.
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
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
Re: Shipping estimator -- residential or business?
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.
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