如何解决magento产品详细信息页面中的语法错误? [英] How to solve syntax error in product detail page in magento?

查看:70
本文介绍了如何解决magento产品详细信息页面中的语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仅在magento的产品详细信息页面中有错误

I have an error only in product detail page in magento

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 ')' at line 1

如果我设置了原始默认主题,则不会给我任何错误, 那么可能是什么问题?

if i set original default theme it is not giving me any error, so what could be the issue?

There has been an error processing your request

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 ')' at line 1

Trace:
    #0 C:\wamp\www\dennymagic.com\store\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
    #1 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
   #2 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
     #3 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `mage_ca...', Array)
    #4 C:\wamp\www\dennymagic.com\store\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `mage_ca...', Array)
     #5 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
       #6 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Eav\Model\Entity\Abstract.php(943): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
     #7 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Model\Resource\Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
     #8 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
       #9 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Block\Product\List.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category))
       #10 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Block\Product\List.php(141): Mage_Catalog_Block_Product_List->_getProductCollection()
      #11 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(862): Mage_Catalog_Block_Product_List->_beforeToHtml()
      #12 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
      #13 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
      #14 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
        #15 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
      #16 C:\wamp\www\dennymagic.com\store\app\design\frontend\aaaa\bbb\template\page\2columns-right.phtml(36): Mage_Core_Block_Abstract->getChildHtml('content')
         #17 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\den...')
        #18 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template->fetchView('frontend\aaa...')
       #19 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()
       #20 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(863): Mage_Core_Block_Template->_toHtml()
     #21 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract->toHtml()
       #22 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout->getOutput()
       #23 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\Helper\Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
     #24 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route')
     #25 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\controllers\IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
        #26 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Action.php(419):  Mage_Cms_IndexController->noRouteAction()
     #27 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
   #28 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
   #29 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
      #30 C:\wamp\www\dennymagic.com\store\app\Mage.php(683): Mage_Core_Model_App->run(Array)
     #31 C:\wamp\www\dennymagic.com\store\index.php(87): Mage::run('', 'store')

推荐答案

该错误可能与某些phtml文件有关.

Probably the error is related to some phtml files.

有关产品细节的主题文件在这里: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/catalog/product/view/

The theme files for prod detail are here: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/catalog/product/view/

RAW解决方案:

要找出错误,我建议您以这种方式进行:
尝试删除目录,然后删除模板目录中的子目录: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/

To find out the error I can suggest you to proceed in this way:
try to remove directory and then sub_directory in the template dir: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/

例如,您可以尝试删除此目录: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/catalog/product/view/
并查看错误是否消失,因此您可以确定导致该错误的是该目录中的文件.

For example you can try remove this dir: app/design/frontend/YOR_PACKAGE/YOUR_THEME/template/catalog/product/view/
and see if the error is gone so you are sure that what is causing the error is a file inside this dir.

找到目录后,重复执行逐个文件删除操作,直到不知道是哪个文件为止.

Once you find out the dir, repeat the operation removing file by file until you don't understand which file is.

这时您可以分析文件代码.

At this point you can analize the file code.

更好的解决方案:

使用Xdebug并遵循代码流,直到触发错误为止.

use Xdebug and follow the flow of the code until the error is triggered.

这篇关于如何解决magento产品详细信息页面中的语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆