Dreamkas 3.x Dreamkas 3.x 1.02 Anthony Axenov, Alexey Kopylov (based on code by alt-team.ru) https://github.com/anthonyaxenov/dreamkas-opencart-3 {{ entry_price }}]]>
]]>
db->query("DELETE FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");]]> db->query("UPDATE " . DB_PREFIX . "product SET dk_tax_type = '" . $this->db->escape($data['dk_tax_type']) . "' WHERE product_id = '" . (int)$product_id . "'"); } ]]> load->model('catalog/recurring');]]> request->post['dk_tax_type'])) { $data['dk_tax_type'] = $this->request->post['dk_tax_type']; } elseif (!empty($product_info['dk_tax_type'])) { $data['dk_tax_type'] = $product_info['dk_tax_type']; } else { $data['dk_tax_type'] = ''; } ]]> {{ column_action }}]]> Статус фискализации]]> {{ order.date_modified }}]]> {{order.dk_status}}]]> {{ text_affiliate }} ]]> {{ entry_dk_status }} {% if dk_status %} {{dk_status }} {%endif%} ]]> model_sale_order->getOrders($filter_data); ]]> db->query("SELECT dk_status FROM " . DB_PREFIX . "dreamkas WHERE order_id = '" . (int)$result['order_id']. "'"); ]]> $result['shipping_code'],]]> !empty($dkquery->row['dk_status'])?$dkquery->row['dk_status']:'', ]]> language->get('date_format_short'), strtotime($order_info['date_added']));]]> db->query("SELECT order_status_id FROM `" . DB_PREFIX . "order` o WHERE o.order_id = '" . (int)$order_id . "'"); $status = $query->row['order_status_id']; $query = $this->db->query("SELECT payment_code FROM `" . DB_PREFIX . "order` o WHERE o.order_id = '" . (int)$order_id . "'"); $payment_code = $query->row['payment_code']; if ($status == $this->config->get('dreamkas_paid_order') && in_array($payment_code, $this->config->get('dreamkas_payments_ids'))) { $query = $this->db->query("SELECT dk_id FROM " . DB_PREFIX . "dreamkas WHERE order_id = '" . (int)$order_id. "'"); if(!empty($query->row['dk_id'])) { $dk_id = $query->row['dk_id']; $ch = curl_init(); $access_token = $this->config->get('dreamkas_access_token'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "Authorization: Bearer $access_token" )); curl_setopt($ch, CURLOPT_URL, "https://kabinet.dreamkas.ru/api/operations/".$dk_id); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); $response = curl_exec($ch); curl_close($ch); $response = json_decode($response, true); if((substr($response['status'], 0, 1)==4)) { $this->log->write('Dreamkas debug: ' . json_encode($response)); } elseif(!empty($response['data']['error'])) { $this->log->write('Dreamkas debug: ' . json_encode($response['data']['error'])); } else { $dk_date = empty($response['createdAt'])?$response['completedAt']:$response['createdAt']; $this->db->query("UPDATE `" . DB_PREFIX . "dreamkas` SET `order_id` = '" . (int)$order_id . "', `dk_id` = '".$response['id']."', `dk_date` ='".$dk_date."', `dk_status` = '" .$response['status']. "' WHERE order_id = '" . (int)$order_id. "'"); } } } $query = $this->db->query("SELECT dk_status FROM " . DB_PREFIX . "dreamkas WHERE order_id = '" . (int)$order_id. "'"); if(!empty($query->row['dk_status'])) { $data['dk_status'] = $query->row['dk_status']; } else { $data['dk_status'] = ''; } $this->load->language('extension/module/dreamkas'); $data['entry_dk_status'] = $this->language->get('entry_dk_status'); ]]>