Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. @spridjazzsax здравствуйте. Все цветовые настройки можно изменить в панели управления шаблоном
  3. Спасибо за отклик. Это так действительно, мне на другом форуме (опенкарт-раша) по опенкарт подсказали.
  4. Подскажите, пожалуйста, как в «Настройка всплывающего блока при нажатии на телефон» во вкладках «- skype, viber...» добавить иконку вайбера?
  5. Кэш модификаций, конечно же, чистил. Вопрос в другом, как в файле /catalog/model/checkout/order.php оставить уведомление только для администратора.
  6. Добрый день. напишите мне в лс где и как вы покупали шаблон. Не вижу вас в списке покупателей
  7. Добрый день. Спасибо, в обновлении придумаю что нибудь, что бы избежать этого какой footer куда загружался? Вообще по персональным вопросам пишите в лс, что бы не захламлять тему поддержки. Тут мы решаем вопросы общего характера Ответ https://opencartforum.com/topic/109868-podderzhka-frame-theme-bystryy-adaptivnyy-shablon-dlya-opencart-3/?do=findComment&comment=1357306
  8. Будет получаться многовато архивного товара в одной категории. Допустим сейчас, только в одной категории нужно будет убрать товаров 10-15 и так примерно раз в пол года. Вот и не знаю, как сделать, чтобы не навредить сайту
  9. Я дал ответ выше по логике этой опций, кроме этих 5-ти вариантов других решений не предусмотрено: Зафиксировать высоту в 2 строки можно (хотя и не следует, т.к. вы не знаете размеров экрана устройства вашего посетителя), добавив в польз. стили код: #content .product-grid .product-thumb .caption { height: 44px !important; min-height: auto; overflow: hidden !important; } но готового решения с поддержкой градиента у меня нет
  10. Вот я и решил спросить совета у людей, которые знают правильное решение
  11. Добрый день! Пожалуйста, подскажите, как с помощью модуля загружать остатки по опциям? Правильно ли понимаю, что опциям нужно присвоить артикул (как это сделать?) и задать настройки в модуле? Прайс такого плана:
  12. Today
  13. Здравствуйте ! Можно заменить цвет "f6846a" на свой ? И как быстро это можно сделать ?
  14. все доступы в описании и актуальны
  15. Не справитесь - обращайтесь. Очистка с гарантией на 1 год.
  16. Обновление 2.3-6_Beta-2 Данное обновление не критично, я немного прокачал поиск замену. Теперь можно использовать в левой стороне правила {skip} и {br} одновременно. Так же теперь можно использовать {br} в правой стороне правила. Что меняем|на что меняем Где это может пригодится. 1. Есть доноры где описание товара начинается с Подробнее про (имя товар) Допусти вы не хотите видит у себя в магазине строку Описание: LED HB4-HB3 (9006 - 9005) Type 15 CSP C-N_30W, 4000Lm_5700K (комплект) До этого обновления написать правило которое позволяет вырезать первую строку было невозможно. Теперь возможно. Правило будет выглядеть так Описание:{skip}{br}| Результат. На наш человеческий это звучит как. Найди слово Описание: и начни выделять пока пока не встретишь перенос строки. Как найдешь перенос строки выдели его и удали все что выделено. ну и многое другое что вашей фантазии будет угодно. 2. {br} в правой стороне правила. Замена html тега <br> на перенос строки. Ну или любого другого кода. Есть такие сайты которые экономят трафик за счет вырезания всех переносов строки и лишних пробелов. И это имеет смысл если у вас в html переносы строки указаны явно тегом <br> Но при парсинге если вы хотите удалить все теги html из описания вы ломает полностью форматирования данных Пример. Но теперь если вы добавите правила <br>|{br} - Заменит все <br> на перенос стороки <{skip}>| - Удалит весь Html код Результат А теперь поговорим о плохом. У меня не получается научить пред просмотр парсинга в csv выводить эти переносы строки. Вопрос с тем что браузер не может выводить спец символы, актуален. Браузер пытается обработать их и мне нужно преобразовывать все сущности. В итоге перенос строки тоже преобразуется и вы не сможете в пред просмотре парсинга csv увидеть этот результат. но в сам прайс лист все парсится с переносом как нужно. Спасибо говорю себе @Rassol2 потому что делая заказ столкнулся в очередной раз с этой проблемой и решил забить гвоздь.
  17. В настройках шаблона во вкладке "Пользовательские CSS" прописывание что то типа: @media (max-width: 990px) {.row.custom-blocks {display:none}} Размер экрана выбираете сами, то есть вместо 990px пишете свое значение
  18. Yesterday
  19. Аналогичный вопрос, если одну строку скрыть можно, то почему не замылиться на 2 строки , при выборе 2х выпадает 3 и более , что портит весь вид, как раз таки одной строки не хватает для полного отображения, а вот третья строка не уперлась, есть решение по этому вопросу?
  20. Это не оксторе - это admin/admin либо дырявые модули шаблоны. Смотрите еще в модификаторы модификатор ocstore в списке. А так же /admin/controller/design/image.php и /catalog/controller/affiliate/image.php. Также запустите айболит. Также там могут валяться файлы вида seo.php. Также может лежать в папке tool/Image imgwm.php.
  21. вам намекнули, вроде как )) если не понятно, то не ссорьтесь, а скажите, что: "намек не понял" ))
  22. ничего, что в Украине, яндекс заблокирован? )))
  23. мда, спойлером пользоваться, не вариант...
  24. Для сбербанка есть разработка от самого Сбербанка. Точнее, от их партнера. Правда, в открытом доступе вы не найдете ее на сайте сбербанка. Уж, не знаю почему, у них так это сделано неудобно, но качать можно по запросу в поддержку. И, да, у них софт бесплатный. не идеальный местами сильно, но бесплатный. Говорю как пользователь интернет-эквайринга от Сбербанка.
  25. Вы не внимательно ознакомились с проблемой! Выше все описано, спасибо за ссылку!
  26. Помогите пожалуйста в этот код <?php class ControllerApiOrder extends Controller { public function add() { $this->load->language('api/order'); $json = array(); if (!isset($this->session->data['api_id'])) { $json['error'] = $this->language->get('error_permission'); } else { // Customer if (!isset($this->session->data['customer'])) { $json['error'] = $this->language->get('error_customer'); } // Payment Address if (!isset($this->session->data['payment_address'])) { $json['error'] = $this->language->get('error_payment_address'); } // Payment Method if (!$json && !empty($this->request->post['payment_method'])) { if (empty($this->session->data['payment_methods'])) { $json['error'] = $this->language->get('error_no_payment'); } elseif (!isset($this->session->data['payment_methods'][$this->request->post['payment_method']])) { $json['error'] = $this->language->get('error_payment_method'); } if (!$json) { $this->session->data['payment_method'] = $this->session->data['payment_methods'][$this->request->post['payment_method']]; } } if (!isset($this->session->data['payment_method'])) { $json['error'] = $this->language->get('error_payment_method'); } // Shipping if ($this->cart->hasShipping()) { // Shipping Address if (!isset($this->session->data['shipping_address'])) { $json['error'] = $this->language->get('error_shipping_address'); } // Shipping Method if (!$json && !empty($this->request->post['shipping_method'])) { if (empty($this->session->data['shipping_methods'])) { $json['error'] = $this->language->get('error_no_shipping'); } else { $shipping = explode('.', $this->request->post['shipping_method']); if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) { $json['error'] = $this->language->get('error_shipping_method'); } } if (!$json) { $this->session->data['shipping_method'] = $this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]]; } } // Shipping Method if (!isset($this->session->data['shipping_method'])) { $json['error'] = $this->language->get('error_shipping_method'); } } else { unset($this->session->data['shipping_address']); unset($this->session->data['shipping_method']); unset($this->session->data['shipping_methods']); } // Cart if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { $json['error'] = $this->language->get('error_stock'); } // Validate minimum quantity requirements. $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_2) { if ($product_2['product_id'] == $product['product_id']) { $product_total += $product_2['quantity']; } } if ($product['minimum'] > $product_total) { $json['error'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); break; } } if (!$json) { $json['success'] = $this->language->get('text_success'); $order_data = array(); // Store Details $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'); $order_data['store_url'] = $this->config->get('config_url'); // Customer Details $order_data['customer_id'] = $this->session->data['customer']['customer_id']; $order_data['customer_group_id'] = $this->session->data['customer']['customer_group_id']; $order_data['firstname'] = $this->session->data['customer']['firstname']; $order_data['lastname'] = $this->session->data['customer']['lastname']; $order_data['email'] = $this->session->data['customer']['email']; $order_data['telephone'] = $this->session->data['customer']['telephone']; $order_data['fax'] = $this->session->data['customer']['fax']; $order_data['custom_field'] = $this->session->data['customer']['custom_field']; // Payment Details $order_data['payment_firstname'] = $this->session->data['payment_address']['firstname']; $order_data['payment_lastname'] = $this->session->data['payment_address']['lastname']; $order_data['payment_company'] = $this->session->data['payment_address']['company']; $order_data['payment_address_1'] = $this->session->data['payment_address']['address_1']; $order_data['payment_address_2'] = $this->session->data['payment_address']['address_2']; $order_data['payment_city'] = $this->session->data['payment_address']['city']; $order_data['payment_postcode'] = $this->session->data['payment_address']['postcode']; $order_data['payment_zone'] = $this->session->data['payment_address']['zone']; $order_data['payment_zone_id'] = $this->session->data['payment_address']['zone_id']; $order_data['payment_country'] = $this->session->data['payment_address']['country']; $order_data['payment_country_id'] = $this->session->data['payment_address']['country_id']; $order_data['payment_address_format'] = $this->session->data['payment_address']['address_format']; $order_data['payment_custom_field'] = (isset($this->session->data['payment_address']['custom_field']) ? $this->session->data['payment_address']['custom_field'] : array()); if (isset($this->session->data['payment_method']['title'])) { $order_data['payment_method'] = $this->session->data['payment_method']['title']; } else { $order_data['payment_method'] = ''; } if (isset($this->session->data['payment_method']['code'])) { $order_data['payment_code'] = $this->session->data['payment_method']['code']; } else { $order_data['payment_code'] = ''; } // Shipping Details if ($this->cart->hasShipping()) { $order_data['shipping_firstname'] = $this->session->data['shipping_address']['firstname']; $order_data['shipping_lastname'] = $this->session->data['shipping_address']['lastname']; $order_data['shipping_company'] = $this->session->data['shipping_address']['company']; $order_data['shipping_address_1'] = $this->session->data['shipping_address']['address_1']; $order_data['shipping_address_2'] = $this->session->data['shipping_address']['address_2']; $order_data['shipping_city'] = $this->session->data['shipping_address']['city']; $order_data['shipping_postcode'] = $this->session->data['shipping_address']['postcode']; $order_data['shipping_zone'] = $this->session->data['shipping_address']['zone']; $order_data['shipping_zone_id'] = $this->session->data['shipping_address']['zone_id']; $order_data['shipping_country'] = $this->session->data['shipping_address']['country']; $order_data['shipping_country_id'] = $this->session->data['shipping_address']['country_id']; $order_data['shipping_address_format'] = $this->session->data['shipping_address']['address_format']; $order_data['shipping_custom_field'] = (isset($this->session->data['shipping_address']['custom_field']) ? $this->session->data['shipping_address']['custom_field'] : array()); if (isset($this->session->data['shipping_method']['title'])) { $order_data['shipping_method'] = $this->session->data['shipping_method']['title']; } else { $order_data['shipping_method'] = ''; } if (isset($this->session->data['shipping_method']['code'])) { $order_data['shipping_code'] = $this->session->data['shipping_method']['code']; } else { $order_data['shipping_code'] = ''; } } else { $order_data['shipping_firstname'] = ''; $order_data['shipping_lastname'] = ''; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = ''; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = ''; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = ''; $order_data['shipping_country'] = ''; $order_data['shipping_country_id'] = ''; $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $order_data['shipping_method'] = ''; $order_data['shipping_code'] = ''; } // Products $order_data['products'] = array(); foreach ($this->cart->getProducts() as $product) { $option_data = array(); foreach ($product['option'] as $option) { $option_data[] = array( 'product_option_id' => $option['product_option_id'], 'product_option_value_id' => $option['product_option_value_id'], 'option_id' => $option['option_id'], 'option_value_id' => $option['option_value_id'], 'name' => $option['name'], 'value' => $option['value'], 'type' => $option['type'] ); } $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'download' => $product['download'], 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['total'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); } // Gift Voucher $order_data['vouchers'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => token(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'] ); } } // Order Totals $this->load->model('extension/extension'); $totals = array(); $taxes = $this->cart->getTaxes(); $total = 0; // Because __call can not keep var references so we put them into an array. $total_data = array( 'totals' => &$totals, 'taxes' => &$taxes, 'total' => &$total ); $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('extension/total/' . $result['code']); // We have to put the totals in an array so that they pass by reference. $this->{'model_extension_total_' . $result['code']}->getTotal($total_data); } } $sort_order = array(); foreach ($total_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data['totals']); $order_data = array_merge($order_data, $total_data); if (isset($this->request->post['comment'])) { $order_data['comment'] = $this->request->post['comment']; } else { $order_data['comment'] = ''; } if (isset($this->request->post['affiliate_id'])) { $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliate($this->request->post['affiliate_id']); 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 $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; $order_data['marketing_id'] = 0; $order_data['tracking'] = ''; } $order_data['language_id'] = $this->config->get('config_language_id'); $order_data['currency_id'] = $this->currency->getId($this->session->data['currency']); $order_data['currency_code'] = $this->session->data['currency']; $order_data['currency_value'] = $this->currency->getValue($this->session->data['currency']); $order_data['ip'] = $this->request->server['REMOTE_ADDR']; 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['order_id'] = $this->model_checkout_order->addOrder($order_data); // Set the order history if (isset($this->request->post['order_status_id'])) { $order_status_id = $this->request->post['order_status_id']; } else { $order_status_id = $this->config->get('config_order_status_id'); } $this->model_checkout_order->addOrderHistory($json['order_id'], $order_status_id); // clear cart since the order has already been successfully stored. //$this->cart->clear(); } } if (isset($this->request->server['HTTP_ORIGIN'])) { $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']); $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $this->response->addHeader('Access-Control-Max-Age: 1000'); $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function edit() { $this->load->language('api/order'); $json = array(); if (!isset($this->session->data['api_id'])) { $json['error'] = $this->language->get('error_permission'); } else { $this->load->model('checkout/order'); if (isset($this->request->get['order_id'])) { $order_id = $this->request->get['order_id']; } else { $order_id = 0; } $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) { // Customer if (!isset($this->session->data['customer'])) { $json['error'] = $this->language->get('error_customer'); } // Payment Address if (!isset($this->session->data['payment_address'])) { $json['error'] = $this->language->get('error_payment_address'); } // Payment Method if (!$json && !empty($this->request->post['payment_method'])) { if (empty($this->session->data['payment_methods'])) { $json['error'] = $this->language->get('error_no_payment'); } elseif (!isset($this->session->data['payment_methods'][$this->request->post['payment_method']])) { $json['error'] = $this->language->get('error_payment_method'); } if (!$json) { $this->session->data['payment_method'] = $this->session->data['payment_methods'][$this->request->post['payment_method']]; } } if (!isset($this->session->data['payment_method'])) { $json['error'] = $this->language->get('error_payment_method'); } // Shipping if ($this->cart->hasShipping()) { // Shipping Address if (!isset($this->session->data['shipping_address'])) { $json['error'] = $this->language->get('error_shipping_address'); } // Shipping Method if (!$json && !empty($this->request->post['shipping_method'])) { if (empty($this->session->data['shipping_methods'])) { $json['error'] = $this->language->get('error_no_shipping'); } else { $shipping = explode('.', $this->request->post['shipping_method']); if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) { $json['error'] = $this->language->get('error_shipping_method'); } } if (!$json) { $this->session->data['shipping_method'] = $this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]]; } } if (!isset($this->session->data['shipping_method'])) { $json['error'] = $this->language->get('error_shipping_method'); } } else { unset($this->session->data['shipping_address']); unset($this->session->data['shipping_method']); unset($this->session->data['shipping_methods']); } // Cart if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { $json['error'] = $this->language->get('error_stock'); } // Validate minimum quantity requirements. $products = $this->cart->getProducts(); foreach ($products as $product) { $product_total = 0; foreach ($products as $product_2) { if ($product_2['product_id'] == $product['product_id']) { $product_total += $product_2['quantity']; } } if ($product['minimum'] > $product_total) { $json['error'] = sprintf($this->language->get('error_minimum'), $product['name'], $product['minimum']); break; } } if (!$json) { $json['success'] = $this->language->get('text_success'); $order_data = array(); // Store Details $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'); $order_data['store_url'] = $this->config->get('config_url'); // Customer Details $order_data['customer_id'] = $this->session->data['customer']['customer_id']; $order_data['customer_group_id'] = $this->session->data['customer']['customer_group_id']; $order_data['firstname'] = $this->session->data['customer']['firstname']; $order_data['lastname'] = $this->session->data['customer']['lastname']; $order_data['email'] = $this->session->data['customer']['email']; $order_data['telephone'] = $this->session->data['customer']['telephone']; $order_data['fax'] = $this->session->data['customer']['fax']; $order_data['custom_field'] = $this->session->data['customer']['custom_field']; // Payment Details $order_data['payment_firstname'] = $this->session->data['payment_address']['firstname']; $order_data['payment_lastname'] = $this->session->data['payment_address']['lastname']; $order_data['payment_company'] = $this->session->data['payment_address']['company']; $order_data['payment_address_1'] = $this->session->data['payment_address']['address_1']; $order_data['payment_address_2'] = $this->session->data['payment_address']['address_2']; $order_data['payment_city'] = $this->session->data['payment_address']['city']; $order_data['payment_postcode'] = $this->session->data['payment_address']['postcode']; $order_data['payment_zone'] = $this->session->data['payment_address']['zone']; $order_data['payment_zone_id'] = $this->session->data['payment_address']['zone_id']; $order_data['payment_country'] = $this->session->data['payment_address']['country']; $order_data['payment_country_id'] = $this->session->data['payment_address']['country_id']; $order_data['payment_address_format'] = $this->session->data['payment_address']['address_format']; $order_data['payment_custom_field'] = $this->session->data['payment_address']['custom_field']; if (isset($this->session->data['payment_method']['title'])) { $order_data['payment_method'] = $this->session->data['payment_method']['title']; } else { $order_data['payment_method'] = ''; } if (isset($this->session->data['payment_method']['code'])) { $order_data['payment_code'] = $this->session->data['payment_method']['code']; } else { $order_data['payment_code'] = ''; } // Shipping Details if ($this->cart->hasShipping()) { $order_data['shipping_firstname'] = $this->session->data['shipping_address']['firstname']; $order_data['shipping_lastname'] = $this->session->data['shipping_address']['lastname']; $order_data['shipping_company'] = $this->session->data['shipping_address']['company']; $order_data['shipping_address_1'] = $this->session->data['shipping_address']['address_1']; $order_data['shipping_address_2'] = $this->session->data['shipping_address']['address_2']; $order_data['shipping_city'] = $this->session->data['shipping_address']['city']; $order_data['shipping_postcode'] = $this->session->data['shipping_address']['postcode']; $order_data['shipping_zone'] = $this->session->data['shipping_address']['zone']; $order_data['shipping_zone_id'] = $this->session->data['shipping_address']['zone_id']; $order_data['shipping_country'] = $this->session->data['shipping_address']['country']; $order_data['shipping_country_id'] = $this->session->data['shipping_address']['country_id']; $order_data['shipping_address_format'] = $this->session->data['shipping_address']['address_format']; $order_data['shipping_custom_field'] = $this->session->data['shipping_address']['custom_field']; if (isset($this->session->data['shipping_method']['title'])) { $order_data['shipping_method'] = $this->session->data['shipping_method']['title']; } else { $order_data['shipping_method'] = ''; } if (isset($this->session->data['shipping_method']['code'])) { $order_data['shipping_code'] = $this->session->data['shipping_method']['code']; } else { $order_data['shipping_code'] = ''; } } else { $order_data['shipping_firstname'] = ''; $order_data['shipping_lastname'] = ''; $order_data['shipping_company'] = ''; $order_data['shipping_address_1'] = ''; $order_data['shipping_address_2'] = ''; $order_data['shipping_city'] = ''; $order_data['shipping_postcode'] = ''; $order_data['shipping_zone'] = ''; $order_data['shipping_zone_id'] = ''; $order_data['shipping_country'] = ''; $order_data['shipping_country_id'] = ''; $order_data['shipping_address_format'] = ''; $order_data['shipping_custom_field'] = array(); $order_data['shipping_method'] = ''; $order_data['shipping_code'] = ''; } // Products $order_data['products'] = array(); foreach ($this->cart->getProducts() as $product) { $option_data = array(); foreach ($product['option'] as $option) { $option_data[] = array( 'product_option_id' => $option['product_option_id'], 'product_option_value_id' => $option['product_option_value_id'], 'option_id' => $option['option_id'], 'option_value_id' => $option['option_value_id'], 'name' => $option['name'], 'value' => $option['value'], 'type' => $option['type'] ); } $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'download' => $product['download'], 'quantity' => $product['quantity'], 'subtract' => $product['subtract'], 'price' => $product['price'], 'total' => $product['total'], 'tax' => $this->tax->getTax($product['price'], $product['tax_class_id']), 'reward' => $product['reward'] ); } // Gift Voucher $order_data['vouchers'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $voucher) { $order_data['vouchers'][] = array( 'description' => $voucher['description'], 'code' => token(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'] ); } } // Order Totals $this->load->model('extension/extension'); $totals = array(); $taxes = $this->cart->getTaxes(); $total = 0; // Because __call can not keep var references so we put them into an array. $total_data = array( 'totals' => &$totals, 'taxes' => &$taxes, 'total' => &$total ); $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('extension/total/' . $result['code']); // We have to put the totals in an array so that they pass by reference. $this->{'model_extension_total_' . $result['code']}->getTotal($total_data); } } $sort_order = array(); foreach ($total_data['totals'] as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data['totals']); $order_data = array_merge($order_data, $total_data); if (isset($this->request->post['comment'])) { $order_data['comment'] = $this->request->post['comment']; } else { $order_data['comment'] = ''; } if (isset($this->request->post['affiliate_id'])) { $subtotal = $this->cart->getSubTotal(); // Affiliate $this->load->model('affiliate/affiliate'); $affiliate_info = $this->model_affiliate_affiliate->getAffiliate($this->request->post['affiliate_id']); 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; } } else { $order_data['affiliate_id'] = 0; $order_data['commission'] = 0; } $this->model_checkout_order->editOrder($order_id, $order_data); // Set the order history if (isset($this->request->post['order_status_id'])) { $order_status_id = $this->request->post['order_status_id']; } else { $order_status_id = $this->config->get('config_order_status_id'); } if ($order_status_id == 14) { $order_products = array(); foreach ($order_data['products'] as $order_product) { $order_products[$order_product['model']] = $order_product['quantity']; } $cwd = getcwd(); chdir(DIR_SYSTEM.'googleapi'); require_once('sheets.php'); chdir($cwd); } $this->model_checkout_order->addOrderHistory($order_id, $order_status_id); } } else { $json['error'] = $this->language->get('error_not_found'); } } if (isset($this->request->server['HTTP_ORIGIN'])) { $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']); $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $this->response->addHeader('Access-Control-Max-Age: 1000'); $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function delete() { $this->load->language('api/order'); $json = array(); if (!isset($this->session->data['api_id'])) { $json['error'] = $this->language->get('error_permission'); } else { $this->load->model('checkout/order'); if (isset($this->request->get['order_id'])) { $order_id = $this->request->get['order_id']; } else { $order_id = 0; } $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) { $this->model_checkout_order->deleteOrder($order_id); $json['success'] = $this->language->get('text_success'); } else { $json['error'] = $this->language->get('error_not_found'); } } if (isset($this->request->server['HTTP_ORIGIN'])) { $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']); $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $this->response->addHeader('Access-Control-Max-Age: 1000'); $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function info() { $this->load->language('api/order'); $json = array(); if (!isset($this->session->data['api_id'])) { $json['error'] = $this->language->get('error_permission'); } else { $this->load->model('checkout/order'); if (isset($this->request->get['order_id'])) { $order_id = $this->request->get['order_id']; } else { $order_id = 0; } $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) { $json['order'] = $order_info; $json['success'] = $this->language->get('text_success'); } else { $json['error'] = $this->language->get('error_not_found'); } } if (isset($this->request->server['HTTP_ORIGIN'])) { $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']); $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $this->response->addHeader('Access-Control-Max-Age: 1000'); $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function history() { $this->load->language('api/order'); $json = array(); if (!isset($this->session->data['api_id'])) { $json['error'] = $this->language->get('error_permission'); } else { // Add keys for missing post vars $keys = array( 'order_status_id', 'notify', 'override', 'comment' ); foreach ($keys as $key) { if (!isset($this->request->post[$key])) { $this->request->post[$key] = ''; } } $this->load->model('checkout/order'); if (isset($this->request->get['order_id'])) { $order_id = $this->request->get['order_id']; } else { $order_id = 0; } $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) { if ($this->request->post['order_status_id'] == 14) { $order_data['order_id'] = $order_info['order_id']; $order_data['date_added'] = date('d.m.Y', strtotime($order_info['date_added'])); $order_data['firstname'] = $order_info['firstname']; $order_data['lastname'] = $order_info['lastname']; $order_data['shipping_method'] = $order_info['shipping_method']; $order_data['products'] = array(); $order_products = $this->model_checkout_order->getOrderProducts($order_id); foreach ($order_products as $product) { $option_data = array(); $order_product_options = $this->model_checkout_order->getOrderOptions($order_info['order_id'], $product['order_product_id']); foreach ($order_product_options as $option) { $option_data[] = array( 'product_option_id' => $option['product_option_id'], 'product_option_value_id' => $option['product_option_value_id'], 'name' => $option['name'], 'value' => $option['value'], 'type' => $option['type'] ); } $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'price' => $product['price'], 'total' => $product['total'], 'tax' => $product['tax'], 'reward' => $product['reward'] ); } $order_products = array(); foreach ($order_data['products'] as $order_product) { $order_products[$order_product['model']] = $order_product['quantity']; } $cwd = getcwd(); chdir(DIR_SYSTEM.'googleapi'); require_once('sheets.php'); chdir($cwd); } $this->load->language('api/order'); $this->model_checkout_order->addOrderHistory($order_id, $this->request->post['order_status_id'], $this->request->post['comment'], $this->request->post['notify'], $this->request->post['override']); $json['success'] = $this->language->get('text_success'); } else { $json['error'] = $this->language->get('error_not_found'); } } if (isset($this->request->server['HTTP_ORIGIN'])) { $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']); $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $this->response->addHeader('Access-Control-Max-Age: 1000'); $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } } Правильно вставить эту функцию, она нужна в секции if ($order_info) { , сейчас она там стоит но не работает https://gyazo.com/69566d718c0f0656fa1904ce14706497 if ($this->request->post['order_status_id'] == 14) { $order_data['order_id'] = $order_info['order_id']; $order_data['date_added'] = date('d.m.Y', strtotime($order_info['date_added'])); $order_data['firstname'] = $order_info['firstname']; $order_data['lastname'] = $order_info['lastname']; $order_data['shipping_method'] = $order_info['shipping_method']; $order_data['products'] = array(); $order_products = $this->model_checkout_order->getOrderProducts($order_id); foreach ($order_products as $product) { $option_data = array(); $order_product_options = $this->model_checkout_order->getOrderOptions($order_info['order_id'], $product['order_product_id']); foreach ($order_product_options as $option) { $option_data[] = array( 'product_option_id' => $option['product_option_id'], 'product_option_value_id' => $option['product_option_value_id'], 'name' => $option['name'], 'value' => $option['value'], 'type' => $option['type'] ); } $order_data['products'][] = array( 'product_id' => $product['product_id'], 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'price' => $product['price'], 'total' => $product['total'], 'tax' => $product['tax'], 'reward' => $product['reward'] ); } $order_products = array(); foreach ($order_data['products'] as $order_product) { $order_products[$order_product['model']] = $order_product['quantity']; } $cwd = getcwd(); chdir(DIR_SYSTEM.'googleapi'); require_once('sheets.php'); chdir($cwd); }
  1. Load more activity
×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.