Time restricted access to check-out (or component)
10 years 2 weeks ago #250238
by cpaschen
Time restricted access to check-out (or component) was created by cpaschen
-- 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?)
-- 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 or Create an account to join the conversation.
10 years 2 weeks ago #250272
by nicolas
Replied by nicolas on topic Time restricted access to check-out (or component)
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.
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 or Create an account to join the conversation.
10 years 2 weeks ago #250329
by cpaschen
Replied by cpaschen on topic Time restricted access to check-out (or component)
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?
Can I programattically (via cron) just change those hours on Monday and then reset them on Tuesday each week?
Please Log in or Create an account to join the conversation.
10 years 2 weeks ago #250331
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Time restricted access to check-out (or component)
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 | step" and add some PHP code to close the shop only on monday between 15:00 and 20:00.
Regards,
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 | step" and add some PHP code to close the shop only on monday between 15:00 and 20:00.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
10 years 2 weeks ago #250467
by cpaschen
Replied by cpaschen on topic Time restricted access to check-out (or component)
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.
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 or Create an account to join the conversation.
10 years 2 weeks ago #250481
by nicolas
Replied by nicolas on topic Time restricted access to check-out (or component)
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
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.
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
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 or Create an account to join the conversation.
10 years 2 weeks ago #250580
by cpaschen
Replied by cpaschen on topic Time restricted access to check-out (or component)
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']
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 or Create an account to join the conversation.
10 years 2 weeks ago #250581
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Time restricted access to check-out (or component)
Hi,
Sure you can !
Regards,
Sure you can !
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.221 seconds