uawdijnntqw1x1x1
IP : 18.218.245.238
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,parse_ini_file,show_source,eval,open_base,symlink
OS : Linux
PATH:
/
home
/
sudancam
/
.trash
/
post-ratings.1
/
..
/
wp-content
/
..
/
catalog.2
/
model
/
extension
/
total
/
reward.php
/
/
<?php class ModelExtensionTotalReward extends Model { public function getTotal($total) { if (isset($this->session->data['reward'])) { $this->load->language('extension/total/reward', 'reward'); $points = $this->customer->getRewardPoints(); if ($this->session->data['reward'] <= $points) { $discount_total = 0; $points_total = 0; foreach ($this->cart->getProducts() as $product) { if ($product['points']) { $points_total += $product['points']; } } $points = min($points, $points_total); foreach ($this->cart->getProducts() as $product) { $discount = 0; if ($product['points']) { $discount = $product['total'] * ($this->session->data['reward'] / $points_total); if ($product['tax_class_id']) { $tax_rates = $this->tax->getRates($product['total'] - ($product['total'] - $discount), $product['tax_class_id']); foreach ($tax_rates as $tax_rate) { if ($tax_rate['type'] == 'P') { $total['taxes'][$tax_rate['tax_rate_id']] -= $tax_rate['amount']; } } } } $discount_total += $discount; } $total['totals'][] = array( 'code' => 'reward', 'title' => sprintf($this->language->get('reward')->get('text_reward'), $this->session->data['reward']), 'value' => -$discount_total, 'sort_order' => $this->config->get('total_reward_sort_order') ); $total['total'] -= $discount_total; } } } public function confirm($order_info, $order_total) { $this->load->language('extension/total/reward'); $points = 0; $start = strpos($order_total['title'], '(') + 1; $end = strrpos($order_total['title'], ')'); if ($start && $end) { $points = substr($order_total['title'], $start, $end - $start); } $this->load->model('account/customer'); if ($this->model_account_customer->getRewardTotal($order_info['customer_id']) >= $points) { $this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()"); } else { return $this->config->get('config_fraud_status_id'); } } public function unconfirm($order_id) { $this->db->query("DELETE FROM " . DB_PREFIX . "customer_reward WHERE order_id = '" . (int)$order_id . "' AND points < 0"); } }
/home/sudancam/.trash/post-ratings.1/../wp-content/../catalog.2/model/extension/total/reward.php