allapasq Posted February 19 Share Posted February 19 Sto ricevendo alcuni ordini senza status, con prodotti mancanti ma con il totale corretto. L'unico errore che ho trovato nei log è questo del modulo scalapay, ma il problema si è verificato anche con altri metodi di pagamento: [scalapay]: Impossible to create the order: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-0-1-0' for key 'product_sqlstock' [{"file":"\/home\/dymmuyyi\/public_html\/classes\/db\/Db.php","line":377,"function":"_query","class":"DbPDOCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/db\/Db.php","line":744,"function":"query","class":"DbCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/db\/Db.php","line":477,"function":"q","class":"DbCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/ObjectModel.php","line":622,"function":"insert","class":"DbCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/stock\/StockAvailable.php","line":469,"function":"add","class":"ObjectModelCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/src\/Adapter\/StockManager.php","line":77,"function":"add","class":"StockAvailableCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/src\/Core\/Stock\/StockManager.php","line":131,"function":"getStockAvailableByProduct","class":"PrestaShop\\PrestaShop\\Adapter\\StockManager","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/src\/Core\/Stock\/StockManager.php","line":176,"function":"updatePacksQuantityContainingProduct","class":"PrestaShop\\PrestaShop\\Core\\Stock\\StockManager","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/stock\/StockAvailable.php","line":558,"function":"updateQuantity","class":"PrestaShop\\PrestaShop\\Core\\Stock\\StockManager","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/order\/OrderDetail.php","line":562,"function":"updateQuantity","class":"StockAvailableCore","type":"::"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/order\/OrderDetail.php","line":783,"function":"updateProductQuantityInStock","class":"OrderDetailCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/order\/OrderDetail.php","line":826,"function":"create","class":"OrderDetailCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/PaymentModule.php","line":1105,"function":"createList","class":"OrderDetailCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/override\/classes\/PaymentModule.php","line":181,"function":"createOrderFromCart","class":"PaymentModuleCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/modules\/scalapay\/controllers\/front\/return.php","line":169,"function":"validateOrder","class":"PaymentModule","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/controller\/Controller.php","line":308,"function":"postProcess","class":"ScalapayReturnModuleFrontController","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/classes\/Dispatcher.php","line":510,"function":"run","class":"ControllerCore","type":"->"},{"file":"\/home\/dymmuyyi\/public_html\/index.php","line":28,"function":"dispatch","class":"DispatcherCore","type":"->"}] In sostanza da quello che ho potuto capire cerca di cambiare la quantità in magazzino di un prodotto con id 0. La versione di Prestashop è 8.1.4 Link to comment Share on other sites More sharing options...
fedesib Posted February 20 Share Posted February 20 Ciao, l'errore indica che stai cercando di usare due volte lo stesso valore per una certa chiave (product_sqlstock) nella stessa tabella e questo non è consentito perchè la chiave in questione deve evidentemente essere unica (in base alle caratteristiche della tabella). Da quello che ricordo nelle tabelle che hanno a che vedere con il magazzino (ps_stock_*) non esiste una chiave che si chiama "product_sqlstock": stai per caso usando un modulo di terze parti per la gestione del magazzino o hai fatto/fatto fare delle modifiche custom al DB? Se così fosse rivolgiti a chi ha sviluppato il modulo o a chi ha fatto le modifiche. Buona giornata, Federica Link to comment Share on other sites More sharing options...
allapasq Posted February 20 Author Share Posted February 20 Questa è la definizione della chiave product_sqlstock di Prestashop: UNIQUE `product_sqlstock` ( `id_product`, `id_product_attribute`, `id_shop`, `id_shop_group` ) Il problema come dicevo è che cerca di modificare la quantità in magazzino di un prodotto con id_product = 0, il che ovviamente è sbagliato. 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