cyberman Posted June 7, 2013 Share Posted June 7, 2013 hi, i am trying skype module position from transplant tool in top of page, but it not allowed me, see attached photo . how i hook skype module in top of page. , kindly help . Link to comment Share on other sites More sharing options...
benjamin utterback Posted June 7, 2013 Share Posted June 7, 2013 Hi cyberman, could you give us details about what specific skype module it is. What version of PrestaShop you are using, and please provide a link to your store so we can test it. Thank you! Link to comment Share on other sites More sharing options...
vekia Posted June 7, 2013 Share Posted June 7, 2013 try to duplicate the function hookrightcolumn() and change name to hooktop() then in function install() add this $this->registerhook('top') reinstall module and then try to transplant it Link to comment Share on other sites More sharing options...
cyberman Posted June 8, 2013 Author Share Posted June 8, 2013 this is attached skype module , kindly check block_skype.zip Link to comment Share on other sites More sharing options...
vekia Posted June 8, 2013 Share Posted June 8, 2013 use this code for blockskype.php <?php class BlockSkype extends Module { function __construct() { $this->name = 'blockskype'; $this->tab = 'Blocks'; $this->version = 0.2; parent::__construct(); // The parent construct is required for translations $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Block Skype'); $this->description = $this->l('Adds a block to display an Skype'); if (!Configuration::get('COD_SKYPE')) $this->warning = $this->l('You have not yet set your Skipe code'); $this->description = $this->l('Integrate Skype into your shop'); $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('rightColumn') OR !$this->registerHook('leftColumn')) OR !$this->registerHook('top')) return false; return true; } /** * Returns module content * * @param array $params Parameters * @return string Content */ function hookLeftColumn($params) { global $smarty; //$smarty->output_charset = 'HTML'; $skypecod=Configuration::get('COD_SKYPE'); //$skypecod=html_entity_decode($skypecod); $smarty->assign('skype',$skypecod); return $this->display(__FILE__, 'blockskype.tpl'); } function hookRightColumn($params) { return $this->hookLeftColumn($params); } function hookTop($params) { return $this->hookLeftColumn($params); } public function getContent() { $output = '<h2>'.$this->displayName.'</h2>'; if (Tools::isSubmit('submitSKYPE') AND ($gai = Tools::getValue('cod_skype'))) { //$gai = htmlentities($gai, ENT_COMPAT, 'UTF-8'); Configuration::updateValue('COD_SKYPE', $gai, true); $output .= ' <div class="conf confirm"> <img src="../img/admin/ok.gif" alt="" title="" /> '.$this->l('Settings updated').' </div>'; } return $output.$this->displayForm(); } public function displayForm() { $output = ' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <fieldset><legend>'.$this->l('Settings').'</legend> <label>'.$this->l('Your code Skype').'</label> <div class="margin-form"> <textarea name="cod_skype" cols="90" rows="10" />'.Tools::getValue('cod_skype', Configuration::get('COD_SKYPE')).'</textarea> </div> <center><input type="submit" name="submitSKYPE" value="'.$this->l('Update settings').'" class="button" /></center> </fieldset> </form>'; return $output; } } ?> reinstall module. i think that after that, also css modification will be necessary Link to comment Share on other sites More sharing options...
cyberman Posted June 14, 2013 Author Share Posted June 14, 2013 i upload these code , then server error occurred . Link to comment Share on other sites More sharing options...
vekia Posted June 14, 2013 Share Posted June 14, 2013 have you got any error code? if not, please turn error reporting in your prestashop, then try again. If any error appear - please paste it here regards Link to comment Share on other sites More sharing options...
Recommended Posts