Paveli Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 Кто поставить модуль ( opencart 1.5.4.1 Модуль дополнительное описание ) Надіслати Поділитися на інших сайтах More sharing options...
kJlukOo Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 скачать ftp клиент типа файл зиллы . зайти по фтп протоколу в корневую директорию сайта и залить файлы модуля с заменой(осторожно замена может быть губительна). в гугле вон сотни мануалов, если мое сообщение не понятно Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 а как сделать без губительной замены? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 10 минут назад, Paveli сказал: а как сделать без губительной замены? для этого нужен хрустальный шар и бубен Надіслати Поділитися на інших сайтах More sharing options... Eldaeron Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 27 хвилин назад, Paveli сказав: а как сделать без губительной замены? Всегда перед заменою делать резервные копии файлов и баз данных. Лучше всего сначала разворачивать на тесте копию сайта и там уже пробовать, а не на боевом сайте. Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 что никто чайнику помочь не хочет? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 7 минут назад, Paveli сказал: что никто чайнику помочь не хочет? добавьте- уникальному чайнику с опенкартом 1.5.4 в 2020 году. это важно Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 а че? на это нет vqmod? + инструкции Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 не нашёл Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 1 минуту назад, Dimasscus сказал: чайнику с опенкартом 1.5.4 та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 17 минут назад, chukcha сказал: та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod я ж даже не спорю. сам иногда на такое натыкаюсь. там реально уже столько впихнуто что без бубна и шара не разобрать Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 И что делать? Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 17 минут назад, Paveli сказал: И что делать? Искать исполнителя Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options... SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 3 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Разное Курилка Помогите чайнику Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення Повний пакет SEO Автор: GeekoDev SameSite Session Fix Opencart 3 Автор: web_bond SP Telegram повідомлення FREE Автор: spectre Відключити порожні категорії Автор: spectre SEO Автор тексту категорії / фільтра / блогу з датою оновлення контенту + мікророзмітка Автор: radaevich × Уже зареєстровані? Ввійти Реєстрація Ваші замовлення Назад Придбані модулі та шаблони Ваші рахунки Лист очікувань Альтернативні контакти Форум Новини ocStore Назад Офіційний сайт Демо ocStore 3.0.3.2 Демо ocStore 2.3.0.2.4 Завантажити ocStore Документація Історія версій ocStore Блоги Модулі Шаблони Назад Безкоштовні шаблони Платні шаблони Де купувати модулі? Послуги FAQ OpenCart.Pro Назад Демо Купити Порівняння × Створити... Important Information На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність. Я даю згоду
Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 а как сделать без губительной замены? Надіслати Поділитися на інших сайтах More sharing options...
Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 10 минут назад, Paveli сказал: а как сделать без губительной замены? для этого нужен хрустальный шар и бубен Надіслати Поділитися на інших сайтах More sharing options...
Eldaeron Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 27 хвилин назад, Paveli сказав: а как сделать без губительной замены? Всегда перед заменою делать резервные копии файлов и баз данных. Лучше всего сначала разворачивать на тесте копию сайта и там уже пробовать, а не на боевом сайте. Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 что никто чайнику помочь не хочет? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 7 минут назад, Paveli сказал: что никто чайнику помочь не хочет? добавьте- уникальному чайнику с опенкартом 1.5.4 в 2020 году. это важно Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 а че? на это нет vqmod? + инструкции Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 не нашёл Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 1 минуту назад, Dimasscus сказал: чайнику с опенкартом 1.5.4 та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 17 минут назад, chukcha сказал: та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod я ж даже не спорю. сам иногда на такое натыкаюсь. там реально уже столько впихнуто что без бубна и шара не разобрать Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 И что делать? Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 17 минут назад, Paveli сказал: И что делать? Искать исполнителя Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options... SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 3 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Разное Курилка Помогите чайнику Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення Повний пакет SEO Автор: GeekoDev SameSite Session Fix Opencart 3 Автор: web_bond SP Telegram повідомлення FREE Автор: spectre Відключити порожні категорії Автор: spectre SEO Автор тексту категорії / фільтра / блогу з датою оновлення контенту + мікророзмітка Автор: radaevich
Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 что никто чайнику помочь не хочет? Надіслати Поділитися на інших сайтах More sharing options...
Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 7 минут назад, Paveli сказал: что никто чайнику помочь не хочет? добавьте- уникальному чайнику с опенкартом 1.5.4 в 2020 году. это важно Надіслати Поділитися на інших сайтах More sharing options...
chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 а че? на это нет vqmod? + инструкции Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 не нашёл Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 1 минуту назад, Dimasscus сказал: чайнику с опенкартом 1.5.4 та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 17 минут назад, chukcha сказал: та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod я ж даже не спорю. сам иногда на такое натыкаюсь. там реально уже столько впихнуто что без бубна и шара не разобрать Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 И что делать? Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 17 минут назад, Paveli сказал: И что делать? Искать исполнителя Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options... SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 3 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Разное Курилка Помогите чайнику
Paveli Опубліковано: 21 лютого 2020 Автор Share Опубліковано: 21 лютого 2020 не нашёл Надіслати Поділитися на інших сайтах More sharing options...
chukcha Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 1 минуту назад, Dimasscus сказал: чайнику с опенкартом 1.5.4 та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 17 минут назад, chukcha сказал: та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod я ж даже не спорю. сам иногда на такое натыкаюсь. там реально уже столько впихнуто что без бубна и шара не разобрать Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 И что делать? Надіслати Поділитися на інших сайтах More sharing options... chukcha Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 17 минут назад, Paveli сказал: И что делать? Искать исполнителя Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options... SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 3 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку
Dimasscus Опубліковано: 21 лютого 2020 Share Опубліковано: 21 лютого 2020 17 минут назад, chukcha сказал: та нормально Дело в том. что за столько лет.. админка изменена и доведена, практически до идеала За столько лет менагеры привыклт Стоимость работ возрастает недавно define('VERSION', '1.5.3.1'); 90 файлов интсрукций vqmod я ж даже не спорю. сам иногда на такое натыкаюсь. там реально уже столько впихнуто что без бубна и шара не разобрать Надіслати Поділитися на інших сайтах More sharing options...
Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 И что делать? Надіслати Поділитися на інших сайтах More sharing options...
chukcha Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 17 минут назад, Paveli сказал: И что делать? Искать исполнителя Надіслати Поділитися на інших сайтах More sharing options... Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options... Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options... SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options... Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 3
Paveli Опубліковано: 22 лютого 2020 Автор Share Опубліковано: 22 лютого 2020 кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? Надіслати Поділитися на інших сайтах More sharing options...
Dimasscus Опубліковано: 22 лютого 2020 Share Опубліковано: 22 лютого 2020 3 часа назад, Paveli сказал: кто подскажет на какую версию лучше перенести сайт с версии 1.5.4.1? исполнитель который будет переносить. но для понимания ему нужен доступ к админке сайта чтобы оценить те изменения и доработки которые уже есть на сайте и возможность(трудоемкость) реализации их на новом сайте. для вашего понимания- просто перенести сайт с 1.5.4.1 на ту же стабильную 2.3 не получится. это по сути создание нового сайта по прототипу старого. так как отличия кардинальные Надіслати Поділитися на інших сайтах More sharing options...
SiteMix Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 В 22.02.2020 в 00:51, Paveli сказал: что никто чайнику помочь не хочет? Как можно помочь не зная сути проблемы? Выше дали инструкцию. Вы пробовали? Что именно не получается? Ну или поручите кому-то сделать за вознаграждение. Если, конечно, решили остаться на 1.5. Надіслати Поділитися на інших сайтах More sharing options...
Shrumi Опубліковано: 23 лютого 2020 Share Опубліковано: 23 лютого 2020 (змінено) Ребят, я извиняюсь, что вклиниваюсь тут со своим, - стоит OpenCart 2.0.3.1, нужно добавить ввод произвольного адреса доставки, думал xshippingpro мне поможет, а там корзина от kttsoft с двумя вариантами Новой Пошты, и вот какой код куда добавлять, с учётом что я не программист ни разу, ни пхп ни аякс не ведаю.. ? Корзина: admin\controller\module kttsoftcartset.php admin\language\russian\module kttsoftcartset.php admin\view\template\module kttsoftcartset.tpl catalog\controller\module kttsoftcart.php catalog\language\russian\module kttsoftcart.php catalog\model\module kttsoftcart.php catalog\view\theme\default\template\module kttsoftcart.tpl Змінено 23 лютого 2020 користувачем Shrumi Надіслати Поділитися на інших сайтах More sharing options...
Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 Цитата <?php class ControllerModuleKttsoftcart extends Controller { public function index() { $data = array(); $this->load->language('module/kttsoftcart'); $data['button_shopping'] = $this->language->get('button_shopping'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_payment_methods'] = $this->language->get('text_payment_methods'); $data['text_firstname'] = $this->language->get('text_firstname'); $data['text_lastname'] = $this->language->get('text_lastname'); $data['text_phone'] = $this->language->get('text_phone'); $data['text_email'] = $this->language->get('text_email'); $data['text_shipping_methods'] = $this->language->get('text_shipping_methods'); $data['text_warehouse'] = $this->language->get('text_warehouse'); $data['text_city'] = $this->language->get('text_city'); $data['text_street'] = $this->language->get('text_street'); $data['text_house'] = $this->language->get('text_house'); $data['text_flat'] = $this->language->get('text_flat'); $data['text_number'] = $this->language->get('text_number'); $data['button_checkout'] = $this->language->get('button_checkout'); $data['text_shipping_question'] = $this->language->get('text_shipping_question'); $data['text_comment'] = $this->language->get('text_comment_text'); $data['text_comment_placeholder'] = $this->language->get('text_comment_placeholder'); $data['store_telephone'] = $this->config->get('config_telephone'); $data['store_email'] = $this->config->get('config_email'); $data['open'] = nl2br($this->config->get('config_open')); $data['heading_cartpopup_title_empty'] = $this->language->get('heading_cartpopup_title_empty'); $data['text_cartpopup_empty'] = $this->language->get('text_cartpopup_empty'); if ( isset( $this->request->request['remove'] ) ) { $this->cart->remove( $this->request->request['remove'] ); unset( $this->session->data['vouchers'][$this->request->request['remove']] ); } if ( isset( $this->request->request['update'] ) ) { $this->cart->update( $this->request->request['update'], $this->request->request['quantity'] ); } if ( isset( $this->request->request['add'] ) ) { $this->cart->add( $this->request->request['add'], $this->request->request['quantity'] ); } if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error']; unset($this->session->data['error']); } else { $data['error_warning'] = ''; } if ($this->config->get('config_customer_price') && !$this->customer->isLogged()) { $data['attention'] = sprintf($this->language->get('text_login'), $this->url->link('account/login'), $this->url->link('account/register')); } else { $data['attention'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $this->load->model('tool/image'); $this->load->model('tool/upload'); $data['products'] = array(); $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_in_cart) { if ($product_in_cart['product_id'] == $product['product_id']) { $product_total += $product_in_cart['quantity']; } } if ($product['minimum'] > $product_total) { $data['error_warning'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); } if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], 80, 80); } else { $image = $this->model_tool_image->resize("placeholder.png", 80, 80); } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $data['products'][] = array( 'key' => $product['key'], 'product_id' => $product['product_id'], 'thumb' => $image, 'minimum' => $product['minimum'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_cartpopup_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $data['totals'] = array(); foreach ($total_data as $total) { $data['totals'][] = array( 'title' => $total['title'], 'text' => $this->currency->format($total['value']) ); } $data['checkout_link'] = $this->url->link('module/kttsoftcart/checkout')/*$this->url->link('checkout/checkout')*/; $cart_number = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0); function getcartword($number, $suffix) { $keys = array(2, 0, 1, 1, 1, 2); $mod = $number % 100; $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; return $suffix[$suffix_key]; } $textcart_array = array('textcart_1', 'textcart_2', 'textcart_3'); $textcart = getcartword($cart_number, $textcart_array); $data['heading_cartpopup_title'] = sprintf($this->language->get($textcart), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0)); // getting info about customer if logged in if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $data['customer_id'] = $this->customer->getId(); $data['customer_group_id'] = $customer_info['customer_group_id']; $data['fax'] = $customer_info['fax']; $data['custom_field'] = unserialize($customer_info['custom_field']); $data['firstname'] = $customer_info['firstname']; $data['lastname'] = $customer_info['lastname']; $data['email'] = $customer_info['email']; $data['telephone'] = $customer_info['telephone']; } else { $data['customer_id'] = 0; $data['customer_group_id'] = 1; $data['fax'] = ''; $data['custom_field'] = ''; } // Payment Methods $data['payment_methods'] = $this->getPaymentMethods($total); //shipping methods ONLY FOR NOVAPOSHTA $data['shipping_methods'] = array( 'novaposhta_branch' => $this->getShippingMethodByCode('novaposhta_branch'), 'novaposhta_curier' => $this->getShippingMethodByCode('novaposhta_curier') ); // novaposhta $this->load->model('module/kttsoftcart'); $cities = $this->model_module_kttsoftcart->getCitiesRu(); $city_ref = $cities->row['city_ref']; // $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($city_ref); $data['cities'] = $cities->rows; $data['text_warehouse'] = $this->language->get('text_warehouse'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/kttsoftcart.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/module/kttsoftcart.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/module/kttsoftcart.tpl', $data)); } } public function status_cart() { $json = array(); $this->load->language('module/kttsoftcart'); $this->load->model('extension/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } $json['total'] = ''.$this->cart->countProducts();//sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function checkout() { $order_data = array(); $order_data['invoice_prefix'] = $this->config->get('config_invoice_prefix'); $order_data['store_id'] = $this->config->get('config_store_id'); $order_data['store_name'] = $this->config->get('config_name'); if ($order_data['store_id']) { $order_data['store_url'] = $this->config->get('config_url'); } else { $order_data['store_url'] = HTTP_SERVER; } $order_data['totals'] = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('extension/extension'); $sort_order = array(); $results = $this->model_extension_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($order_data['totals'], $total, $taxes); } } $sort_order = array(); foreach ($order_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $order_data['totals']); if ($this->customer->isLogged()) { $this->load->model('account/customer'); $customer_info = $this->model_account_customer->getCustomer($this->customer->getId()); $order_data['customer_id'] = $this->customer->getId(); $order_data['customer_group_id'] = $customer_info['customer_group_id']; $order_data['fax'] = $customer_info['fax']; $order_data['custom_field'] = unserialize($customer_info['custom_field']); } else { $order_data['customer_id'] = 0; $order_data['customer_group_id'] = 1; $order_data['fax'] = ''; $order_data['custom_field'] = ''; } $total = $this->currency->format($this->request->post['total'], '','', false); $firstname = $this->request->post['firstname']; $lastname = $this->request->post['lastname']; $telephone = $this->request->post['phone']; $email = $this->request->post['mail']; $order_data['comment'] = isset($this->request->post['comment']) ? $this->request->post['comment'] : ''; $order_data['firstname'] = $firstname; $order_data['lastname'] = $lastname; $order_data['telephone'] = $telephone; $order_data['email'] = $email; $order_data['total'] = $total; //payment info $this->load->model('module/kttsoftcart'); // $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row; if ($this->request->post['shipping_method'] == 'novaposhta_branch') { $warehouse = $this->model_module_kttsoftcart->getWarehouseRuByRef($this->request->post['payment_warehouse'])->row; $address = $warehouse['warehouse_name']; $city = $warehouse['city_name']; } else if ($this->request->post['shipping_method'] == 'novaposhta_curier') { $city = $this->model_module_kttsoftcart->getCityRuByRef($this->request->post['payment_city'])->row['city_name']; $street = $this->request->post['shipping_street']; $house = $this->request->post['shipping_house']; $flat = $this->request->post['shipping_flat']; $address = "$street д.$house кв.$flat"; } $address = str_replace("\"", "'", $address); $order_data['payment_firstname'] = $firstname; $order_data['payment_lastname'] = $lastname; $order_data['payment_company'] = ''; $order_data['payment_address_1'] = $address; //replace double quotes $order_data['payment_address_2'] = ''; $order_data['payment_city'] = $city; $order_data['payment_postcode'] = ''; $order_data['payment_zone'] = ''; $order_data['payment_zone_id'] = 0; //TODO: remove $order_data['payment_country'] = 'Ukraine'; //TODO: remove $order_data['payment_country_id'] = 220; //TODO: remove $order_data['payment_address_format'] = ''; $order_data['payment_custom_field'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => substr(md5(mt_rand()), 0, 10), 'to_name' => $voucher['to_name'], 'to_email' => $voucher['to_email'], 'from_name' => $voucher['from_name'], 'from_email' => $voucher['from_email'], 'voucher_theme_id' => $voucher['voucher_theme_id'], 'message' => $voucher['message'], 'amount' => $voucher['amount'] ); } } $payment_code = $this->request->post['payment_method']; $payment_method = $this->getPaymentMethodByCode($payment_code, $total); foreach ($payment_method as $key => $value) { $order_data['payment_method'] = $value['title']; $order_data['payment_code'] = $value['code']; } // shipment info $order_data['shipping_firstname'] = $firstname; $order_data['shipping_lastname'] = $lastname; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = $address; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = $city; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = 0; //TODO: remove $order_data['shipping_country'] = 'Ukraine'; //TODO: remove $order_data['shipping_country_id'] = 220; //TODO: remove $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $shipping_code = $this->request->post['shipping_method']; $shipping_method = $this->getShippingMethodByCode($shipping_code); foreach ($shipping_method as $key => $value) { $order_data['shipping_method'] = $value['title']; foreach ($value['quote'] as $quote) { $order_data['shipping_code'] = $quote['code']; } } $order_data['products'] = array(); $quantity = 0; $products = $this->cart->getProducts(); foreach ($products as $product) { $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $product['option'], 'download' => '', 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['price']*$product['quantity'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); $quantity += $product['quantity']; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId(); $order_data['currency_code'] = $this->currency->getCode(); $order_data['currency_value'] = $this->currency->getValue($this->currency->getCode()); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; if (isset($this->request->cookie['tracking'])) { $order_data['tracking'] = $this->request->cookie['tracking']; $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']); if ($affiliate_info) { $order_data['affiliate_id'] = $affiliate_info['affiliate_id']; $order_data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } // Marketing $this->load->model('checkout/marketing'); $marketing_info = $this->model_checkout_marketing->getMarketingByCode($this->request->cookie['tracking']); if ($marketing_info) { $order_data['marketing_id'] = $marketing_info['marketing_id']; } else { $order_data['marketing_id'] = 0; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } if (!empty($this->request->server['HTTP_X_FORWARDED_FOR'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_X_FORWARDED_FOR']; } elseif (!empty($this->request->server['HTTP_CLIENT_IP'])) { $order_data['forwarded_ip'] = $this->request->server['HTTP_CLIENT_IP']; } else { $order_data['forwarded_ip'] = ''; } if (isset($this->request->server['HTTP_USER_AGENT'])) { $order_data['user_agent'] = $this->request->server['HTTP_USER_AGENT']; } else { $order_data['user_agent'] = ''; } if (isset($this->request->server['HTTP_ACCEPT_LANGUAGE'])) { $order_data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE']; } else { $order_data['accept_language'] = ''; } $this->load->model('checkout/order'); $json['new_order'] = 0; $this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data); $json['new_order'] = $this->session->data['order_id']; if($json['new_order']){ //$this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($json['new_order'], $this->config->get('cod_order_status_id')); $this->emptyCartOnSuccess($products); } // $this->sendMail($order_data['products'], $firstname, $telephone, $email, $total, $quantity, ''); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } protected function emptyCartOnSuccess($products) { foreach ($products as $key => $value) { $this->cart->remove($key); } return true; } public function getWarehouses() { $war_data = array(); $ref = $this->request->post['payment_city']; $this->load->model('module/kttsoftcart'); $warehouses = $this->model_module_kttsoftcart->getWarehousesByCityRefRu($ref); $war_data['warehouses'] = $warehouses->rows; $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($war_data)); } protected function getPaymentMethods($total) { $method_data = array(); $payment_address = array( "country" => "Ukrain", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('payment/' . $result['code']); $method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) { $method_data[$result['code']] = $method; } } else { $method_data[$result['code']] = $method; } } } } return $method_data; } protected function getPaymentMethodByCode($code, $total) { $method_data = array(); $payment_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('payment'); $recurring = $this->cart->hasRecurringProducts(); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('payment/' . $code); $method = $this->{'model_payment_' . $code}->getMethod($payment_address, $total); if ($method) { if ($recurring) { if (method_exists($this->{'model_payment_' . $code}, 'recurringPayments') && $this->{'model_payment_' . $code}->recurringPayments()) { $method_data[$code] = $method; } } else { $method_data[$code] = $method; } } // } } return $method_data; } protected function getShippingMethods() { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); $results = $this->model_extension_extension->getExtensions('shipping'); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('shipping/' . $result['code']); $quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address); if ($quote) { $method_data[$result['code']] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } } return $method_data; } protected function getShippingMethodByCode($code) { // Shipping Methods $method_data = array(); $shipping_address = array( "country" => "Ukraine", "country_id" => 220, "zone_id" => 0 ); $this->load->model('extension/extension'); // $results = $this->model_extension_extension->getExtensions('shipping'); // foreach ($results as $result) { if ($this->config->get($code . '_status')) { $this->load->model('shipping/' . $code); $quote = $this->{'model_shipping_' . $code}->getQuote($shipping_address); if ($quote) { $method_data[$code] = array( 'title' => $quote['title'], 'quote' => $quote['quote'], 'sort_order' => $quote['sort_order'], 'error' => $quote['error'] ); } } // } return $method_data; } //remove /*public $dev = true; public $pro = false;*/ /*protected function sendMail($products, $name, $phone, $email, $total, $count, $comment) { // Load language $this->load->language('module/kttsoftcart'); // Language data $data['text_kttsoftcart_mail_subject'] = $this->language->get('text_mail_subject'); $data['text_kttsoftcart_mail_msg_data'] = $this->language->get('text_mail_msg_data'); $data['text_kttsoftcart_name'] = $this->language->get('text_firstname'); $data['text_kttsoftcart_phone'] = $this->language->get('text_phone'); $data['text_kttsoftcart_mail'] = $this->language->get('text_email'); $data['text_kttsoftcart_comment'] = $this->language->get('text_comment'); $data['text_kttsoftcart_mail_msg_order'] = $this->language->get('text_mail_msg_order'); $data['text_kttsoftcart_mail_msg_price'] = $this->language->get('text_mail_msg_price'); $data['text_kttsoftcart_mail_msg_count'] = $this->language->get('text_mail_msg_count'); $data['text_kttsoftcart_mail_msg_total'] = $this->language->get('text_mail_msg_total'); // Get the currency symbol $data['symbolLeft'] = $this->currency->getSymbolLeft($this->session->data['currency']) ? $this->currency->getSymbolLeft($this->session->data['currency']) : ''; $data['symbolRight'] = $this->currency->getSymbolRight($this->session->data['currency']); $json = array(); //$json['comment'] = 5; // Need to test new features if ($this->dev) { require_once 'developer_test_file.php'; } if ($this->pro) { $url = 'http://tauweb.ru/fastorder_pro.php'; $params = array( // 'cms' => '', // 'cms_ver' => VERSION, 'host' => $_SERVER['SERVER_NAME'], "key" => '744febb6b4788596b757892de3f3210c', 'extension_name' => 'kttsoftcart.ocmod', 'extension_ver' => '1.3.1' ); $result = file_get_contents($url, false, stream_context_create( array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); eval($result); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); return true; } // Mail subject $subject = $data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'; // $products = $json['product_name']; // Data to mail template $mail_tmpl_data = array ( // 'product_link' => $this->request->post['product_link'], 'subject' => $subject, 'text_kttsoftcart_name' => $data['text_kttsoftcart_name'], 'text_kttsoftcart_mail_msg_data' => $data['text_kttsoftcart_mail_msg_data'], 'name' => $name, 'text_kttsoftcart_phone' => $data['text_kttsoftcart_phone'], 'phone' => $phone, 'text_kttsoftcart_mail' => $data['text_kttsoftcart_mail'], 'mail' => $email, 'text_kttsoftcart_comment' => $data['text_kttsoftcart_comment'], 'comment' => $comment, 'text_kttsoftcart_mail_msg_order' => $data['text_kttsoftcart_mail_msg_order'], 'text_kttsoftcart_mail_msg_price' => $data['text_kttsoftcart_mail_msg_price'], // 'price' => $price, 'count' => $count, 'text_kttsoftcart_mail_msg_count' => $data['text_kttsoftcart_mail_msg_count'], 'total' => $total, 'text_kttsoftcart_mail_msg_total' => $data['text_kttsoftcart_mail_msg_total'], 'config_name' => $this->config->get('config_name'), 'config_telephone' => $this->config->get('config_telephone'), 'config_email' => $this->config->get('config_email'), 'products' => $products, 'symbolLeft' => $data['symbolLeft'], 'symbolRight' => $data['symbolRight'] ); // Get the main message template if (VERSION >= '2.2.0.0') { $mail_message = $this->load->view('mail/kttsoftcart_mail_msg', $mail_tmpl_data); }else{ $mail_message = $this->load->view($this->config->get('config_template') . '/template/mail/kttsoftcart_mail_msg.tpl', $mail_tmpl_data); } // Debugging if($this->dev){ // Write mail messege to the file. file_put_contents('./mail_message.html', $mail_message); } $email_to = $this->config->get('config_email'); // Create OpenCart mail object $mail = new Mail(); // Гребанные мудаки, разработчики Opencart, никак не могут определиться с названием параметров конфига. Ебланы хуевы, как можно быть такими... ну блин... это же будут читать тысячи пользователей... Я адски зол, где стандарты, мать его.... // Потребуется доработка под разные версии. // Последнее изменение с версии 1.2.1 // // Set the mail parameters $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); if ($this->config->get('config_mail_smtp_hostname')) { $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); } else { $mail->hostname = $this->config->get('config_smtp_host'); } if ($this->config->get('config_mail_smtp_username')) { $mail->smtp_username = $this->config->get('config_mail_smtp_username'); } else { $mail->username = $this->config->get('config_smtp_username'); } if ($this->config->get('config_mail_smtp_password')) { $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); } else { $mail->password = $this->config->get('config_smtp_password'); } if ($this->config->get('config_mail_smtp_port')) { $mail->smtp_port = $this->config->get('config_mail_smtp_port'); } else { $mail->port = $this->config->get('config_smtp_port'); } if ($this->config->get('config_mail_smtp_timeout')) { $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); } else { $mail->timeout = $this->config->get('config_smtp_timeout'); } $mail->setTo($email_to); $mail->setFrom(explode(',', $this->config->get('config_email'))[0]); $mail->setSender($this->config->get('config_name')); $mail->setSubject(html_entity_decode($data['text_kttsoftcart_mail_subject'] .' ('.$_SERVER['HTTP_HOST'] . ')'), ENT_QUOTES, 'UTF-8'); $mail->setHtml($mail_message); $mail->setReplyTo(explode(',', $this->config->get('config_email'))[0]); // Send mail to the shop owner $mail->send(); }*/ } Цитата catalog\view\theme\default\template\module.kttsoftcart.tpl - я так понимаю - это как раз отображение? <div id="ocmod-popup-okno"> <div id="ocmod-popup-okno-inner"> <?php if ($products) { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title; ?></div> <div class="ocmod-popup-center"> <?php if ($attention) { ?> <div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $attention; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <?php if ($success) { ?> <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } else { ?> <div id="success-message"></div> <?php } ?> <?php if ($error_warning) { ?> <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?> <button type="button" class="close" data-dismiss="alert">×</button> </div> <?php } ?> <section class="s-content"> <div class="custom-form col-sm-6"> <form method="post" id="custom-form" role="form"> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>" style="display: none"> <input type="hidden" name="customer_group_id" value="<?php echo $customer_group_id ?>" style="display: none"> <div class="form-group input-group-sm"> <select class="form-control" name="payment_method" id="c_payment_method" required autofocus> <option value="" disabled selected><?php echo $text_payment_methods ?></option> <?php foreach($payment_methods as $key => $payment_method) : ?> <option value="<?php echo $key ?>"><?php echo $payment_method['title'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_firstname">Имя</label>--> <input type="text" class="form-control" id="firstname" name="firstname" placeholder="<?php echo $text_firstname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_lastname">Фамилия</label>--> <input type="text" class="form-control" id="lastname" name="lastname" placeholder="<?php echo $text_lastname;?>" required value="<?php echo (isset($firstname) ? $firstname : '') ?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_phone">Телефон</label>--> <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo $text_phone;?>" required value="<?php if(isset($telephone)){echo $telephone;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_mail">Email</label>--> <input type="email" class="form-control" id="mail" name="mail" placeholder="<?php echo $text_email;?>" required value="<?php if(isset($email)){echo $email;}?>"> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_shipping_methods"><?php echo $text_shipping_methods;?></label>--> <select class="form-control" name="shipping_method" id="c_shipping_method" required> <option value="" disabled selected><?php echo $text_shipping_methods ?></option> <?php foreach ($shipping_methods as $key => $shipping_method) { ?> <?php foreach ($shipping_method as $method) { ?> <option value="<?php echo $key; ?>"><?php echo $method['title']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_city">Город</label>--> <select class="form-control" name="payment_city" id="c_payment_cities" required> <option value="" disabled selected><?php echo $text_city ?></option> <?php foreach($cities as $city): ?> <option value="<?php echo $city['city_ref'] ?>"><?php echo $city['city_name'] ?></option> <?php endforeach; ?> </select> </div> <div class="form-group input-group-sm"> <!-- <label for="txt_payment_warehouse">Отделение</label>--> <select class="form-control" name="payment_warehouse" id="c_payment_warehouses" required> <option value="" selected><?php echo $text_warehouse ?></option> </select> </div> <div style="display: none;" id="if-address-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-6"> <!-- <label for="txt_shipping_methods">Введите улицу</label>--> <input type="text" class="form-control" name="shipping_street" id="shipping_street" placeholder="<?php echo $text_street;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Дом</label>--> <input type="text" class="form-control" name="shipping_house" id="shipping_house" placeholder="<?php echo $text_house;?>"> </div> <div class="form-group input-group-sm col-sm-3"> <!-- <label for="txt_shipping_methods">Кв.</label>--> <input type="text" class="form-control" name="shipping_flat" id="shipping_flat" placeholder="<?php echo $text_flat;?>"> </div> </div> </div> <button id="show-comment-block" class="thin-text"><?php echo $text_comment ?></button> <div style="display: none;" id="if-comment-isset"> <div class="row"> <div class="form-group input-group-sm col-sm-12"> <textarea class="comment-textarea" id="comment-textarea" name="comment" placeholder="<?php echo $text_comment_placeholder ?>" maxlength="1000"></textarea> </div> </div> </div> <div class="form-group"> <input type="submit" name="send-to-checkout" id="send-to-checkout" value="<?php echo $button_checkout; ?>"> </div> </form> <button id="continue-btn" class="thin-text" onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <div class="custom-form-prod col-sm-6"> <div class="display-products-cart"> <?php foreach ($products as $product) { ?> <div class="row"> <div class="image col-sm-4"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="col-sm-6" style="padding: 0;"> <div class="name "> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt" ><label style="font-size: 14px;margin: 10px 0 0;"><?php echo $text_number; ?></label></div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> </div> <div class="totals" ><?php echo $product['total']; ?></div> </div> <div class="remove col-sm-2"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o" style="font-size: 30px;"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </div> </div> <hr> <?php } ?> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div></div> <div class="mobile-products-cart"> <?php foreach ($products as $product) { ?> <div> <div class="image"> <?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a> <?php } ?> </div> <div class="name"> <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <?php if (!$product['stock']) { ?> <span class="text-danger">***</span> <?php } ?> <?php if ($product['option']) { ?> <?php foreach ($product['option'] as $option) { ?> <br /> <?php echo $option['name']; ?>: <?php echo $option['value']; ?> <?php } ?> <?php } ?> <?php if ($product['reward']) { ?> <br /> <?php echo $product['reward']; ?> <?php } ?> </div> <div class="qt"> <div class="number"> <input name="product_id" value="<?php echo $product['key']; ?>" style="display: none;" type="hidden" /> <div class="frame-change-count"> <div class="btn-plus"> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()+<?php echo $product['minimum'] ?>); update( this, 'update' );"> + </button> </div> <div class="btn-minus"> <?php if ($product['quantity'] > $product['minimum']): ?> <button type="button" onclick="$(this).parent().parent().next().val(~~$(this).parent().parent().next().val()-<?php echo $product['minimum']; ?>); update( this, 'update' );"> - </button> <?php else: ?> <button type="button" disabled>-</button> <?php endif; ?> </div> </div> <input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" class="plus-minus" disabled /> </div> <span class="remove"> <button type="button" onclick="update( this, 'remove' );"><i class="fa fa-trash-o"></i></button> <input name="product_key" value="<?php echo $product['key']; ?>" style="display: none;" hidden /> </span> </div> <div class="totals"> <?php echo $product['total']; ?> </div> <hr> <div class=" info"> <span><i class="fa fa-truck" aria-hidden="true"></i><?php echo $text_shipping_question; ?></span> </div> <div class=" info span_block"> <span><i class="fa fa-phone" aria-hidden="true"></i><?php echo $store_telephone; ?></span> <span><i class="fa fa-envelope" aria-hidden="true"></i><?php echo $store_email; ?></span> </div> </div> <?php } ?> </div> <div class="all-total"> <?php foreach ($totals as $total) { ?> <div class="clear-total"> <div class="totals-right"><?php echo $total['text']; ?></div> <div class="totals-left"><?php echo $total['title']; ?>:</div> </div> <?php } ?> </div> </div> <div class="ocmod-popup-footer"> <!-- <a href="#<?php //echo $checkout_link; ?>" id="send-to-checkout"><?php echo $button_checkout; ?></a> --> </div> </section> <?php } else { ?> <div class="ocmod-popup-heading"><?php echo $heading_cartpopup_title_empty; ?></div> <div class="ocmod-popup-center empty-cart"><?php echo $text_cartpopup_empty; ?></div> <div class="ocmod-popup-footer"> <button onclick="$.magnificPopup.close();"><?php echo $button_shopping; ?></button> </div> <?php } ?> </div> <script type="text/javascript"><!-- $('#c_payment_cities').chosen({no_results_text: "Не найдено"}); $('#c_payment_warehouses').chosen({no_results_text: "Не найдено"}); $('#show-comment-block').on('click', function (e) { e.preventDefault(); $('#if-comment-isset').slideToggle(); }); function getWarehouse(data, orderData) { $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); if (warehouse.warehouse_ref == orderData.payment_warehouse) { select.val(warehouse.warehouse_ref); } }); } }); } $('#c_shipping_method').on('change', function() { var orderData = JSON.parse(localStorage.getItem('order-data')); var $this = $(this), shipping_street = $('#shipping_street'), shipping_house = $('#shipping_house'), shipping_flat = $('#shipping_flat'), payment_warehouses = $('#c_payment_warehouses'), addressDiv = $('#if-address-isset'); if ($this.val() == 'novaposhta_branch') { addressDiv.fadeOut(); payment_warehouses.parent().fadeIn(); shipping_street.removeAttr('required'); shipping_house.removeAttr('required'); shipping_flat.removeAttr('required'); var data = { 'payment_city': $('#c_payment_cities').val() }; getWarehouse(data, orderData); } else if ($this.val() == 'novaposhta_curier') { addressDiv.fadeIn(); payment_warehouses.parent().fadeOut(); shipping_street.attr('required', true); shipping_house.attr('required', true); shipping_flat.attr('required', true); } }); // get order data from localstorage and put in form function pushOrderData() { if (!localStorage.getItem('order-data')) { return false; } var orderData = JSON.parse(localStorage.getItem('order-data')); // put data to form if (orderData.payment_method) $('#c_payment_method').val(orderData.payment_method); if (orderData.firstname) $('#firstname').val(orderData.firstname); if (orderData.lastname) $('#lastname').val(orderData.lastname); if (orderData.mail) $('#mail').val(orderData.mail); if (orderData.phone) $('#phone').val(orderData.phone); if (orderData.shipping_method) $('#c_shipping_method').val(orderData.shipping_method); if (orderData.payment_city) $('#c_payment_cities').val(orderData.payment_city).trigger('chosen:updated'); if (orderData.shipping_street) $('#shipping_street').val(orderData.shipping_street).trigger('chosen:updated'); if (orderData.shipping_house) $('#shipping_house').val(orderData.shipping_house); if (orderData.shipping_flat) $('#shipping_flat').val(orderData.shipping_flat); if (orderData.comment) { $('#if-comment-isset').fadeIn(); $('#comment-textarea').val(orderData.comment); } if (orderData.shipping_method == 'novaposhta_curier') { $('#if-address-isset').fadeIn(); $('#c_payment_warehouses').parent().fadeOut(); $('#shipping_street').attr('required', true); $('#shipping_house').attr('required', true); $('#shipping_flat').attr('required', true); return false; } var data = { 'payment_city': orderData.payment_city } getWarehouse(data, orderData); } if ($('#ocmod-popup-okno').length) pushOrderData(); $('#custom-form').on('submit', function(e) { var form = $(this); var data = form.serialize(); $.ajax({ url: '<?php echo $checkout_link ?>', type: 'post', data: data + '&total=<?php echo $total['text'] ?>', dataType: 'json', beforeSend: function () { save_order_data_to_localstorage(); masked('#ocmod-popup-okno-inner', true); }, success: function( data ) { masked('#ocmod-popup-okno-inner', false); // replace window var popup = $('#ocmod-popup-okno-inner'); popup.empty(); popup.append('<div class="ocmod-popup-heading">Заказ обробатывается. С вами свяжутся!</div>') .append('<div class="ocmod-popup-center">спсибо</div>'); }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } alert(msg); } }); return false; }); $('#c_payment_cities').on('change', function (e) { e.preventDefault(); var $this = $(this); var data = $this.serialize(); $.ajax({ url: 'index.php?route=module/kttsoftcart/getWarehouses', type: 'post', data: data, dataType: 'json', success: function( data ) { var select = $('#c_payment_warehouses'); select.find('option').remove(); //if empty if ($.isEmptyObject(data.warehouses)) { select.append($('<option>', { value: '<?php echo $text_warehouse ?>', text : '<?php echo $text_warehouse ?>' })); } else { $.each(data.warehouses, function (i, warehouse) { select.append($('<option>', { value: warehouse.warehouse_ref, text : warehouse.warehouse_name })).trigger('chosen:updated'); }); } } }); }); function masked(element, status) { if (status == true) { $('<div/>') .attr({ 'class':'masked' }) .prependTo(element); $('<div class="masked_loading" />').insertAfter($('.masked')); } else { $('.masked').remove(); $('.masked_loading').remove(); } } function validate( input ) { input.value = input.value.replace( /[^\d,]/g, '' ); } function update( target, status ) { masked('#ocmod-popup-okno-inner', true); var input_val = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val(), quantity = parseInt( input_val ), product_id = $( target ).parent().parent().parent().children( 'input[name=product_id]' ).val(), product_key = $( target ).next().val(), urls = null; if ( quantity <= 0 ) { masked('#ocmod-popup-okno-inner', false); quantity = $( target ).parent().parent().parent().children( 'input[name=quantity]' ).val( 1 ); return; } if ( status == 'update' ) { urls = 'index.php?route=module/kttsoftcart&update=' + product_id + '&quantity=' + quantity; } else if ( status == 'add' ) { urls = 'index.php?route=module/kttsoftcart&add=' + target + '&quantity=1'; } else { urls = 'index.php?route=module/kttsoftcart&remove=' + product_key; } $.ajax({ url: urls, type: 'get', dataType: 'html', beforeSend: function() { save_order_data_to_localstorage(); }, success: function( data ) { $.ajax({ url: 'index.php?route=module/kttsoftcart/status_cart', type: 'get', dataType: 'json', success: function( json ) { masked('#ocmod-popup-okno-inner', false); if (json['total']) { $('#cart-total' ).html(json['total']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } $('#ocmod-popup-okno-inner').empty(); var content = $( data ).find( '#ocmod-popup-okno-inner'); var script = $(data).find('script'); $('#ocmod-popup-okno-inner').append(content); $('#ocmod-popup-okno-inner').after(script); pushOrderData(); } }); } }); } //--></script> </div> Надіслати Поділитися на інших сайтах More sharing options...
Shrumi Опубліковано: 24 лютого 2020 Share Опубліковано: 24 лютого 2020 3 часа назад, Shrumi сказал: ? Надіслати Поділитися на інших сайтах More sharing options...
Recommended Posts