- Posts: 50
- Thank you received: 3
Checkout business hours. Need to be closed Sunday.
- TerryHikashop
-
Topic Author
- Offline
-- HikaShop version -- : HikaShop Essential 2.3.0
-- Joomla version -- : 3.2.3
-- PHP version -- : 5.4.23
-- Browser(s) name and version -- : Internet Explorer 11.0.9600.16518
The business is closed on Sunday so therefore cannot accept online orders for pizzas that day of the week. In Configuration/Checkout - Business Hours, there is only Opens at and Closes at.
How do we prevent online orders on Sunday?
Also, business hours are different on Friday and Saturday.
Please Log in or Create an account to join the conversation.
The open/close hour system is coded in the view "checkout | step".
You can override the view in order to change the rules. So thanks to it you can refuse to checkout during Sunday.
You can also put different hours depending the current day.
Regards,
PS : No need to send me a private message. We answer to all question but the week end more than other days, please be patient. Like you we are trying to taking some rest during the week end
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
How do I set different hours for Friday/Saturday?
Please Log in or Create an account to join the conversation.
Please use the code that Nicolas gave you.
You just have to copy/paste it where he indicates you.
Doing such modifications requires some PHP/Development knowledge.
You need to detect the current day (using part of code that Nicolas gave you) and then change the open hour configuration depending this current day.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
At the beginning of the file "step" of the view "checkout" that you can edit via the menu Display>Views, you should add that code:
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
if(date('w')==1){$closed = true;}
and needs to be placed after the first instance of:
$closed=false;
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
if(date('w')==1 && date('G') <= 1 && date('G') >= 11){$closed = true;}
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
How to have store open Monday - Thursday: Noon - 9 p.m. and Friday - Saturday: Noon - 10 p.m.?
Please Log in or Create an account to join the conversation.
Replace
And replace
Please understand that we won't provide you more PHP code for that. It will become more than custom development than support.
If you want to go further, please look for a PHP developer.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
But where do you get the day of the week from?
The day of the week check in Hikashop is returning the value of UTC time which is different than my location and right now is Monday when it is actually 8 pm Sunday here, so my store opens back up, thinking it is Monday.
I tried replacing the 3 occurances of "time()" by "new JDate()" without success.
Please Log in or Create an account to join the conversation.
For example:
echo time(); //will return the UTC timestamp
echo (time()+3*60*60); //will return the UTC timestamp plus 3 hours (3*60*60 is the number of seconds in 3 hours).
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
Example:
In views/step I have the store set to close on Sunday.
In configuration I set the open and close time of 12 and 21. That is exactly when the store opens and closes on all other days.
However on Sunday at 20 hours, (8 pm Sunday here, USA Eastern time, with is midnight UTC because UTC is + 4 hours from here) my store opens back up, because it is thinking it is Monday?
Please Log in or Create an account to join the conversation.
It's probably that line:
if(date('w')==1 && date('G') <= 1 && date('G') >= 11){$closed = true;}
You probably need to adapt the conditions for the timezone difference.
Please understand that we're already way past normal support here... If you need to do advanced PHP modifications without any PHP knowledge, and that you don't want to read and understand the documentation of the date function that we gave you, please look for a third party developer to help you with the modifications you want.
Please Log in or Create an account to join the conversation.
- TerryHikashop
-
Topic Author
- Offline
- Posts: 50
- Thank you received: 3
The drop down selections in configuration are too limiting.
Please consider making the functionality I need as part of the baseline business software set in configuration drop down menus.
We should be able to have the store open when we want.
Please Log in or Create an account to join the conversation.