28 lines
509 B
JavaScript
28 lines
509 B
JavaScript
|
|
||
|
module.exports =
|
||
|
{
|
||
|
check: function (conn, callback)
|
||
|
{
|
||
|
conn.execQuery ('CALL basket_check ()',
|
||
|
this._onBasketCheck.bind (this, callback));
|
||
|
}
|
||
|
|
||
|
,_onBasketCheck: function (callback, resultSet)
|
||
|
{
|
||
|
var status = resultSet.fetchValue ();
|
||
|
|
||
|
if (!status)
|
||
|
return;
|
||
|
|
||
|
var isOk = status == 'UPDATED' || status == 'OK';
|
||
|
|
||
|
if (status == 'UPDATED')
|
||
|
Htk.Toast.showWarning (_('OrderItemsUpdated'));
|
||
|
if (callback)
|
||
|
callback (isOk);
|
||
|
if (!isOk)
|
||
|
Vn.Hash.set ({'form': 'ecomerce/checkout'});
|
||
|
}
|
||
|
};
|
||
|
|