Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Checkout problems
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

I have the latest version installed, (fresh install), and am just going through the options.
No products loaded (just the default ones), and no coding work at this stage.
the only thing that I have done is change a few basic options in the admin area.
All of a sudden any time I try to either checkout or simply add anything to my cart I get a stream of error messages at:
http://mydomain.com/shop/checkout/cart/

The errors I get:

exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GB'' AND dest_region_id='0' AND dest_zip='')
                     OR (
dest_count' at line 7' in /home/myserver/public_html/mydomain.com/shop/lib/Zend/Db/Statement/Pdo.php:227
Stack trace
:
#0 /home/myserver/public_html/mydomain/shop/lib/Zend/Db/Statement.php(279): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/myserver/public_html/mydomain/shop/lib/Zend/Db/Adapter/Abstract.php(396): Zend_Db_Statement->execute(Array)
#2 /home/myserver/public_html/mydomain/shop/lib/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#3 /home/myserver/public_html/mydomain/shop/lib/Zend/Db/Adapter/Abstract.php(693): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php(86): Zend_Db_Adapter_Abstract->fetchRow(Object(Zend_Db_Select))
#5 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php(71): Mage_Shipping_Model_Mysql4_Carrier_Tablerate->getRate(Object(Mage_Shipping_Model_Rate_Request))
#6 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php(50): Mage_Shipping_Model_Carrier_Tablerate->getRate(Object(Mage_Shipping_Model_Rate_Request))
#7 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Shipping/Model/Shipping.php(98): Mage_Shipping_Model_Carrier_Tablerate->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#8 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Sales/Model/Quote/Address.php(422): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#9 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(37): Mage_Sales_Model_Quote_Address->collectShippingRates()
#10 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Sales/Model/Quote/Address.php(475): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#11 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Sales/Model/Quote.php(511): Mage_Sales_Model_Quote_Address->collectTotals()
#12 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Checkout/Model/Cart.php(390): Mage_Sales_Model_Quote->collectTotals()
#13 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Checkout/controllers/CartController.php(63): Mage_Checkout_Model_Cart->save()
#14 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Core/Controller/Varien/Action.php(326): Mage_Checkout_CartController->indexAction()
#15 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(147): Mage_Core_Controller_Varien_Action->dispatch('index')
#16 /home/myserver/public_html/mydomain/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(164): Mage_Core_Controller_Varien_Router_Standard->match(Object(Zend_Controller_Request_Http))
#17 /home/myserver/public_html/mydomain/shop/app/Mage.php(378): Mage_Core_Controller_Varien_Front->dispatch()
#18 /home/myserver/public_html/mydomain/shop/index.php(28): Mage::run('base')
#19 {main}
I’d appreciate some help fixing this!

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Were you trying to import table rates?
If yes, could you attach or send me the file you have uploaded?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

That’s just the thing, I haven’t been trying to attach or adjust anything other than the default settings.
I have gone back over the changes I made but the errors still remain.

Under ‘Shipping methods’ I have Table rates enabled.
Under ‘payment methods’ I have the 2 paypal options enabled (although they don’t actually function at the moment as I haven’t set them up).

The erros seemed to happen when I was filling out the billing/ shipp address with bogus information ‘name = aggere, address = fgdgdfg etc’

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

If you disable Table rates, does the problem go away?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

Update ... when I went back to the home page I had this error display:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘GB’’ AND dest_region_id=’0’ AND dest_zip=’’) OR (dest_count’ at line 7

Turning the table rates off fixed it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

I’m having a similar problem, and am also trying to enable table rates. The error is as follows:

exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'US'' AND dest_region_id='0' AND dest_zip='')
                     OR (
dest_count' at line 7' in /home/wmfa/public_html/magento/lib/Zend/Db/Statement/Mysqli.php:85
Stack trace
:
#0 /home/wmfa/public_html/magento/lib/Zend/Db/Statement.php(109): Zend_Db_Statement_Mysqli->_prepare('SELECT??`shippi...')
#1 /home/wmfa/public_html/magento/lib/Zend/Db/Adapter/Mysqli.php(330): Zend_Db_Statement->__construct(Object(Varien_Db_Adapter_Mysqli), 'SELECT??`shippi...')
#2 /home/wmfa/public_html/magento/lib/Zend/Db/Adapter/Abstract.php(395): Zend_Db_Adapter_Mysqli->prepare('SELECT??`shippi...')
#3 /home/wmfa/public_html/magento/lib/Zend/Db/Adapter/Abstract.php(693): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#4 /home/wmfa/public_html/magento/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php(86): Zend_Db_Adapter_Abstract->fetchRow(Object(Zend_Db_Select))
#5 /home/wmfa/public_html/magento/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php(71): Mage_Shipping_Model_Mysql4_Carrier_Tablerate->getRate(Object(Mage_Shipping_Model_Rate_Request))
#6 /home/wmfa/public_html/magento/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php(50): Mage_Shipping_Model_Carrier_Tablerate->getRate(Object(Mage_Shipping_Model_Rate_Request))
#7 /home/wmfa/public_html/magento/app/code/core/Mage/Shipping/Model/Shipping.php(98): Mage_Shipping_Model_Carrier_Tablerate->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#8 /home/wmfa/public_html/magento/app/code/core/Mage/Sales/Model/Quote/Address.php(422): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#9 /home/wmfa/public_html/magento/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(37): Mage_Sales_Model_Quote_Address->collectShippingRates()
#10 /home/wmfa/public_html/magento/app/code/core/Mage/Sales/Model/Quote/Address.php(475): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#11 /home/wmfa/public_html/magento/app/code/core/Mage/Sales/Model/Quote.php(511): Mage_Sales_Model_Quote_Address->collectTotals()
#12 /home/wmfa/public_html/magento/app/code/core/Mage/Checkout/Model/Cart.php(390): Mage_Sales_Model_Quote->collectTotals()
#13 /home/wmfa/public_html/magento/app/code/core/Mage/Checkout/controllers/CartController.php(63): Mage_Checkout_Model_Cart->save()
#14 /home/wmfa/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(326): Mage_Checkout_CartController->indexAction()
#15 /home/wmfa/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(147): Mage_Core_Controller_Varien_Action->dispatch('index')
#16 /home/wmfa/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(164): Mage_Core_Controller_Varien_Router_Standard->match(Object(Zend_Controller_Request_Http))
#17 /home/wmfa/public_html/magento/app/Mage.php(378): Mage_Core_Controller_Varien_Front->dispatch()
#18 /home/wmfa/public_html/magento/index.php(28): Mage::run('base')
#19 {main}

I’m trying to upload/import a .csv with the following values (spaces added for clarity):

USA,    *,    *,    0,        5
USA
,    *,    *,    4,        10
USA
,    *,    *,    100,    15
USA
,    *,    *,    600,    30
USA
,    *,    *,    800,    35
USA
,    *,    *,    1000,    40
USA
,    *,    *,    1500,    80

When I turn off table rates, the problem goes away.

Any help would be appreciated!

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roderik
Member
 
Avatar
Total Posts:  35
Joined:  2007-09-15
Belgium
 

The same goes for me, i did a new install, took the tablerates that worked in the first public version, and i get the above SQL error.

My file is:

"Country","Region/State","ZIP/Postal Code","Weight (and above)","Shipping Price"
"BEL"
,"*","*","0.0000","3.0000"
"BEL"
,"*","*","0.3500","5.0000"
"BEL"
,"*","*","1.0000","7.0000"
"BEL"
,"*","*","2.0000","10.0000"
"BEL"
,"*","*","5.0000","14.0000"
"BEL"
,"*","*","10.0000","16.0000"
"BEL"
,"*","*","20.0000","16.0000"
"BEL"
,"*","*","30.0000","25.0000"
"DEU"
,"*","*","0.0000","6.0000"
"DEU"
,"*","*","0.3500","10.0000"
"DEU"
,"*","*","1.0000","15.0000"
"DEU"
,"*","*","2.0000","16.0000"
"DEU"
,"*","*","5.0000","16.0000"
"DEU"
,"*","*","10.0000","16.0000"
"DEU"
,"*","*","20.0000","16.0000"
"DEU"
,"*","*","30.0000","25.0000"
"FRA"
,"*","*","0.0000","6.0000"
"FRA"
,"*","*","0.3500","10.0000"
"FRA"
,"*","*","1.0000","15.0000"
"FRA"
,"*","*","2.0000","25.0000"
"FRA"
,"*","*","5.0000","25.0000"
"FRA"
,"*","*","10.0000","25.0000"
"FRA"
,"*","*","20.0000","25.0000"
"FRA"
,"*","*","30.0000","40.0000"
"GBR"
,"*","*","0.0000","6.0000"
"GBR"
,"*","*","0.3500","10.0000"
"GBR"
,"*","*","1.0000","15.0000"
"GBR"
,"*","*","2.0000","25.0000"
"GBR"
,"*","*","5.0000","25.0000"
"GBR"
,"*","*","10.0000","25.0000"
"GBR"
,"*","*","20.0000","25.0000"
"GBR"
,"*","*","30.0000","40.0000"
"LUX"
,"*","*","0.0000","6.0000"
"LUX"
,"*","*","0.3500","10.0000"
"LUX"
,"*","*","1.0000","15.0000"
"LUX"
,"*","*","2.0000","15.0000"
"LUX"
,"*","*","5.0000","16.0000"
"LUX"
,"*","*","10.0000","16.0000"
"LUX"
,"*","*","20.0000","16.0000"
"LUX"
,"*","*","30.0000","25.0000"
"NLD"
,"*","*","0.0000","6.0000"
"NLD"
,"*","*","0.3500","10.0000"
"NLD"
,"*","*","1.0000","15.0000"
"NLD"
,"*","*","2.0000","15.0000"
"NLD"
,"*","*","5.0000","16.0000"
"NLD"
,"*","*","10.0000","16.0000"
"NLD"
,"*","*","20.0000","16.0000"
"NLD"
,"*","*","30.0000","25.0000"
"USA"
,"*","*","0.0000","7.0000"
"USA"
,"*","*","0.3500","12.0000"
"USA"
,"*","*","1.0000","22.0000"
"USA"
,"*","*","2.0000","28.0000"
"USA"
,"*","*","5.0000","54.0000"
"USA"
,"*","*","10.0000","80.0000"
"USA"
,"*","*","20.0000","105.0000"
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Unzip attached file into magento root folder and see if it works.
Don’t forget to disable cache if you have it enabled.
Thanks

File Attachments
tablerate-fix.zip  (File Size: 5KB - Downloads: 176)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

Installed as instructed.
Went to System > Configuration > Shipping methids and got this error:

Fatal error: Call to a member function getCode() on a non-object in /home/path/to/domain/shop/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php on line 29

Line 29 is:
foreach ($tableRate->getCode(’condition_name’) as $k=>$v) {

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roderik
Member
 
Avatar
Total Posts:  35
Joined:  2007-09-15
Belgium
 

here everything works

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@Solar Frenzy: That’s weird, can you make sure that app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php exists?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

I don’t believe this!!

Each time I come back here to report that it works fine, I return to my store and then the error re-appears!

One thing that I do get, but not related is, when completing the checkout form, when I get to Shipping method I get “Sorry, no quotes are available for this order at this time.” no matter if I put in real or bogus details.
I’m assuming that this is because this area is still incomplete. is this so?

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

It’s working for me too cheese

It didn’t work immediately after updating with the files above (I was getting the “no quote” error). After that, I compared my import file to the original download and noticed that Excel had removed the quotes ("") from around each of the items when I saved. I re-instated the quotes and (following Roderik’s lead above) added 4 decimal places to each amount. Like so:

"Country","Region/State","Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
"USA"
,"*","*","0.0000","5.0000"
"USA"
,"*","*","26.0000","10.0000"
"USA"
,"*","*","46.0000","15.0000"
"USA"
,"*","*","500.0000","20.0000"

One or the other (or both) made the difference, and all is now working as expected.

Thanks Moshe!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ramzy
Jr. Member
 
Total Posts:  5
Joined:  2007-10-18
 

Hi,

I encontred this problem too and this is how to fix it :

- Edit the file Tablerate.php in “magento\app\code\core\Mage\Shipping\Model\Mysql4\Carrier”
- Go to line 67 and replace the line by :
OR (dest_country_id=$country AND dest_region_id=’0’ AND dest_zip=’’)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top