function ajax_getmoney($print = true) { $id = abs((int) $_GET['id']); $v = 0; if ($id > 0) { $model = new fpp_pay_per_weight_Model(); $orm = $model->db2cls($id); $data = unserialize($orm->calculate); foreach ($data['calculate']['w'] as $key => $value) { if ($value <= $_SESSION['conf']['cart']['weight']) { $v = $data['calculate']['c'][$key]; } } $v1 = $v; Basic::currency($v1); if ($print) { echo $v1; } else { return $v; } } }
function refresh_prices_shipping() { $district = @$_SESSION['conf']['order']['district']; // $model = new fpp_district_Model(); $model = new fpp_pay_per_weight_Model(); $md = new Ship_weight_local(); $orm = $model->db2cls($district); $_GET['id'] = $district; $ty = __($orm->type, false); $_SESSION['conf']['order']['district_name'] = $orm->name . "({$ty})"; $_SESSION['conf']['order']['district_price'] = $md->ajax_getmoney(false); $p = $_SESSION['conf']['order']['district_price']; Basic::currency($p); $_SESSION['conf']['order']['district_price_format'] = $p; }