mkm
Posts: 10
|
Posted: 03/24/2012, 1:35 PM |
|
Hi
Solution: Store, Page: Header, file: header_events.
After inserting new shoping_cart into DB, when the new cookie is created, the new cart id is taken using the SQL statement:
$SQL = "SELECT MAX(shopping_cart_id) FROM store_shopping_carts";
$db->query($SQL);
if($db->next_record()) {
$last_cart_id = $db->f(0);
}
It is possible to generate mistakes, because more than one person may make new shopping basket in the same time ...
The better option is to use PHP method:
$last_cart_id = mysql_insert_id();
thanks this you are sure of taking the proper ID because this method works in the current user session scope.
Regards
ProtonX
|
|
|
|