-
Публікації
28 -
З нами
-
Відвідування
Тип публікації
Профілі
Форум
Маркетплейс
Статті
FAQ
Наші новини
Магазин
Блоги
module__dplus_manager
Усі публікації користувача Motchanyy
-
Доброго дня. Підкажіть такий момент. Як зробити щоб не видавало 404 якщо переходимо на https://site.com/ru/. На https://site.com/ru все нормально працює. Але треба в кінці додати / Дякую.
- 1 839 відповідей
-
- мультиязык
- пагинация
- (і ще %d)
-
Я разные модули перебирал. Так своего кода с 0 нет. https://github.com/search?l=PHP&q=opencart+2.3+addOrder&type=Code По примерах у других модулях смотрел. Так и не понял как сделать. Это набросок кода который по идее должен просто отправить email если есть заказ новый на сайте. <?php /** * Webkul Software. * * @category Webkul * @package Opencart Module Tutorial * @author Webkul * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https://webkul.com) * @license https://store.webkul.com/license.html */ /** * The controller class must extend the parent class i.e. Controller * The controller name must be like Controller + directory path (with first character of each folder in capital) + file name (with first character in capital) * For version 2.3.0.0 and upper, the name of the controller must be ControllerExtensionModuleFirstModule */ class ControllerModuleASD extends Controller { /** * property named $error is defined to put errors * @var array */ private $error = array(); public function install() { // подключаем модель checkout/order $this->load->model('checkout/order'); // меняем статус заказа на Processing (т.е. статус с ID == 2) $this->model_checkout_order->addOrderHistory(2, 2); } /** * Basic function of the controller. This can be called using route=module/123 */ public function index() { /** * Loads the language file. Path of the file along with file name must be given */ $this->load->language('module/123'); /** * Sets the title to the html page */ $this->document->setTitle($this->language->get('heading_title')); // Order //$this->load->model('checkout/order'); //$this->model_checkout_order->confirm($order_id, $order_status_id, $comment, $notify); # Данная функция запускается в контроллере модулей оплаты при подтверждении заказа. Вам же, достаточно добавить после функции //$this->model_checkout_order->addOrder($data); // END Order $this->load->model('setting/setting'); /** * Checks whether the request type is post. If yes, then calls the validate function. */ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { /** * The function named 'editSetting' of a model is called in this way * The first argument is the code of the module and the second argument contains all the post values * The code must be same as your file name */ $this->model_setting_setting->editSetting('123', $this->request->post); /** * The success message is kept in the session */ $this->session->data['success'] = $this->language->get('text_success'); /** * The redirection works in this way. * After insertion of data, it will redirect to extension/module file along with the token * The success message will be shown there */ $this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], true)); } /** * Putting the language into the '$data' array * This is the way how you get the language from the language file */ $data['heading_title'] = $this->language->get('heading_title'); $data['text_edit'] = $this->language->get('text_edit'); $data['text_enabled'] = $this->language->get('text_enabled'); $data['text_disabled'] = $this->language->get('text_disabled'); $data['entry_status'] = $this->language->get('entry_status'); $data['button_save'] = $this->language->get('button_save'); $data['button_cancel'] = $this->language->get('button_cancel'); /** * If there is any warning in the private property '$error', then it will be put into '$data' array */ if (isset($this->error['warning'])) { $data['error_warning'] = $this->error['warning']; } else { $data['error_warning'] = ''; } /** * Breadcrumbs are declared as array */ $data['breadcrumbs'] = array(); /** * Breadcrumbs are defined */ $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true) ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_module'), 'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], true) ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/123', 'token=' . $this->session->data['token'], true) ); /** * Form action url is created and defined to $data['action'] */ $data['action'] = $this->url->link('module/123', 'token=' . $this->session->data['token'], true); /** * Cancel/back button url which will lead you to module list */ $data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], true); /** * checks whether the value exists in the post request */ if (isset($this->request->post['asd_status'])) { $data['asd_status'] = $this->request->post['asd_status']; } else { /** * if the value do not exists in the post request then value is taken from the config i.e. setting table */ $data['asd_status'] = $this->config->get('asd_status'); } /** * Header data is loaded */ $data['header'] = $this->load->controller('common/header'); /** * Column left part is loaded */ $data['column_left'] = $this->load->controller('common/column_left'); /** * Footer data is loaded */ $data['footer'] = $this->load->controller('common/footer'); /** * Using this function tpl file is called and all the data of controller is passed through '$data' array * This is for Opencart 2.2.0.0 version. There will be minor changes as per the version. */ $this->response->setOutput($this->load->view('module/123', $data)); } public function order() { //$this->load->model('checkout/order'); $to = ""; $subject = "Заголовок письма"; $message = ' <p>Текст письма</p> </br> <b>1-ая строчка </b> </br><i>2-ая строчка </i> </br>'; $headers = "Content-type: text/html; charset=windows-1251 \r\n"; $headers .= "From: От кого письмо <[email protected]>\r\n"; $headers .= "Reply-To: [email protected]\r\n"; mail($to, $subject, $message, $headers); } protected function validate() { /** * Check whether the current user has the permissions to modify the settings of the module * The permissions are set in System->Users->User groups */ if (!$this->user->hasPermission('modify', 'module/123')) { $this->error['warning'] = $this->language->get('error_permission'); } return !$this->error; } }
-
Подскажите, кто знает. Как на php получить события, когда происходит заказ на сайте. Есть ли у кого-нибудь пример кода или ссылка на пример. Нужен простой пример, который будет срабатывать, когда покупатель будет что-то заказывать на сайте. Если можно пример под версии 2.3, 3 и 4.
-
Спасибо за ответ. Но на жаль доступы предоставить не могу. Если что могу показать демку.
- 675 відповідей
-
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
-
(і ще %d)
Теги:
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
- автозаполнение title и description
- автозаполнение мета тегов
- автоматическое заполнение мета-тегов
- seo автогенерация мета-тегов
- автогенерация seo-тегов
- автозаполнение seo
- автогенерация seo
- title
- description
- seo генератор
- seogen
- генератор
- generator
- автоматическая генерация мета-тегов
- мета-теги
- дескрипшн
- тайтл
- дескрипшин
- дескрипшен
- сео
- seo
-
Подскажите кто знает. Почему при установке модуля в разделе "Производители" в низу форма скрывается. Как видно по html там одинаковые id="language" в tabs.
- 675 відповідей
-
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
-
(і ще %d)
Теги:
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
- автозаполнение title и description
- автозаполнение мета тегов
- автоматическое заполнение мета-тегов
- seo автогенерация мета-тегов
- автогенерация seo-тегов
- автозаполнение seo
- автогенерация seo
- title
- description
- seo генератор
- seogen
- генератор
- generator
- автоматическая генерация мета-тегов
- мета-теги
- дескрипшн
- тайтл
- дескрипшин
- дескрипшен
- сео
- seo
-
Выводится несуществующий товар без фото и ID. В каталоге данного товара нет. И найти невозможно так как ID просто нет. При наведении на товар вот такая ссылка: /index.php?route=product/product&product_id= Подскажите, кто сталкивался, как это пофиксить.
-
Привет всем. Кто знает как выправить вот такую ошибку Эта ошибка появляется когда я на вкладке "Настройки парсинга" пробую загрузить страницу для просмотра. https://i2.paste.pics/383c43ca1a7276954a7e534be0008c27.png
-
Ну что непонятно в моем вопросе? В админке есть описание. Но почему то в header выводится только стандартное описание, а не модуля которое сгенерировано.
- 675 відповідей
-
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
-
(і ще %d)
Теги:
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
- автозаполнение title и description
- автозаполнение мета тегов
- автоматическое заполнение мета-тегов
- seo автогенерация мета-тегов
- автогенерация seo-тегов
- автозаполнение seo
- автогенерация seo
- title
- description
- seo генератор
- seogen
- генератор
- generator
- автоматическая генерация мета-тегов
- мета-теги
- дескрипшн
- тайтл
- дескрипшин
- дескрипшен
- сео
- seo
-
Как вывести SEO Tags Generator description в header.tpl?
- 675 відповідей
-
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
-
(і ще %d)
Теги:
- автоматическая генерация title и description автоматическая генерация мета-тегов title и description
- авто заполнение title и description
- автозаполнение title и description
- автозаполнение мета тегов
- автоматическое заполнение мета-тегов
- seo автогенерация мета-тегов
- автогенерация seo-тегов
- автозаполнение seo
- автогенерация seo
- title
- description
- seo генератор
- seogen
- генератор
- generator
- автоматическая генерация мета-тегов
- мета-теги
- дескрипшн
- тайтл
- дескрипшин
- дескрипшен
- сео
- seo
-
Чтобы при выгрузке можно было внести допустим объем.