Jump to content

Cannot install blockmyaccount


Recommended Posts

I am a newbie - been playing with prestashop now for a few days. For whatever reason, after messing around with some of the third party myaccount blocks, and now trying to switch back to the included myaccount block, I get the "The following module(s) were not installed successfully: blockmyaccount" error.

I have searched all over the forums and haven't really found any advice on fixing the issue. Any help would be appreciated.

Here is my blockmyaccount.tpl:

<!-- Block myaccount module -->

{l s='My account' mod='blockmyaccount'}

{l s='My orders' mod='blockmyaccount'}
           {if $returnAllowed}
{l s='My merchandise returns' mod='blockmyaccount'}
{l s='My credit slips' mod='blockmyaccount'}
{l s='My addresses' mod='blockmyaccount'}
{l s='My personal info' mod='blockmyaccount'}
           {if $voucherAllowed}
{l s='My vouchers' mod='blockmyaccount'}

{l s='Sign out' mod='blockmyaccount'}

<!-- /Block myaccount module -->

blockmyaccount php:


if (!defined('_CAN_LOAD_FILES_'))

class BlockMyAccount extends Module
   public function __construct()
       $this->name = 'blockmyaccount';
       $this->tab = 'Blocks';
       $this->version = '1.2';


       $this->displayName = $this->l('My Account block');
       $this->description = $this->l('Displays a block with links relative to user account');

   public function install()
       if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('leftColumn'))
           return false;
       return true;

   public function uninstall()
       return (parent::uninstall() AND $this->removeMyAccountBlockHook());

   public function hookLeftColumn($params)
       global $smarty;

       if (!$params['cookie']->isLogged())
           return false;
           'voucherAllowed' => intval(Configuration::get('PS_VOUCHERS')),
           'returnAllowed' => intval(Configuration::get('PS_ORDER_RETURN')),
           'HOOK_BLOCK_MY_ACCOUNT' => Module::hookExec('myAccountBlock')
       return $this->display(__FILE__, $this->name.'.tpl');

   public function hookRightColumn($params)
       return $this->hookLeftColumn($params);

   private function addMyAccountBlockHook()
       return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'hook` (`name`, `title`, `description`, `position`) VALUES (\'myAccountBlock\', \'My account block\', \'Display extra informations inside the "my account" block\', 1)');

   private function removeMyAccountBlockHook()
       return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'myAccountBlock\'');


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

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