<?php require_once cf\Config::path . 'api/form.php'; require_once cf\Config::path . 'cart.php'; $orderform = cf\api\form\get('order'); $clientInfo = cf\api\form\results($orderform); if ($clientInfo) { $products = \cf\api\cart\getList(); $sum = $products['total']; $orderId = cf\Cart::order($clientInfo['name'], $clientInfo['email'], $clientInfo['phone'], $clientInfo['address'], $clientInfo['comments']); echo json_encode(array('id' => $orderId, 'text' => cf\query2Var("SELECT comments FROM cf_orders WHERE id=:id", array('id' => $orderId)), 'sum' => $sum['sum'])); exit; } $smarty->assign('orderform', $orderform);
<?php require_once cf\Config::path . 'api/form.php'; $feedback = cf\api\form\get('feedback'); if (cf\api\form\send($feedback)) { $page = cf\Page::get('sent'); return; } $smarty->assign('feedback', $feedback);