Jump to content

[solved] Block appears after registration or authentication


Recommended Posts

Yes, I want to disable a block for unlogged users...

 

okay, now it's clear for me what you exactly expect :-)

I've got last questions: what prestashop version you use?

 

this is very important question, because everything depends on this

Link to comment
Share on other sites

yes, for example, if you want to disable suppliers for unlogged users, open the:

 

modules/blocksupplier/blocksupplier.tpl file (remember that this file may exists also in themes/modules/blocksupplier/blocksupplier.tpl - if so - you have to append changes there)

 

the first line of the code looks like:

<!-- Block suppliers module -->
<div id="suppliers_block_left" class="block blocksupplier">

 

instead code above use this:

<!-- Block suppliers module -->
{assign var=context value=Context::getContext()}
{if $context->customer->logged==1}
<div id="suppliers_block_left" class="block blocksupplier">

as you can see - i added the context variable {assing var=context ...} and if condition: {if $context-> ...}

 

 

at the end of the file add close {/if} condition tag:

 

{/if}
<!-- /Block suppliers module -->

Link to comment
Share on other sites

×
×
  • Create New...