Jose Lorenzini Posted April 20, 2020 Share Posted April 20, 2020 (edited) Hi guys i am struggling with order loockup module from knowband developers , i wanna transplant the module to nav1 to nav2 but they just allow me to use nav1. please help.! if someone can help me i would thanks you in advance. thanks! {if isset($ol_displaynav1_links) && count($ol_displaynav1_links) > 0} <style> #_desktop_contact_link, #kb_displaynav1_links_container{ display: inline-table; } .display_nav1_link{ display: table-cell; padding: 6px 5px; border-left: 1px solid #515151; border-right: 1px solid #515151; } </style> <script> var velsof_order_lookup = {$ol_displaynav1_links[0]['enable']}; </script> <div id="kb_displaynav1_links_container"> {foreach $ol_displaynav1_links as $sl} <div class="display_nav1_link"> {if isset($sl['confirm'])} <a href="javascript:void(0)" title="{$sl.title}" rel="nofollow" onclick="if(confirm('{$sl.confirm.message}')){ location.href= '{$sl.href}' }"> {$sl.label} </a> {else} <a href="{$sl.href}" title="{$sl.title}" rel="nofollow"> {$sl.label} </a> {/if} </div> {/foreach} </div> {/if} Edited April 20, 2020 by Jose Lorenzini (see edit history) Link to comment Share on other sites More sharing options...
luishuaymana Posted April 20, 2020 Share Posted April 20, 2020 Para que te aparezca el hook en las posiciones debes agregar el gancho en el archivo php principal de tu modulo.Ejemplo : (Llamemos al modulo pd_moduloejemplo) Entonces dentro de la carpeta del modulo habrá un archivo llamado pd_moduloejemplo.php Te diriges a la parte final del archivo y debe haber algo parecido a el siguiente codigo public function hookDisplayNav1() { // ... todo tu codigo del nav } lo que debes hacer es agregar debajo de este codigo otro igual con el nombre del hook ( Nav2) public function hookDisplayNav2() { // copia aqui el mismo codigo del nav1 } guardas los y te diriges a las posiciones de los modulos y aparecera el nuevo gancho. 1 Link to comment Share on other sites More sharing options...
Jose Lorenzini Posted April 20, 2020 Author Share Posted April 20, 2020 Hola Luis Thanks man , hice lo que me dijiste y ahora aparecio en la opcion nav2. eres un Genio!!! copio el codigo: muchas gracias! public function hookDisplayNav1() { $plugin_data = unserialize(Configuration::get('ORDERLOOKUP_DATA')); if ($plugin_data['enable'] == 1) { $front_link = $this->context->link->getModuleLink( $this->name, 'orderlookup', array(), (bool)Configuration::get('PS_SSL_ENABLED') ); $ol_displaynav1_links = array(); $ol_displaynav1_links[] = array( 'href' => $front_link, 'label' => $this->l('Order Lookup'), 'title' => $this->l('Click to view your orders'), 'enable' => $plugin_data['enable'] ); $this->context->smarty->assign('ol_displaynav1_links', $ol_displaynav1_links); return $this->display(__FILE__, 'views/templates/hook/plugin_ol.tpl'); } else { return ''; } } public function hookDisplayNav2() { $plugin_data = unserialize(Configuration::get('ORDERLOOKUP_DATA')); if ($plugin_data['enable'] == 1) { $front_link = $this->context->link->getModuleLink( $this->name, 'orderlookup', array(), (bool)Configuration::get('PS_SSL_ENABLED') ); $ol_displaynav1_links = array(); $ol_displaynav1_links[] = array( 'href' => $front_link, 'label' => $this->l('Order Lookup'), 'title' => $this->l('Click to view your orders'), 'enable' => $plugin_data['enable'] ); $this->context->smarty->assign('ol_displaynav1_links', $ol_displaynav1_links); return $this->display(__FILE__, 'views/templates/hook/plugin_ol.tpl'); } else { return ''; } } 1 Link to comment Share on other sites More sharing options...
luishuaymana Posted April 20, 2020 Share Posted April 20, 2020 De nada. No te olvides poner solucionado al título. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now