Jump to content

Problem adding product to cart (at line 791 in file classes/db/Db.php)


nacxo

Recommended Posts

Impossible to add the product to the cart.
textStatus: 'error'
errorThrown: 'Internal Server Error'
responseText:

[PrestaShopDatabaseException]

Duplicate entry '0' for key 'PRIMARY'
 

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', '2114133', '1', '0', '0', '', '0', '', '', '0', '2016-09-15 09:42:39', '2016-09-15 09:42:39')

at line 791 in file classes/db/Db.php

786.         if ($webservice_call && $errno) {787.             $dbg = debug_backtrace();788.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);789.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {790.             if ($sql) {791.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');792.             }793. 794.             throw new PrestaShopDatabaseException($this->getMsgError());795.         }796.     }
Edited by nacxo (see edit history)
Link to comment
Share on other sites

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...