Jump to content

lmarcelocc

Members
  • Posts

    87
  • Joined

  • Last visited

Everything posted by lmarcelocc

  1. Hi, thanks for your feedback. Do you have access to your error.log or maybe can you enable all options and enable debug mode to see what's the error? I only have tried on 1.6.1 and it works fine with all options selected. Regards, Marcelo
  2. Viva, claro, mas o princípio é o mesmo, o que eu faço é o parse ao site dos CTT. No teu caso tens de ter um tipo de cron que corre e vai fazer parse a um registo dos ctt e caso esteja entregue altera o estado da encomenda no prestashop e envia email ao cliente, é simples mas dá algum trabalho
  3. Claro que existe, eu fiz este módulo: http://www.prestashop.com/forums/topic/309761-m%C3%B3dulo-rastreio-encomendas-ctt-gr%C3%A1tis/ Mas nem sei se ainda funciona ou não
  4. Viva, tanto quanto sei os CTT não fornecem qualquer tipo de API. Cumps
  5. Olá, este módulo foi testado na versão 1.6.0.9 e funciona 100%. Este módulo não tem página de configuração, após instalar, o mesmo apenas deve surgir na página dos módulos. Quanto a isto: Após instalação, o mesmo é colocado em dois hooks, o header (que é para manter) e o footer, se fores a Módulos -> Posições, e pesquisares pelo nome do módulo, vais verificar que o mesmo se encontrará em pelo menos 2 hooks, sendo que: - É obrigatório estar no hook 'header' - E deve estar apenas em um destes hooks: 'displayLeftColumn', 'displayRightColumn' ou 'footer', consoante queiras que ele surja na coluna da esquerda, na coluna da direita ou no footer (defeito). Cumprimentos, Marcelo
  6. Hi lateral, it depends on your language, but if you choose english, modules names will be statslive and statsvisits and they can be found under modules tab, like all the others one. Be sure you dont have filters when surging for them. Regards, Marcelo
  7. Olá Saissu, desculpa a demora, respondi-te à tua mensagem privada. Abraço
  8. Olá, o módulo apenas permite rastrear encomendas enviadas através dos correios do Brasil. Cumprimentos, Marcelo
  9. Viva, estou a desenvolver um módulo que numa fase inicial permitirá efetuar alterações ao estado da reparação/trabalho e terá opção de enviar ou não email ao cliente. Cumprimentos, Marcelo
  10. Hello, i'm getting there, is now working as expected, thanks gonebdg. Now i'm trying to do another thing and I have looked to helperList and can't find it, in my: $fields_list = array( 'id_jobStatus' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs' ), 'orderId' => array( 'title' => $this->l('Order'), 'width' => 140, 'type' => 'text' ), 'customerEmail' => array( 'title' => $this->l('Customer Email'), 'width' => 140, 'type' => 'text' ), 'status' => array( 'title' => $this->l('Status'), 'width' => 140, 'type' => 'int' ) ); so, status fields is an int, i'm getting it from OrderState::getOrderStates and saving it in my custom table, I want to show it by status name instead of id. How can I achieve this? Hope someone can help me. Thanks in advance. Best regards, Marcelo
  11. Olá, mais uma ajuda https://www.youtube.com/watch?v=CslAqRRutMg
  12. Olá SAISSU, o módulo é instalado à semelhança dos restantes. Faz o download do ficheiro no primeiro post, vais ao Backoffice da loja, em Módulos tens uma opção para adcionar módulos, adiciona-lo por aí, ou seja, ele faz o upload para o servidor e descompacta-o e de seguida deverás conseguir instalar o mesmo. Se não o encontrares na lista dos módulos, verifica se não tens nenhum filtro ativo nos módulos, podes ter filtros ativos por autores, frontend, etc. Outra forma de instalar é a mencionada pelo selectshop: Se não recebes qualquer mensagem de erro é porque possivelmente a causa está em algo mencionado neste post. Em último caso, se o entenderes, podes criar uma conta no backend da loja com apenas acesso aos módulos que vejo-te isso rapidamente. Cumprimentos, Marcelo
  13. Hello, forget my second question I get it, now I understand clear $definition property. So, I have to use/create some methods in my controller to get the user inputed values, validate them, and then, maybe for better structure, create some other class with my custom methods and call them to save that info in the other table? Which method should I override to threat data and then save it like mencioned above? processAdd() ? Maybe something like ? public function processAdd() { // Validate user input data $customer_email = strval(Tools::getValue('email')); /* ... */ if (Validate::isEmail($customer_email)) // All fine with all fields // Call custom class methods to save in the other table } Should be this the right method to achieve what I want? Or perhaps there's some other that will be more correct to use here? Thank you for your patience gonebdg. Best wishes, Marcelo
  14. Olá Saissu, tens a posibilidade de me criar uma conta na administração com acesso aos móduloes e enviar-me os dados por mensagem privada? Cumprimentos, Marcelo
  15. Hello gonebdg, i'm follow your advises and now i'm able to add / update my DB with an object, but now i have some doubts with whats the best way to do what i want, now I have something like in my controller: include_once dirname(__FILE__).'/../../classes/Save.php'; class AdminJobstatusController extends ModuleAdminController { public function __construct() { $this->bootstrap = true; $this->module = 'jobStatus'; // valid module name $this->table = 'jobStatus'; // DB table name where your object data stored $this->className = 'jobStatusObj'; // The class name of my object $this->lang = false; $this->explicitSelect = true; $this->allow_export = true; $this->delete = true; $this->context = Context::getContext(); $this->orderBy = 'id_jobStatus'; // DB column field which hold my object ID $this->_orderWay = 'DESC'; $this->fields_list = $this->fieldList(); $this->shopLinkType = ''; $this->shopLinkType = 'shop'; $this->actions = array('view', 'edit', 'delete'); $this->bulk_actions = array( 'delete' => array( 'text' => $this->l('Delete selected'), 'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected object?') ) ); parent::__construct(); } public function renderForm() { // form to add/edit my object are dermined here // make sure object is loaded if (!($obj = $this->loadObject(true))) return; // Get order states available on store $orderStates = OrderState::getOrderStates((int)$this->context->language->id); foreach ($orderStates as $status) $this->statuses_array[] = array('id_order_state' => $status['id_order_state'], 'status' => $status['name']); // array fields for the form, similiar with array on your renderList() // for reference, you can see the available Prestashop AdminController // e.g : ...\controllers\admin\AdminCustomersController.php $this->fields_form = array( 'legend' => array( 'title' => (Tools::getValue('id_jobStatus')) ? sprintf($this->l('Add information to job: #%s'), Interaction::getOrderIdByJobId(Tools::getValue('id_jobStatus'))) : $this->l('Add new job'), 'icon' => 'icon-angle-double-right' ), 'input' => array( array( 'type' => 'select', 'label' => $this->l('Select status'), 'name' => 'status', 'required' => true, 'options' => array( 'query' => $this->statuses_array, 'id' => 'id_order_state', 'name' => 'status' ), 'col' => '4', 'desc' => $this->l('To create new status go to Orders -> Statuses.'), 'hint' => $this->l('To create new status go to Orders -> Statuses.') ), array( 'type' => 'text', 'label' => $this->l('Message'), 'name' => 'message', 'required' => false, 'col' => '6', 'suffix' => '<i class="icon-envelope-o"></i>', 'desc' => $this->l('Message to save/send to customer.'), 'hint' => $this->l('Message to save/send to customer.') ), array( 'type' => 'text', 'validation' => 'isInt', 'label' => $this->l('Time estimated to finish the job.'), 'name' => 'estimatedTime', 'required' => false, 'col' => '1', 'suffix' => '<i class="icon-clock-o"></i>', 'desc' => $this->l('(days)'), 'hint' => $this->l('(days)') ), array( 'type' => 'datetime', 'label' => $this->l('Pickup time'), 'name' => 'pickupTime', 'required' => false, 'col' => '6', 'desc' => $this->l('When customer can pickup/receive his product.'), 'hint' => $this->l('When customer can pickup/receive his product.') ), array( 'type' => 'switch', 'label' => $this->l('Advise customer by email?'), 'name' => 'emailSent', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Yes') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('No') ) ), 'desc' => $this->l('If you would like to advise customer by email about status update.') ), ), 'submit' => array( 'title' => $this->l( 'Save' ), 'class' => 'btn btn-default pull-right', 'name' => 'saveAction', ) ); // then ... let the parent controller class handle it (update object) return parent::renderForm(); } } and my Model: class jobStatusObj extends ObjectModel { /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'jobStatus', 'primary' => 'id_jobStatus', 'fields' => array( // 'id_jobStatus' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), 'orderId' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 25, 'required' => false), 'status' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), 'estimatedTime' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => false), 'pickupTime' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), // 'idJobStatus' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), // 'emailSent' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), // 'message' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 250, 'required' => true), ), ); } My problem: I have two db tables: Table name: jobStatus Table name: jobStatusHistory Note: My form to add / edit have all the fields necessary to fill all this two tables. 1º I want to use the same object to save in both tables, how can I achieve that? Probably in my model in $definition variable. 2º For 1º goes fine I think I should make difeference in my renderForm() method, because when add new one i will need to set orderId (this is supposed to be an order Id create in BO), or should I make orderId my primary key and set it in my model? Hope you can give me another good tip or maybe someone else Best regards, Marcelo
  16. Thank you very much gonebdg Will follow your tips. Merry christmas Thanks, Marcelo
  17. Olá SAISSU, verifica se não tens nenhum filtro quando vais aos módulos, tenta colocar em todos e de seguida podes filtrar por autor 'marcelo carvalho' ou pesquisar pelo nome do módulo 'packagetracking'. Cumprimentos, Marcelo
  18. Viva, qual a versão do PS? Podes ativar o debug do PS e verificar qual a mensagem de erro? Tem acontecido que um ou outro ficheiro do módulo, em vez de ter toda a estrutura correta do código, o mesmo fica em apenas uma linha, pode ser esse o problema. Verifica se o código do ficheiro onlineStats.php está ou não todo numa só linha? Obrigado.
  19. Thank you gonebdg But, and if I want to upgrade 2 custom tables with parent controller ? And if I add new action 'Add' ho can i handle it? Sorry and thank you for your patience. Best regards and wish you a nice weekend. Marcelo
  20. Soz, I thought i found a good solution but not :S Still wait for your knowledge
  21. Hi all, i'm trying to create a prestashop module, i'm a little used to MVC but this one is getting me crazy I have this controller in my: /prestashop16/modules/myModuleName/controllers include_once dirname(__FILE__).'/../../classes/Interaction.php'; class AdminJobstatusController extends ModuleAdminController { public function __construct() { $this->bootstrap = true; $this->display = 'list'; $this->meta_title = $this->l('Job Repair Status'); parent::__construct(); if (!$this->module->active) Tools::redirectAdmin($this->context->link->getAdminLink('AdminHome')); parent::__construct(); } public function setMedia() { // Add default css parent::setMedia(); return; } public function initToolBarTitle() { $this->toolbar_title[] = $this->l('Job Repair Status'); } public function initPageHeaderToolbar() { parent::initPageHeaderToolbar(); unset($this->page_header_toolbar_btn['back']); } public function postProcess() { } public function renderList(){ $this->toolbar_title[] = $this->l('All Jobs'); $fields_list = array( 'orderId' => array( 'title' => $this->l('Order'), 'width' => 140, 'type' => 'text' ), 'status' => array( 'title' => $this->l('Status'), 'width' => 140, 'type' => 'int' ), 'estimatedTime' => array( 'title' => $this->l('Estimated Repair Time'), 'width' => 140, 'type' => 'text' ), 'pickuptime' => array( 'title' => $this->l('Pickup Datetime'), 'width' => 140, 'type' => 'text' ), 'updated' => array( 'title' => $this->l('Last update'), 'width' => 140, 'type' => 'text' ), ); $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = false; // Actions to be displayed in the "Actions" column $helper->actions = array('edit', 'delete', 'view'); $helper->identifier = 'id'; $helper->show_toolbar = true; $helper->title = $this->l('All jobs'); $helper->specificConfirmDelete = true; $helper->token = $this->context->controller->token; $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->module->name; // Call webservice $info = Interaction::getWebServiceInfo().$this->_displayInfo(); return $info.$helper->generateList(Interaction::getAllJobs(), $fields_list); } public function renderView() { $jobId = Tools::getValue('id'); if (!Validate::isInt($jobId)) $this->errors[] = Tools::displayError('Can\'t get job id!.'); if($jobId) $this->base_tpl_view = 'edit_job.tpl'; // $this->content = $this->createTemplate(dirname(__MODULE_DIR__) . '/../../views/templates/admin/edit_job.tpl')->fetch(); // $tpl = $this->context->smarty->createTemplate(dirname(__FILE__) . '/../../views/templates/admin/edit_job.tpl'); // return $tpl->fetch(); return parent::renderView(); } } This controller have this method: renderList() wich create the list with no problems with the correct actions, like mentioned in: $helper->actions = array('edit', 'delete', 'view'); Now what I want to achieve is: 1 - I know that if I click on edit will send some url params like 'id'. How can I do something with it in my controller? In cakePHP we do something like editAction(){} 2 - After do my stuff with user interaction, how can I set a template to it? With $this->base_tpl_view? I have my templates files in /prestashop16/modules/myModuleName/views/templates/admin/myModuleName/helpers/view Thanks in advance for your time. Best regards, Marcelo
  22. Hi redtango2, thanks for your reply. Can you be more specific? Regards, Marcelo
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More