Jump to content

Change sidebar.tpl


kepler

Recommended Posts

Hi

 

I have an addon module which appears automatically to the user in the product area as an option. But I have 2 products: BASIC and PREMIUM

 

This addon is to be used in PREMIUM only.

 

So I was wondering if I could use this code in sidebar in the foreach loop {foreach $item->getChildren() as $childItem}

 

{if $product|strstr:'BASIC'}
{if $childItem->getName() eq "PREMIUM"}
<a href="http://{$domain}" class="btn btn-default" target="_blank">BASIC</a>
{continue}
{/if}
{/if}

 

It's my belief that if the product is BASIC then when the addon apears in the loop, it will write the correct "button" (BASIC) instead of the PREMIUM addon. The "visit homepage" in the product details would disapear.

 

Any expert advise would be very welcomed and apreciated..

 

Kind regards

 

Kepler

Link to comment
Share on other sites

I doubt it would work in the way you think.

 

i'd have to see the sidebar to know, but I suspect the far better way to do this would be to use a sidebar action hook.

 

Hi

 

Actually it works ! :)

 

Tested yesterday night. The only change I made was in the clas (instead of group button I used list because of the layout). There are amazing possibilities in the script language in the tpl files.

 

Kind regards

 

Kepler

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated