Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[contribution]Store Open/Closed Support Thread


15 replies to this topic

#1 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 11 June 2011, 22:00

This contribution allows you to set days and times your store is "open" and "closed".

If your store is not "open" it prevents customers from checking out.

Coded for 2.3.1 but easily adapted to 2.2 versions.

Link to contribution forthcoming.

If you post in this thread and get no response in a reasonable amount of time (say 24 hours), PM me.



Contribution link: Store Open/Closed

Edited by germ, 11 June 2011, 22:05.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#2 mirage101

  • Community Member
  • 36 posts
  • Real Name:Ivan Filipov

Posted 21 June 2011, 18:44

Can you give more specific instruction how to setup the hours in the code. I cannot change them to suit my needs.
P.S: Sorry I managed to find it :) Can you integrated this in future version in admin for better user control

Edited by mirage101, 21 June 2011, 18:46.


#3 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 21 June 2011, 20:41

Glad you found it.
:)

I suppose I could devise some type of Admin interface, but I really see nothing difficult about making edits to a simple text file.

I'll put it on my "to do" list.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#4 Paul King

  • Community Member
  • 7 posts

Posted 16 May 2012, 09:46

Hi

I am having 2 issues which I hope you can help with.

When I add the code to the application_top.php - it stops the whole website working, as soon as I remove this code it is ok again.

Also my opening times are 16:00 - 02:00 which shows by default store closed as the end is lower than the start. I haven't tried it yet due to the above issue but can I use.

sunday / 16:00:00 / 23:59:59
sunday / 00:00:00 / 02:00:00

or is there a better work around.

Thanks

#5 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 16 May 2012, 11:09

So your open time is split, 00:00 - 02:00 and 16:00 - 23:59
:unsure:

That's someting I honestly hadn't considered when I developed the contribution.

I'll probably have time to work on it this evening and recode it for this eventuality.

As far as the site not functioning after you add the code, you must be doing something wrong in the process.

Unless you can give me some error message I won't be able to help with that.

I know the code works if installed correctly. I have it on my WAMP server and on a UNIX platform on a Web server - no problems.

Edited by germ, 16 May 2012, 11:10.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#6 Paul King

  • Community Member
  • 7 posts

Posted 16 May 2012, 12:37

View Postgerm, on 16 May 2012, 11:09, said:

So your open time is split, 00:00 - 02:00 and 16:00 - 23:59
:unsure:

That's someting I honestly hadn't considered when I developed the contribution.

I'll probably have time to work on it this evening and recode it for this eventuality.

As far as the site not functioning after you add the code, you must be doing something wrong in the process.

Unless you can give me some error message I won't be able to help with that.

I know the code works if installed correctly. I have it on my WAMP server and on a UNIX platform on a Web server - no problems.

Thanks for swift response, I will try reinstalling, unfortunately it doesn't give a specific error, just fails to load the home page.

Our opening times are 16:00 - 02:00 Sun - Thurs and 16:00 - 04:00 Fri - Sat, so anything you can do to help would be appreciated.

Paul

#7 Paul King

  • Community Member
  • 7 posts

Posted 16 May 2012, 13:56

Just had a thought, could it be coded to show the closed time in the txt file and then use them to show the opening times, not sure if this will be easier.

On the other front it is working again now and it was caused by me trying to change the date to be d/m/Y

I changed - function day_dump( $format ) { to function day_dump( 'd/m/Y' ) { which is what I thought the instructions were telling me.

Sorry one last thing if we can get the times working ok and I can use the function, then could you help getting DST working for the UK.

#8 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 16 May 2012, 16:36

So how do you want DST calculated (when does it start/stop)?
:unsure:
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#9 Paul King

  • Community Member
  • 7 posts

Posted 16 May 2012, 18:23


British Summer Time runs between the last Sunday in March and the last Sunday in October. In March the UK clocks move Forward by 1 hour and in October they move Backwards or Fall by 1 hour. The UK comprises of (United Kingdom of Great Britain and Northern Ireland). Since 1996 all member states of the European Union change their clocks on the same date at 1am GMT.

2011 - Sunday March 28th 01:00 GMT until Sunday October 31st 01:00 GMT
2012 - Sunday March 25th 01:00 GMT until Sunday October 28th 01:00 GMT
2013 - Sunday March 31st 01:00 GMT until Sunday October 27th 01:00 GMT
2014 - Sunday March 30th 01:00 GMT until Sunday October 26th 01:00 GMT


#10 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 17 May 2012, 23:46

New updated contribution uploaded.

Added code for "British Summer Time" and "split" open/closed times.

Your Sunday in your daily.txt file should look like this:

sunday / 00:00:00 / 02:00:00 / 16:00:00 / 23:59:59
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#11 Paul King

  • Community Member
  • 7 posts

Posted 18 May 2012, 18:11

Excellent thanks for the support, just a small issue as you will see below with the message that comes back when closed.

Our store is currently closed.



The current store date is 05/18/2012



The current store time is 13:09:41



Our store hours are:




Sunday--------- 00:00:00 - 04:00:00
Sunday--------- 16:00:00 - 23:59:59
Monday--------- 00:00:00 - 02:00:00
Monday--------- 16:00:00 - 23:59:59
Tuesday-------- 00:00:00 - 02:00:00
Tuesday-------- 16:00:00 - 23:59:59
Wednesday------ 00:00:00 - 02:00:00




Days we are closed this year are:



#12 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 18 May 2012, 18:14

I knew it looked like that.

I suppose you don't like the fact Sunday is on two lines?
:unsure:

Edited by germ, 18 May 2012, 18:14.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#13 Paul King

  • Community Member
  • 7 posts

Posted 19 May 2012, 10:20

Yes - just doesn't look good and it also only displays 7 entries and so stops at Wednesday. Happy to have an static file with the opening times on personally but it may not suit others.

Appreciate your thoughts?

#14 germ

  • Community Member
  • 13,586 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 19 May 2012, 16:47

My thoughts???
:unsure:

I think I didn't pay close enough attention when I was debugging the code!!!
(w00t)

I did some code changes and a lot more extensive debugging and uploaded a new package.

The code is now "language compliant" (as far as I can tell with the english/spanish languages installed on my test platform) and it won't repeat the days on the "Store Closed" page if you have multiple open/closed times for a single day. And if you don't have any YEARLY_DAYS_FILE references to that are entirely omitted on the "Store Closed" page.

As far as your comment:

"Happy to have an static file with the opening times on personally but it may not suit others."

If that means you'd rather have an "admin interface" rather than data in text files, don't hold your breath.

The contribution has, shall we say, "limited application" ( I knew that when I wrote it ) so developing an interface in the admin really didn't seem like an effort that would reap a lot of benefits. I have other endeavors I'd rather devote the time to.

If you mean something else you'll have to elaborate.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#15 Paul King

  • Community Member
  • 7 posts

Posted 20 May 2012, 11:50

Thanks for the latest changes that looks fine. I wasn't looking for an admin panel, I was thinking along the line of actually editing the code to show a user changeable text output rather than the text output being worked out by the daily.txt.

I am confident to edit code that has been written just to tweak it a bit, but don't have the skills to do more than that, but what you have now done works fine for me so again many thanks for the great support.

#16 wlynn

  • Community Member
  • 1 posts
  • Real Name:lynn

Posted 24 May 2012, 06:18

i just wanted to say thank you so much for this contribution. very useful as we are a store delivers items and we don't take orders outside of our operation hours. exactly what i was looking for!!