Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Shipping Estimator Error: ectaddclass is not
Author « Topic »  

OrientalOutpost
Advanced Member

China
301 Posts

Posted - 01/09/2022 :  10:17:41  
I am using a standard weight-based shipping scheme (not querying USPS etc) with 7.4.6

On the first cart.php page, I found that most countries update the shipping estimator fine. However, for those with states/provinces enabled (USA and Canada) the shipping estimator chokes on a javascript error:

Uncaught ReferenceError: ectaddclass is not defined
at setestimatorwarn
at updateestimator
at HTMLSelectElement.onchange

For the user, the country changes, but the shipping estimate amount remains the same.

Oriental Outpost Custom Wall Scrolls

Vince
Administrator

41216 Posts

Posted - 01/10/2022 :  02:43:15  
Hi OrientalOutpost
That function is defined in the ectcart.js file so can you make sure that has been updated properly and is referenced in the cart.php page.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

OrientalOutpost
Advanced Member

China
301 Posts

Posted - 01/10/2022 :  11:01:33  
That didn't make a change - checking to see if I have any other conflicting code.

There is something different about the way that the USA and Canada are handled in ECT...

I have states (counties) enabled for Great Britain and the shipping estimator works nicely (and no county selection required). Just USA and Canada require state selection, but for New York or California, I charge the same flat rate, so this is unneeded for me.

Is there a setting in includes.php or admin panel to get rid of the state selection for the shipping estimate for Canada and USA?



Oriental Outpost Custom Wall Scrolls

Vince
Administrator

41216 Posts

Posted - 01/10/2022 :  13:44:52  
I just checked your website and really, the ectcart.js file seems to be missing from the cart.php page as I mentioned. Without that the ectaddclass function will be missing as it is defined in that file.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

OrientalOutpost
Advanced Member

China
301 Posts

Posted - 01/10/2022 :  18:45:54  
Looks like that is supposed to be added via incectstyle.php
Is that file supposed " include 'vsadmin/inc/incectstyle.php' " in cart.php ?
I guess I did not get the memo.

I got it to work now. Thanks!!!

Still wondering if there is a way to skip the state selection and "Update Shipping Estimator" button since there is no difference for my customers from US State to State or CA Province to Province. I like the way it works with other countries.


Oriental Outpost Custom Wall Scrolls

Vince
Administrator

41216 Posts

Posted - 01/11/2022 :  00:51:04  
quote:
Looks like that is supposed to be added via incectstyle.php
Is that file supposed " include 'vsadmin/inc/incectstyle.php' " in cart.php ?
No, you don't have to use incectstyle.php and it's not a good idea probably on your store which is heavily customized and doesn't use the standard ECT styles. To just add the ectcart.js file manually there are more details here...

https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=107040

quote:
Still wondering if there is a way to skip the state selection and "Update Shipping Estimator" button since there is no difference for my customers from US State to State or CA Province to Province. I like the way it works with other countries.
If you go to the ECT Admin -> Postal Zones then it looks like you have the states split into different postal zones. If you click on the link where it says...
quote:
Your admin settings are set to split your States into separate zones. To treat your States as one shipping zone please click here.
...then you will just have one zone for the whole of the USA or Canada so won't need to choose the state. You will however need to make sure that your country rules for the USA and Canada are the same as each US state or Canadian Province.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

OrientalOutpost
Advanced Member

China
301 Posts

Posted - 01/11/2022 :  11:06:45  
Thanks, much appreciated.

I could not get rid of the "Update Shipping Estimator" button even after following your info... But, I added updateestimator('',false); inside function revealestimatorgo() so now it updates as soon as somebody select a state. At least it reduces the steps by one for the customer.



Oriental Outpost Custom Wall Scrolls
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2021 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000