Managing ACL in custom fields

  • Posts: 636
  • Thank you received: 16
11 years 7 months ago #104419

For my product page I made some code to display several custom fields on my own and not through the component established way to show custom fields.

This is why although some custom fields are ACLed to be only rendered to registered users they show anyway for non registered users. How should be the code to filter them depending if the sessions status?

this is an example of my code for custom field 'carga' which is viewable only to registered users.


<?php if(!empty($this->row->carga)) {?>
<tr>
<td align="left"><?php echo '<a class="pagina_producto_datos">'.$this->row->carga.' Kg</a>';?></td>
</tr>
<?php } ?>

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #104758

Hi,

You can use something like:

<?php if(!empty($this->row->carga) && hikashop_loadUser() != null) {?>
<tr>
<td align="left"><?php echo '<a class="pagina_producto_datos">'.$this->row->carga.' Kg</a>';?></td>
</tr>
<?php } ?> 

The following user(s) said Thank You: PeterChain

Please Log in or Create an account to join the conversation.

  • Posts: 636
  • Thank you received: 16
11 years 7 months ago #104769

It work perfectly!

Thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum