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

#   Password protect category pages

##

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 7 months ago [\#96537](#96537) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#96537 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")* was created by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")*

I am trying to set up an events photography site using Hikashop to process orders and payments.

The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.

Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.

If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?

Thanks for any help.

Regards
D

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 7 months ago [\#96617](#96617) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#96617 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Hi,

I think that you have to use the custom fields on the table category to set a password by category.
Then edit the view which is listing the products, generally "product / listing_img_title" and in this view add a check for the password.

If the category has a password AND the user has no session token about this password &gt; restrict the access and only display a password field.
When the customer enter the password, create a session token.
But if the user has a token in her session saying that he has already entered the password, show the content of the listing.

This is probably the easiest way to achieve that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 7 months ago [\#96638](#96638) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  Replied by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#96638 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Thanks for the reply - I understand the solution, it's not something I've done before, but will have a go when I get a chance.

Do I need the business version to add the custom field? It's not a problem I am going o purchase it in the near future, but just wondering if I will need it to do this task.

Dunxmax

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 7 months ago [\#96682](#96682) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#96682 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Yes the custom fields for this type of table are in the business version.
Using the custom fields will allow you to save your time.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 7 months ago [\#96686](#96686) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  Replied by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#96686 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

That's no problem - I shall buy it in the next week or so. Looking forward to seeing what other things I can do with the business version.

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 6 months ago [\#100775](#100775) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  Replied by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#100775 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Hi Xavier,

I know its been a while since I last posted on this thread, but this is the first day I've had a chance to have a go at your suggestion.

I've bought the business version of Hikashop.

I have gone to custom fields and added a "passkey" field in the "category" table.

I have set it to have a field type of "Text".
You then say to do this:

> Then edit the view which is listing the products, generally "product / listing\_img\_title" and in this view add a check for the password.
>
> If the category has a password AND the user has no session token about this password &gt; restrict the access and only display a password field.
> When the customer enter the password, create a session token.
> But if the user has a token in her session saying that he has already entered the password, show the content of the listing.

Unfortunately I am not a coder and I have no idea how to go about coding the above. Can you help me in anyway or help me get started.

Thanks in advance.

D

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 [\#100939](#100939) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#100939 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Hi,

It's a support forum for help in configuration and bug correction, not for customizations.
You can post a request in the commercial jobs section of this forum.

What you need is a check on the custom field, something like: Code:

if(!empty($this-&gt;element-&gt;passkey) &amp;&amp; $app-&gt;getUserState( HIKASHOP_COMPONENT.'.passkey') != $this-&gt;element-&gt;passkey){ // Display only a form to enter the passkey // &gt; when pressing submit, save the value in session, and reload the page. // To save in session, you can use: $app-&gt;setUserState( HIKASHOP_COMPONENT.'.passkey',JRequest::getVar('passkey','')); }elseif(empty($this-&gt;element-&gt;passkey) &#124;&#124; $app-&gt;getUserState( HIKASHOP_COMPONENT.'.passkey') == $this-&gt;element-&gt;passkey){ // Display the the code }

Add it in the view "product / listing" before:
if(($this-&gt;params-&gt;get('show_image') &amp;&amp; !empty($this-&gt;element-&gt;file_path))&#124;&#124; ($this-&gt;params-&gt;get('show_description',!$this-&gt;module)&amp;&amp;!empty($this-&gt;element-&gt;category_description))){

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 6 months ago [\#100961](#100961) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  Replied by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#100961 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Xavier,

Thanks - I will have a go with this later.

I understand your comment about customisation and I'm sorry if I'm posting in the wrong part of the forum, I honestly didn't realise there was a commercial job section. Either way I need to get this working, so once again thank you and I appreciate your time.

D

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")**
- [![dunxmax's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9795-dunxmax "View dunxmax's Profile") Topic Author
- [ Offline](/forum/user/9795-dunxmax)

Less More

- Posts: 82
- Thank you received: 6
-
-
-
- [](http://www.aquamandesign.co.uk)
-

13 years 6 months ago [\#101644](#101644) by [dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")  Replied by *[dunxmax](/forum/user/9795-dunxmax "View dunxmax's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#101644 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

HI Xavier,

I added the code and got this error:

"Fatal error: Call to a member function getUserState() on a non-object in mysite/templates/js_memo/html/com_hikashop/product/listing.php on line 117"

I know this should be a commercial job - it would make sense for me to pay you, seeing as we are half way through. Are you willing to take this on?

Regards

Duncan

---

DunxMax

The more we learn the less we know.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 [\#101663](#101663) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Password protect category pages](/forum/2-general-talk-about-hikashop/79732-password-protect-category-pages#101663 "I am trying to set up an events photography site using Hikashop to process orders and payments.  The events will be wide ranging and will include some events with children competing. I therefore want to restrict the users viewing photos by issuing a password at the event. Those with a password can then use the password to gain access to photos of the relevant event.  Is there any way to insert a step in Hikashop which requires users to enter a password before they get to the relevant page - this would be the equivalent of a category page.  If I can't do this using Hikashop either via the business version or otherwise, does anyone know a way I can achieve this using Joomla?  Thanks for any help.  Regards D")*

Hi,

That's probably because $app is not declared, you can use '$app = JFactory::getApplication();'

You can post this request on the commercial Jobs, we don't do custom works, so many features to implement in HikaShop ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5NzMyLXBhc3N3b3JkLXByb3RlY3QtY2F0ZWdvcnktcGFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.107 seconds

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

[](#top)
