PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

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

11 replies to this topic
#1
Trine

    PrestaShop Newbie

  • Members
  • Pip
  • 15 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

#2
hieloiceberg

    PrestaShop Apprentice

  • Members
  • PipPip
  • 480 posts
Back Office >>Modules >>Positions >>Transplant a module

then you choose Right column blocks or Left column blocks
FarmVille Addict ;-)

#3
Trine

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
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

#4
Static

    PrestaShop Apprentice

  • Members
  • PipPip
  • 189 posts
sounds like your only using a 2 column theme

do you have a link so we can see?
www.ezytrader.com

#5
Trine

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Nope - it is the PrestaShop theme I use...

http://prestashopdem...bkompagniet.dk/

Note it is a testinstallation....

#6
Trine

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
I have made another v.1.1 installation and it is neither working here....

Do any one else experience the same problem?

#7
hieloiceberg

    PrestaShop Apprentice

  • Members
  • PipPip
  • 480 posts
The options is there but some modules do not have it on it so you have to edit the module php file to have the option witch side you need it to go to

Attached Files


FarmVille Addict ;-)

#8
Trine

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Hi again...

I have checked all the installed modules to see if the option where available, but none had it switched on.

Could you please show me the code snippet on how to switch it on?

Regards Trine

#9
boran

    PrestaShop Apprentice

  • Members
  • PipPip
  • 42 posts
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?

#10
boran

    PrestaShop Apprentice

  • Members
  • PipPip
  • 42 posts
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

#11
Hoodgrown

    PrestaShop Apprentice

  • Members
  • PipPip
  • 370 posts
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..
PetsRight.com
http://www.petsright.com
http://www.twitter.com/petsright

My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm

#12
Hoodgrown

    PrestaShop Apprentice

  • Members
  • PipPip
  • 370 posts
Ok... I did some more searching and found the answer right
http://www.prestasho..._and_not_active
PetsRight.com
http://www.petsright.com
http://www.twitter.com/petsright

My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm