OpenCart 🇺🇦

Схема

public mixed confirm ( $order_info, $order_total )

Аргументы

Аргумент Возможный тип Описание
$order_info
$order_total

Описание

Метод пока еще не документирован.

Исходный код

$this->language->load('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);
}	

if ($points) {
	$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()");				
}