el0p21 Posted February 23, 2017 Share Posted February 23, 2017 Hola, Hace unos dias que no se pueden añadir productos al carrito. La tienda lleva funcionando unos años sin problemas. Creo que he leído casi todos los temas de este foro que hablan de este problema y sigo sin poder solucionarlo. Prestashop 1.5.6.2 http://www.carmennavarro.com/shop/ También falla con la plantilla default Link to comment Share on other sites More sharing options...
el0p21 Posted February 23, 2017 Author Share Posted February 23, 2017 En modo debug este es el mensaje de error: Impossible to add the product to the cart. textStatus: 'error' errorThrown: 'Internal Server Error' responseText: <style> #psException{font-family: Verdana; font-size: 14px} #psException h2{color: #F20000} #psException p{padding-left: 20px} #psException ul li{margin-bottom: 10px} #psException a{font-size: 12px; color: #000000} #psException .psTrace, #psException .psArgs{display: none} #psException pre{border: 1px solid #236B04; background-color: #EAFEE1; padding: 5px; font-family: Courier; width: 99%; overflow-x: auto; margin-bottom: 30px;} #psException .psArgs pre{background-color: #F1FDFE;} #psException pre .selected{color: #F20000; font-weight: bold;} </style><div id="psException"><h2>[PrestaShopDatabaseException]</h2><p><b>Field 'id_cart_importerosc' doesn't have a default value<br /><br /><pre>INSERT INTO `ps_cart` (`id_shop_group`, `id_shop`, `id_address_delivery`, `id_address_invoice`, `id_carrier`, `id_currency`, `id_customer`, `id_guest`, `id_lang`, `recyclable`, `gift`, `gift_message`, `mobile_theme`, `delivery_option`, `secure_key`, `allow_seperated_package`, `date_add`, `date_upd`) VALUES ('1', '1', '0', '0', '0', '1', '0', '566066', '1', '0', '0', '', '0', '', '', '0', '2017-02-23 12:25:44', '2017-02-23 12:25:44')</pre></b><br /><i>at line </i><b>613</b><i> in file </i><b>classes/db/Db.php</b></p><div class="psTrace" id="psTrace_" style="display: block"><pre>607. WebserviceRequest::getInstance()->setError(500, ' '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);608. }609. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))610. {611. if ($sql)<span class="selected">612. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');</span>613. throw new PrestaShopDatabaseException($this->getMsgError());614. }615. }616. 617. /**</pre></div><ul><li><b>DbCore->displayError</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_0').style.display = (document.getElementById('psTrace_0').style.display != 'block') ? 'block' : 'none'; return false">[line 313 - classes/db/Db.php]</a> - <a href="#" onclick="document.getElementById('psArgs_0').style.display = (document.getElementById('psArgs_0').style.display != 'block') ? 'block' : 'none'; return false">[1 Arguments]</a><div class="psTrace" id="psTrace_0" ><pre>307. if ($sql instanceof DbQuery)308. $sql = $sql->build();309. 310. $this->result = $this->_query($sql);311. if (_PS_DEBUG_SQL_)<span class="selected">312. $this->displayError($sql);</span>313. return $this->result;314. }315. 316. /**317. * Execute an INSERT query</pre></div><div class="psArgs" id="psArgs_0"><pre><b>Argument [0]</b>INSERT INTO `ps_cart` (`id_shop_group`, `id_shop`, `id_address_delivery`, `id_address_invoice`, `id_carrier`, `id_currency`, `id_customer`, `id_guest`, `id_lang`, `recyclable`, `gift`, `gift_message`, `mobile_theme`, `delivery_option`, `secure_key`, `allow_seperated_package`, `date_add`, `date_upd`) VALUES ('1', '1', '0', '0', '0', '1', '0', '566066', '1', '0', '0', '', '0', '', '', '0', '2017-02-23 12:25:44', '2017-02-23 12:25:44')</pre></li><li><b>DbCore->query</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_1').style.display = (document.getElementById('psTrace_1').style.display != 'block') ? 'block' : 'none'; return false">[line 587 - classes/db/Db.php]</a> - <a href="#" onclick="document.getElementById('psArgs_1').style.display = (document.getElementById('psArgs_1').style.display != 'block') ? 'block' : 'none'; return false">[1 Arguments]</a><div class="psTrace" id="psTrace_1" ><pre>581. {582. if ($sql instanceof DbQuery)583. $sql = $sql->build();584. 585. $this->result = false;<span class="selected">586. $result = $this->query($sql);</span>587. if ($use_cache && $this->is_cache_enabled)588. Cache::getInstance()->deleteQuery($sql);589. if (_PS_DEBUG_SQL_)590. $this->displayError($sql);591. return $result;</pre></div><div class="psArgs" id="psArgs_1"><pre><b>Argument [0]</b>INSERT INTO `ps_cart` (`id_shop_group`, `id_shop`, `id_address_delivery`, `id_address_invoice`, `id_carrier`, `id_currency`, `id_customer`, `id_guest`, `id_lang`, `recyclable`, `gift`, `gift_message`, `mobile_theme`, `delivery_option`, `secure_key`, `allow_seperated_package`, `date_add`, `date_upd`) VALUES ('1', '1', '0', '0', '0', '1', '0', '566066', '1', '0', '0', '', '0', '', '', '0', '2017-02-23 12:25:44', '2017-02-23 12:25:44')</pre></li><li><b>DbCore->q</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_2').style.display = (document.getElementById('psTrace_2').style.display != 'block') ? 'block' : 'none'; return false">[line 378 - classes/db/Db.php]</a> - <a href="#" onclick="document.getElementById('psArgs_2').style.display = (document.getElementById('psArgs_2').style.display != 'block') ? 'block' : 'none'; return false">[2 Arguments]</a><div class="psTrace" id="psTrace_2" ><pre>372. $keys_stringified = implode(', ', $keys);373. $values_stringified[] = '('.implode(', ', $values).')';374. }375. 376. $sql = $insert_keyword.' INTO `'.$table.'` ('.$keys_stringified.') VALUES '.implode(', ', $values_stringified);<span class="selected">377. return (bool)$this->q($sql, $use_cache);</span>378. }379. 380. /**381. * @param string $table Table name without prefix382. * @param array $data Data to insert as associative array. If $data is a list of arrays, multiple insert will be done</pre></div><div class="psArgs" id="psArgs_2"><pre><b>Argument [0]</b>INSERT INTO `ps_cart` (`id_shop_group`, `id_shop`, `id_address_delivery`, `id_address_invoice`, `id_carrier`, `id_currency`, `id_customer`, `id_guest`, `id_lang`, `recyclable`, `gift`, `gift_message`, `mobile_theme`, `delivery_option`, `secure_key`, `allow_seperated_package`, `date_add`, `date_upd`) VALUES ('1', '1', '0', '0', '0', '1', '0', '566066', '1', '0', '0', '', '0', '', '', '0', '2017-02-23 12:25:44', '2017-02-23 12:25:44')<b>Argument [1]</b>1</pre></li><li><b>DbCore->insert</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_3').style.display = (document.getElementById('psTrace_3').style.display != 'block') ? 'block' : 'none'; return false">[line 455 - classes/ObjectModel.php]</a> - <a href="#" onclick="document.getElementById('psArgs_3').style.display = (document.getElementById('psArgs_3').style.display != 'block') ? 'block' : 'none'; return false">[3 Arguments]</a><div class="psTrace" id="psTrace_3" ><pre>449. // Database insertion450. if (isset($this->id) && !Tools::getValue('forceIDs'))451. unset($this->id);452. if (Shop::checkIdShopDefault($this->def['table']))453. $this->id_shop_default = min($id_shop_list);<span class="selected">454. if (!$result = ObjectModel::$db->insert($this->def['table'], $this->getFields(), $null_values))</span>455. return false;456. 457. // Get object id in database458. $this->id = ObjectModel::$db->Insert_ID();459. </pre></div><div class="psArgs" id="psArgs_3"><pre><b>Argument [0]</b>cart<b>Argument [1]</b>Array( [id_shop_group] => 1 [id_shop] => 1 [id_address_delivery] => 0 [id_address_invoice] => 0 [id_carrier] => 0 [id_currency] => 1 [id_customer] => 0 [id_guest] => 566066 [id_lang] => 1 [recyclable] => 0 [gift] => 0 [gift_message] => [mobile_theme] => 0 [delivery_option] => [secure_key] => [allow_seperated_package] => 0 [date_add] => 2017-02-23 12:25:44 [date_upd] => 2017-02-23 12:25:44) <b>Argument [2]</b> </pre></li><li><b>ObjectModelCore->add</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_4').style.display = (document.getElementById('psTrace_4').style.display != 'block') ? 'block' : 'none'; return false">[line 180 - classes/Cart.php]</a> - <a href="#" onclick="document.getElementById('psArgs_4').style.display = (document.getElementById('psArgs_4').style.display != 'block') ? 'block' : 'none'; return false">[1 Arguments]</a><div class="psTrace" id="psTrace_4" ><pre>174. if (!$this->id_lang)175. $this->id_lang = Configuration::get('PS_LANG_DEFAULT');176. if (!$this->id_shop)177. $this->id_shop = Context::getContext()->shop->id;178. <span class="selected">179. $return = parent::add($autodate);</span>180. Hook::exec('actionCartSave');181. 182. return $return;183. }184. </pre></div><div class="psArgs" id="psArgs_4"><pre><b>Argument [0]</b>1</pre></li><li><b>CartCore->add</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_5').style.display = (document.getElementById('psTrace_5').style.display != 'block') ? 'block' : 'none'; return false">[line 245 - controllers/front/CartController.php]</a> - <span style="font-size: 12px;">[0 Argument]</a><div class="psTrace" id="psTrace_5" ><pre>239. if (Context::getContext()->cookie->id_guest)240. {241. $guest = new Guest(Context::getContext()->cookie->id_guest);242. $this->context->cart->mobile_theme = $guest->mobile_theme;243. }<span class="selected">244. $this->context->cart->add();</span>245. if ($this->context->cart->id)246. $this->context->cookie->id_cart = (int)$this->context->cart->id;247. }248. 249. // Check customizable fields</pre></div></li><li><b>CartControllerCore->processChangeProductInCart</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_6').style.display = (document.getElementById('psTrace_6').style.display != 'block') ? 'block' : 'none'; return false">[line 72 - controllers/front/CartController.php]</a> - <span style="font-size: 12px;">[0 Argument]</a><div class="psTrace" id="psTrace_6" ><pre>66. {67. // Update the cart ONLY if $this->cookies are available, in order to avoid ghost carts created by bots68. if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid()))69. {70. if (Tools::getIsset('add') || Tools::getIsset('update'))<span class="selected">71. $this->processChangeProductInCart();</span>72. elseif (Tools::getIsset('delete'))73. $this->processDeleteProductInCart();74. elseif (Tools::getIsset('changeAddressDelivery'))75. $this->processChangeProductAddressDelivery();76. elseif (Tools::getIsset('allowSeperatedPackage'))</pre></div></li><li><b>CartControllerCore->postProcess</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_7').style.display = (document.getElementById('psTrace_7').style.display != 'block') ? 'block' : 'none'; return false">[line 158 - classes/controller/Controller.php]</a> - <span style="font-size: 12px;">[0 Argument]</a><div class="psTrace" id="psTrace_7" ><pre>152. // setMedia MUST be called before postProcess153. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))154. $this->setMedia();155. 156. // postProcess handles ajaxProcess<span class="selected">157. $this->postProcess();</span>158. 159. if (!empty($this->redirect_after))160. $this->redirect();161. 162. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))</pre></div></li><li><b>ControllerCore->run</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_8').style.display = (document.getElementById('psTrace_8').style.display != 'block') ? 'block' : 'none'; return false">[line 348 - classes/Dispatcher.php]</a> - <span style="font-size: 12px;">[0 Argument]</a><div class="psTrace" id="psTrace_8" ><pre>342. // Execute hook dispatcher343. if (isset($params_hook_action_dispatcher))344. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);345. 346. // Running controller<span class="selected">347. $controller->run();</span>348. }349. catch (PrestaShopException $e)350. {351. $e->displayMessage();352. }</pre></div></li><li><b>DispatcherCore->dispatch</b> - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById('psTrace_9').style.display = (document.getElementById('psTrace_9').style.display != 'block') ? 'block' : 'none'; return false">[line 28 - index.php]</a> - <span style="font-size: 12px;">[0 Argument]</a><div class="psTrace" id="psTrace_9" ><pre>22. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)23. * International Registered Trademark & Property of PrestaShop SA24. */25. 26. require(dirname(__FILE__).'/config/config.inc.php');<span class="selected">27. Dispatcher::getInstance()->dispatch();</span>28. </pre></div></li></ul></div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now