request->get('to', 'string')){ $weight = max(1, $simpla->request->get('weight')); $data = file_get_contents('http://emspost.ru/api/rest?method=ems.calculate&from='.$simpla->settings->emsfrom.'&to='.$to.'&weight='.$weight); $data = json_decode($data); $simpla->design->assign('all_currencies', $simpla->money->get_currencies()); $simpla->design->assign('data', $data); $result = $simpla->design->fetch('ajax_price.tpl'); } header("Content-type: application/json; charset=UTF-8"); header("Cache-Control: must-revalidate"); header("Pragma: no-cache"); header("Expires: -1"); print json_encode($result);