Jump to content
germ

[contribution]Store Open/Closed Support Thread

Recommended Posts

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

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

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

I knew it looked like that.

 

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

:unsure:

Edited by germ

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

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

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

 

SSL Implementation Help

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!!

Share this post


Link to post
Share on other sites

i would use this one... and yes when store is closed it could be nice to just point to a static HTML page lets call it store_closed.html

 

so when store is closed just call that file and when open open index.php like normal


Quo plus habent, eo plus cupiunt

Share this post


Link to post
Share on other sites

Hi germ,
I try to use it with osCommerce 2.2-MS2.
And at the moment it dos not work.

Can you please give me a hit?
Regards

Share this post


Link to post
Share on other sites

I think in 2.2 dosn't exist 'template_top.php' and 'template_bottom.php'.

What du I have to change in the Code for 2.2-MS2?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×