Jump to content

Hooks - move block from left to right column - where to set?


Recommended Posts

Hi,

I wan't to move some blocks from right to left.

Fx. the newsletterblock from left to right column.

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

    function hookLeftColumn($params)
    {
       global $smarty;

       if (Tools::isSubmit('submitNewsletter'))
       {
           $this->newsletterRegistration();
           if ($this->error)
           {
               $smarty->assign(array('color' => 'red',
                                       'msg' => $this->error,
                                       'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false,
                                       'nw_error' => true,
                                       'action' => $_POST['action']));
           }
           elseif ($this->valid)
           {
               if (Configuration::get('NW_CONFIRMATION_EMAIL') AND isset($_POST['action']) AND intval($_POST['action']) == 0)
                   Mail::Send(intval($params['cookie']->id_lang), 'newsletter_conf', $this->l('Newsletter confirmation'), array(), pSQL($_POST['email']), NULL, NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
               $smarty->assign(array('color' => 'green',
                                       'msg' => $this->valid,
                                       'nw_error' => false));
           }
       }
       $smarty->assign('this_path', $this->_path);
         return $this->display(__FILE__, 'blocknewsletter.tpl');
    }

   public function confirmation()
   {
       global $smarty;

       return $this->display(__FILE__, 'newsletter.tpl');
   }

   public function externalNewsletter(/*$params*/)
   {
       return $this->hookLeftColumn($params);
   }




How do I move the block to right column? And isn't there a .tpl file somewhere where the hook should be edited?

Can anyone give me a quick tutorial/tip?


Regards, Trine

Link to comment
Share on other sites

Hi,

That would be the natural thing to do :-) - but the "Hook into" drop down box only offers "Left Column Block" and not "Right Column Block"

I have checked all the blocks, and it is the same issue for all blocks, so I thought is was a feature which not yet have been implemented.

My installation is an v.1.1.

Regards, Trine

Link to comment
Share on other sites

  • 4 weeks later...

I too, wish to move the My Account block from left to right.
In Back Office >> Modules >> Positions >> My Account Block the options are greyed out.
The default theme is being used.

So i started sifting through the theme code, imagining that it must be in there somewhere. I had a look at global.css and my-account.tpl, but no luck.

Where is the column position specified in the code?

Link to comment
Share on other sites

I found the solution for placing the My Account on the right.

A) in modules\blockmyaccount\blockmyaccount.php, change the following code:

public function install()
   {
       //if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('leftColumn'))
       if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('rightColumn'))



B) deinstall then re-install the "My Account block" module

Perhaps someone could tell me however, what is needed so that a module can be changed from left to right from the GUI, i.e. Back Office >> Modules >> Positions

Link to comment
Share on other sites

  • 1 month later...

hieloiceberg,
I'm experiencing the same problem. I tried searching for the answer which led me to this post.

1. I'm using Prestashop 1.1
2. My Account block v1.2
3. Modifying Prestashop Theme
4. The "Account Block" doesn't even show up in my left column even though it's installed.

In Modules/Positons backend
the "Hook Into" field is not even selectable. So there's no what for me to change column position.

As a matter of fact, none of the modules will let me select the "Hook Into" pulldown menus....

Any help would be greatly appreciated..

Link to comment
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...