You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First I want to mention that I'm on PHP 7.2.13, now the problem:
I have webstore that logged users and guest users are allowed to add items to cart. I'm using DatabaseStorage, when logged in user adds item in the cart, the module creates record in the cart table with sessionId : {logged_in_user_id} Ex: 1, and when Guest user adds item in the cart, the module creates record in the cart table with sessionId : {session_id} Ex: 77g9t9t5u5qdvrogoi4j0muiam , ONLY when both of these record types exists in the Cart Table, when you try to delete the last item in the cart from the LOGGED User (sessionId: 1), it throws the error:
SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '77g9t9t5u5qdvrogoi4j0muiam'
The SQL being executed was: DELETE FROM cart WHERE sessionId=1
I resolve this by chaning this: (DatabaseStorage.php Line:132)
$command->delete($this->table, [$this->idField => $identifier]);
to this:
$command->delete($this->table, [$this->idField => (string)$identifier]);
The text was updated successfully, but these errors were encountered:
First I want to mention that I'm on PHP 7.2.13, now the problem:
SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '77g9t9t5u5qdvrogoi4j0muiam'
The SQL being executed was: DELETE FROM
cart
WHEREsessionId
=1I resolve this by chaning this: (DatabaseStorage.php Line:132)
$command->delete($this->table, [$this->idField => $identifier]);
to this:
$command->delete($this->table, [$this->idField => (string)$identifier]);
The text was updated successfully, but these errors were encountered: