- Posts: 640
- Thank you received: 16
Managing ACL in custom fields
- PeterChain
-
Topic Author
- Offline
Less
More
13 years 4 months ago #104419
by PeterChain
Managing ACL in custom fields was created by PeterChain
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 } ?>
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.
13 years 4 months ago #104758
by Xavier
Replied by Xavier on topic Managing ACL in custom fields
Hi,
You can use something like:
You can use something like:
Code:
<?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.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
13 years 4 months ago #104769
by PeterChain
Replied by PeterChain on topic Managing ACL in custom fields
It work perfectly!
Thank you!
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds