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

#   Time restricted access to check-out (or component)

##

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

Less More

- Posts: 196
- Thank you received: 6
-
-
-
- [](http://www.paschencommunications.com)
-

10 years 2 months ago [\#250238](#250238) by [cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")  *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250238 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")* was created by *[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")*

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 7.0.6
-- Browser(s) name and version -- : na
-- Error-message(debug-mod must be tuned on) -- : none

Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?

We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.

I have not found a way to do this within Hikashop itself; however I may have missed something.

I've looked for other HS extensions but didn't find anything like this.
If it isn't possible with core HS setttings, is there a way to do this through a work-around?
(Or possibly just a custom php script that runs by cron to set the 'Put the store offline" to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

10 years 2 months ago [\#250272](#250272) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250272 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Hi,

You can do that with the "Business hours" setting of the HikaShop configuration where you can define open and close hours of the online store's checkout.

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

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

Less More

- Posts: 196
- Thank you received: 6
-
-
-
- [](http://www.paschencommunications.com)
-

10 years 2 months ago [\#250329](#250329) by [cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")  Replied by *[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250329 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Thanks. However, what I specifically need is the ability to JUST close the store on Mondays from 15:00 - 20:00. We need to have it open all other days 24/7.

Can I programattically (via cron) just change those hours on Monday and then reset them on Tuesday each week?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 2 months ago [\#250331](#250331) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250331 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Hi,

I know that PolishedGeek made a special plugin to handle more restrictions for the "close store".
Otherwise, you can perform a view override for your "checkout &#124; step" and add some PHP code to close the shop only on monday between 15:00 and 20:00.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 196
- Thank you received: 6
-
-
-
- [](http://www.paschencommunications.com)
-

10 years 2 months ago [\#250467](#250467) by [cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")  Replied by *[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250467 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Although I'd love to help support Polished Geek, this project is for a small non-profit so can't afford outside plugins.

So the view override will be a good option for us.

Do you have any documentation about how to properly add PHP code to a view override for something like this (or ANY samples of PHP functionality within a view override would be helpful).
Also, do you have a list of what variables/data are available within different view files?

I've done only a few view overrides, so I'm not all that experienced with that.

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

10 years 2 months ago [\#250481](#250481) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250481 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Hi,

Well, you don't need to know about any variable or data available in there.
It only requires knowing PHP.
It's quite simple if you know PHP.
You use the date() function of PHP to get the current day, or current hour, or current month, etc:
[ php.net/manual/en/function.date.php](http://php.net/manual/en/function.date.php)
And you compare it with the values you need for the restrictions you want.
And if the current time is outside of the ranges you have, you just use return; to stop the processing of the view file.

And you even have an example of such code with the first 50 lines of the checkout/step.php view file which handle the Business hour setting of the HikaShop configuration.

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

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

Less More

- Posts: 196
- Thank you received: 6
-
-
-
- [](http://www.paschencommunications.com)
-

10 years 2 months ago [\#250580](#250580) by [cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")  Replied by *[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250580 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Thanks for the reference to the checkout/ste.php file. Exactly what I needed for this.

However, I wasn't clear about the variables.
Can I use normal Joomla! JFactory::getUser() (and other Joomla functions) within this file?
[I am thinking I might want to still allow certain users, or access level users, to access the store when it is 'closed']

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 2 months ago [\#250581](#250581) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Time restricted access to check-out (or component)](/forum/27-checkout/886496-time-restricted-access-to-check-out-or-component#250581 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.2 -- PHP version -- : 7.0.6 -- Browser(s) name and version -- : na -- Error-message(debug-mod must be tuned on) -- : none  Is there any way to automatically make checkout not possible (or the entire store offline) for certain times each week?  We would like to have the store be not accessible during a certain period of time each week, and we need to automate the process.  I have not found a way to do this within Hikashop itself; however I may have missed something.  I've looked for other HS extensions but didn't find anything like this. If it isn't possible with core HS setttings, is there a way to do this through a work-around? (Or possibly just a custom php script that runs by cron to set the 'Put the store offline&quot; to YES (and then back to NO at a certain time? Is that field easily accessible somewhere to set externally?)")*

Hi,

Sure you can !

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4NjQ5Ni10aW1lLXJlc3RyaWN0ZWQtYWNjZXNzLXRvLWNoZWNrLW91dC1vci1jb21wb25lbnQ/dG1wbD1tYXJrZG93bg==) 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.067 seconds

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