Jump to content

lmarcelocc

Members
  • Posts

    87
  • Joined

  • Last visited

Profile Information

  • Activity
    Agency

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

lmarcelocc's Achievements

Newbie

Newbie (1/14)

10

Reputation

  1. 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
  2. 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
  3. Viva, tanto quanto sei os CTT não fornecem qualquer tipo de API. Cumps
  4. 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
  5. Olá Saissu, desculpa a demora, respondi-te à tua mensagem privada. Abraço
  6. Olá, o módulo apenas permite rastrear encomendas enviadas através dos correios do Brasil. Cumprimentos, Marcelo
  7. 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
  8. 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
  9. Olá, mais uma ajuda https://www.youtube.com/watch?v=CslAqRRutMg
  10. 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
  11. 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
  12. 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
  13. 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
×
×
  • Create New...