Jump to content

acuarelweb

Members
  • Posts

    14
  • Joined

  • Last visited

1 Follower

Profile Information

  • Location
    Sanxenxo, Pontevedra
  • Activity
    Web development agency

Recent Profile Visitors

3,463,438 profile views

acuarelweb's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Hi. This error happened to me using escape|UTF-8 on a link url in a tpl file. {if !isset($link_page_text)}{$link_page_text='Back to list'}{/if} <a class="btn btn-default gotolist" href="{$link_page|escape:'UTF-8'}" Just removing the escape|utf-8 did the trick {if !isset($link_page_text)}{$link_page_text = 'Back to list' }{/if} <a class="btn btn-default gotolist" href="{$link_page}" Hope it helps! Daniel
  2. Ok. Now it seems to work thank you very much, mate!!
  3. Thx for the script alexdee2007, Tried it, however ¿how should i modify it to be able to override an module adminController? I want to override modules/mymodule/controllers/admin/AdminMyModuleSomeController.php Class name in this file: class AdminMyModuleSomeController.php extends ModuleAdminController {... My override file: class AdminMyModuleSomeControllerOverride extends AdminMyModuleSomeController {... Also i need to override main php file so i put the override file in /override/modules/mymodule/mymodule.php Then: - i've copied Dispatcher.php to /override/classes/ - i've copied override file to /override/modules/mymodule/controllers/admin/AdminMyModuleSomeController.php - delete class_index.php from cache ¿is that right? I'm afraid im losing something here cause it does not work Thx in advance!!
  4. Hi there Im trying to display a html page with a given order details. This should be done from the backoffice but without the menu, header, etc. : I just want to create a simple page with several variables assigned to context->smarty What is the right way to accomplish this? Thanks in advance!!
  5. Hi there. Im trying to make a custom orders list module controller, and would like to know if is possible to hide the id column while keeping the edit & view buttons (the addRowAction ones...) My helperList fields are as follows: $this->fields_list = array( 'id_order' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs', 'search' => false, 'filter_key' => 'a!id_order', // clave da consulta mysql que queremo amosar.. 'orderby' => true, // necesario para indicar que si se pode ordenar 'visible'=>false ), 'reference' => array( 'title' => $this->l('Ticket'), 'align' => 'text-center', 'class' => 'fixed-width-xs', 'search' => true, 'filter_key' => 'a!reference', // clave da consulta mysql wue queremo amosar.. 'orderby' => true // necesario para indicar que si se pode ordenar ), 'date_add' => array( 'title' => $this->l('Fecha'), 'align' => 'text-right', 'type' => 'datetime', 'filter_key' => 'a!date_add', 'search' => false, 'orderby'=>true ) ); If i remove the part from the ID, it is not shown in the list, but the edit or view links dont work as it seems the id_order parameter is needed. I don't know how... Is there any parameter in the field list or any other workaround to accomplish this via php (css is not a solution here :-) Thanks in advance. Regards, Acuarel
  6. Hola. Pués he instalado el módulo con la modificación que te indico y sin problema. Prueba a borrar la cache del prestashop. Elimina también el archivo /cache/class_index.php Ya me contarás! Salu2
  7. Hi there! I'm trying to figure out how to work with dates and datetimes with the renderForm and objectModel for the helperForm i've $fields_form = array( 'legend' => array( 'title' =>$this->l('Abrir Caja'), 'icon'=>'icon-signin' ), // Fields 'input' => array( 'id_caja' => array('type' => 'hidden', 'name' => 'id_caja' ), 'date_caja'=>array( 'type' => 'datetime', 'label' => $this->l('fecha:'), 'name' => 'date_caja', 'id' => 'date_caja', 'lang' => false, 'required' => true, 'size'=>10,), ), ); At this point i've 2 questions: 1 - How should i populate the datefield with the current date and time according to prestashop timezone and language settings? I've tried this: 'date_caja' => Tools::displayDate(date("Y-m-d H:i:s"), $default_lang, true) so the date shows in EU format, i,e, 29/08/2015 14:34:12. but i think there must a much simplier way of doing this. 2- using the above method, i dont know how to use Prestashop built functions to convert that date to a mysql datetime before saving the object to database. Now i'm using: $tmp = str_replace( "/", "-", Tools::getValue( 'date_caja' ) ); $_newobj->date_caja = date("Y-m-d H:i:s",strtotime( $tmp )); I think i'm little lost here. Any help would be much appreciated. Acuarel
  8. Hola! Tienes un error en el php: return $this->displayFILE(__FILE__, 'moduloprueba.tpl'); Cámbialo por return $this->display(__FILE__, 'moduloprueba.tpl'); Salu2
  9. Thx for your reply blackcarma. Finally i've decided to make a 180 degree turn, and i'm trying now to make my own back office module to accomplish this It involves managing backoffice menu tabs, replicate de orders controller, etc. My goal would be to develope a sort of POS module. Again, thank you very much
  10. Hi blackarma. Thx for the reply Your reply let me face the first part of the problem (removing the unwanted columns). I tried public function __construct(){ parent::__construct(); unset($this->fields_list['priority']); unset($this->fields_list['quantity']); $this->fields_list['reduction_amount'] = array('title' => $this->l('Importe'), 'class' => 'fixed-width-sm', 'currency' =>true, 'type' => 'price', 'color'=>'#cc0000' ); $this->fields_list['reduction_percent'] = array('title' => $this->l('% DCTO'), 'class' => 'fixed-width-sm', 'type' => 'decimal' ); } and it worked. Iv'e now two "beautiful" columns in the listing page. But my goal was to make a custom link in the listing page, lets say, add another column with a link to be able to print the voucher. Your kindly reply was pointing my to modify the edit form for a given voucher, if i'm not wrong :-) After trying to add columns to the listing page (tried the $_select or the $_join properties with no luck :-(, and with your answer in mind and after a few hours googling i've found the addRowAction method and finally i've been able to add another action button with the 'Print' legend on the actions column. So my code looks like: class AdminCartRulesController extends AdminCartRulesControllerCore{ public function __construct(){ parent::__construct(); unset($this->fields_list['priority']); unset($this->fields_list['quantity']); $this->fields_list['reduction_amount'] = array('title' => $this->l('Importe'), 'class' => 'fixed-width-sm', 'currency' =>true, 'type' => 'price', 'color'=>'#cc0000' ); $this->fields_list['reduction_percent'] = array('title' => $this->l('% DCTO'), 'class' => 'fixed-width-sm', 'type' => 'decimal' ); $this->addRowAction('print'); } public function displayPrintLink( $token, $id){ $tpl = $this->createTemplate('helpers/list/list_action_print.tpl'); // My tpl in the override/controllers/admin folder // Could use $tpl->assign(array( $this->context->smarty->assign(array( 'href' => self::$currentIndex.'&token='.$this->token.'&'.$this->identifier.'='.$id.'&print_vale=1&content_only=1', 'action' => $this->l('Imprimir'), 'title'=>"This link should open blank window with my own tpl \nwhere i could show database infos") ); return $tpl->fetch(); } public function renderList(){ return parent::renderList(); } public function initProcess(){ parent::initProcess(); if (Tools::getValue('print_vale')){ $this->display = 'print_voucher'; $this->action = 'print_voucher'; } } public function print_voucher(){ return "this does not work!!"; } } And my override list_action_print.tpl: <a href="{$href|escape:'html':'UTF-8'}" title="{$title|escape:'html':'UTF-8'}" class="print" onclick="window.open('{$href|escape:'html':'UTF-8'}' ); return false;"><i class="icon-print"></i> {$action|escape:'html':'UTF-8'} </a> Now i'm stuck at this point ¿How should i make that link to open a custom blank page where to show the vouchers info, so i can print it? Any help or guidance at this point would be very much apreciated. Regards, Acuarel
  11. Hi there. I'm trying to override vouchers list page at the backend (http://localhost/admin/index.php?controller=AdminCartRules ) This is for learning purposes cause the goal is to be able to add another column to that listing page with a custom link I've cretaed a AdminCartRulesController.php file and placed it into the /override/controllers/admin/ folder. The file content is as follows: class AdminCartRulesController extends AdminCartRulesControllerCore{ public function __construct(){ $this->bootstrap = true; $this->table = 'cart_rule'; $this->className = 'CartRule'; $this->lang = true; $this->addRowAction('edit'); $this->addRowAction('delete'); $this->_orderWay = 'DESC'; $this->bulk_actions = array( 'delete' => array('text' => $this->l('Delete selected') ,'icon' => 'icon-trash' , 'confirm' => $this->l('Delete selected items?'))); $this->fields_list = array( 'id_cart_rule' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name')), 'code' => array('title' => $this->l('Code'), 'class' => 'fixed-width-sm'), 'date_to' => array('title' => $this->l('Expiration date'), 'type' => 'datetime'), 'active' => array('title' => $this->l('Status'), 'active' => 'status', 'type' => 'bool', 'orderby' => false), ); parent::__construct(); } } as all i want to do is remove columns quantity and priority. But no way. My override is loaded (if i make an error_log call inside the constructor it is triggered ) but it does not work as all the columns are shown (as defined in the parent class) I've also tried to delete class_index.php in cache folder May be i'm missing something here... Any help would be very much apreciated.
  12. Thx for your reply. Sorry for being late in answering but , believe me, i couldn't find a way to reach this message until now :-P Regards, Daniel
  13. Hi there. I'm a newbie at smarty and need a little bit of help (using PS 1.6.0.9) : In smarty template i have the following variable: {assign var ="link_url" value = $link->getCmsLink(8)} I want to sprint a string with that link, using {l s='... so i tried: {l s='I've read and understood the %s terms of policy %s' sprintf=['<a class="fancybox" href="$link_url">', '</a>'] } or {l s='I've read and understood the %1$ terms of policy %2$' sprintf=['<a class="fancybox" href="$link_url">', '</a>'] } with no success, as <a tag> is stripped in sprintf. What is the right way to do that? Thx in advance!
×
×
  • Create New...