[Skip to main content](#vessel-content)

#   Managing ACL in custom fields

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 6 months ago [\#104419](#104419) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Managing ACL in custom fields](/forum/2-general-talk-about-hikashop/81997-managing-acl-in-custom-fields#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.  row-&gt;carga)) {?&gt;  ?php echo ''.$this-&gt;row-&gt;carga.' Kg';?&gt;  ")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

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.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxOTk3LW1hbmFnaW5nLWFjbC1pbi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 6 months ago [\#104758](#104758) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Managing ACL in custom fields](/forum/2-general-talk-about-hikashop/81997-managing-acl-in-custom-fields#104758 "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.  row-&gt;carga)) {?&gt;  ?php echo ''.$this-&gt;row-&gt;carga.' Kg';?&gt;  ")*

Hi,

You can use something like: Code:

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

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxOTk3LW1hbmFnaW5nLWFjbC1pbi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 6 months ago [\#104769](#104769) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Managing ACL in custom fields](/forum/2-general-talk-about-hikashop/81997-managing-acl-in-custom-fields#104769 "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.  row-&gt;carga)) {?&gt;  ?php echo ''.$this-&gt;row-&gt;carga.' Kg';?&gt;  ")*

It work perfectly!

Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxOTk3LW1hbmFnaW5nLWFjbC1pbi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
