в order php вставил такой код:
Код:
if (Tools::isSubmit('vremya') AND !empty($_POST['vremya']))
{
if (!Validate::isvremya($_POST['vremya']))
$errors[] = Tools::displayError('invalid vremya');
elseif ($oldvremya = vremya::getvremyaByCartId(intval($cart->id)))
{
$vremya = new vremya(intval($oldvremya['id_vremya']));
$vremya->vremya = htmlentities($_POST['vremya'], ENT_COMPATV, 'UTF-8');
$vremya->update();
}
else
{
$vremya = new vremya();
$vremya->vremya = htmlentities($_POST['vremya'], ENT_COMPATV, 'UTF-8');
$vremya->id_cart = intval($cart->id);
$vremya->id_customer = intval($cart->id_customer);
$vremya->add();
}
}
if (sizeof($errors))
{
if (Tools::getValue('ajax'))
die('{\'hasError\' : true, errors : [\''.implode('\',\'', $errors).'\']}');
$smarty->assign('errors', $errors);
displayAddress();
include_once(dirname(__FILE__).'/footer.php');
exit;
}
if (Tools::getValue('ajax'))
die(true);
}
Сообщение отредактировано Sega063 16-06-2011 04:28 ...