Jump to content

module "TM Category Products" in custom hook (additional tab area)


Recommended Posts

Hello,

 

my PS version is v1.6.1.11

 

my situation: I had the two modules "TM Category Products" and "Block new products" in the frontpage hook "displayHomeTab" and "displayHomeTabContent" (and "displayHome").

 

What I want to do is split the two tabs into two tabbed areas. So I added

{hook h='displaySecondHomeTab'}

and

{hook h='displaySecondHomeTabContent'}

in the index.tpl of my template.

 

I also added

            && $this->registerHook('displaySecondHome')
            && $this->registerHook('displaySecondHomeTab')
            && $this->registerHook('displaySecondHomeTabContent')

in the /modules/tmcategoryproducts/tmcategoryproducts.php's install-function to initalize the module for the new hooks.

 

I also added the hooking methods hookDisplaySecondHome, hookDisplaySecondHomeTab und hookDisplaySecondHomeContent by duplicating the methods for the original hookings methods.

 

There it holds the hooks for the original displayHomeTab and displayHomeTabContent. Then I reinitialized the module "TM Category Products", removed them from the hooks displayHomeTab and displayHomeTabContent and added (transplanted) it to the now appearing hooks displaySecondHomeTab and displaySecondHomeTabContent.

 

After adding categories to the TM Category Products module they showed up in the new hook in the frontend, but as soon as I select a category it is still displayed in the displayHomeTabContent hook and not in the newly created displaySecondHomeTab.

 

How do I get the content displayed only in the displaySecondHomeTabContent?

 

TIA and best regards

Edited by prestashopuser1337 (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Does anyone have an idea how to solve my problem with Prestashop?

 

Do you need more explanations about what I want to achieve or more information about my Prestashop configuration?

 

 

I would really appreciate some help on this issue since the dev documentation of prestashop isn't exactly brilliant.

 

Best regards

Link to comment
Share on other sites

Ok I solved it now.

 

What I did (in addition to my first post) was I duplicated the carousel module and replace every occurence of 'carousel' with 'secondcarousel' so that it was unique. This was important since the carousel uses an id for displaying the products via javascript.

 

Another alternative would be to rewrite the module so that it can display products on multiple ids, but the duplication seemed more straight forward for me. One advantage of the duplication is that one can set different no. of products to display in each module.

 

I then added the hooks to the install-routine of the second carousel and just installed it as a new module.

 

Maybe this helps somebody somewhere sometime...

Edited by prestashopuser1337 (see edit history)
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...