Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Store Mode (Open | Closed | Maintenance)


olsonsp4c

Recommended Posts

you must not have inserted the "store_mode.sql" into your database... that's my guess.

 

Scott

 

 

I am jumping in here!

 

I am looking to install this contribution and had a question about inserting the "store_mode.sql"

How is that done? I am going to my site control panel and phpAdmin but not sure how to 'run' this as directed in the installation text. Sorry, completely new at this but willing to learn.. Thanks!

Link to comment
Share on other sites

I am jumping in here!

 

I am looking to install this contribution and had a question about inserting the "store_mode.sql"

How is that done? I am going to my site control panel and phpAdmin but not sure how to 'run' this as directed in the installation text. Sorry, completely new at this but willing to learn.. Thanks!

 

in phpMyAdmin, click the "SQL" icon (Query Window)

Click the "Import files" tab

Click the "Browse" button

Find the file

Click the "Go" button

 

You should see a dialogue that tells you if the insert was successful or if there were errors.

 

Scott

Link to comment
Share on other sites

  • 2 weeks later...
in phpMyAdmin, click the "SQL" icon (Query Window)

Click the "Import files" tab

Click the "Browse" button

Find the file

Click the "Go" button

 

You should see a dialogue that tells you if the insert was successful or if there were errors.

 

Scott

 

 

Wonderful! I just got back to this today and had no problems following your directions. Thanks for a great and easy to use contribution!

Link to comment
Share on other sites

Hi Scott. I really appreciate this well written contribution and it works great!

 

The 'checkout' button is correctly disabled when store is closed, however underneath the 'checkout' button, i also have 'googlecheckout' button which needs to be disabled or redirected also. Google checkout is not listed in checkout_shipping.php like all the other payment methods. Please may i put in a request for you to look into this.....

 

In catalog/shopping_cart.php, i have the following code:

 

<?php

// *** BEGIN GOOGLE CHECKOUT ***

if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') { include_once('googlecheckout/gcheckout.php');

}

// *** END GOOGLE CHECKOUT ***?>

<form></td>

</tr>

 

I am using Google Checkout v1.5 rc1 (taken from google website) Please let me know if you need any other information

 

Many thanks

 

May

Link to comment
Share on other sites

you should just add the if statement around it, something like this:

 

 

<?php
// *** BEGIN GOOGLE CHECKOUT ***
if (STORE_MODE != 'Closed') {
 if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') {
include_once('googlecheckout/gcheckout.php');
 }
}
// *** END GOOGLE CHECKOUT ***?>

 

Scott

Edited by olsonsp4c
Link to comment
Share on other sites

I just download and followed all instructions except the step 1. My index.php does not contain the information below. Where should I put this information if I cannot locate it? I was able to locate the codes in all the other steps. Am I missing something here?

 

**********

* STEP 1 *

**********

 

in catalog/index.php

 

Find this:

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

Link to comment
Share on other sites

you should just add the if statement around it, something like this:

 

 

<?php
// *** BEGIN GOOGLE CHECKOUT ***
if (STORE_MODE != 'Closed') {
 if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') {
include_once('googlecheckout/gcheckout.php');
 }
}
// *** END GOOGLE CHECKOUT ***?>

 

Scott

 

 

Works perfectly! Thank you for your swift help!

 

May

Edited by Mayaka
Link to comment
Share on other sites

I just download and followed all instructions except the step 1. My index.php does not contain the information below. Where should I put this information if I cannot locate it? I was able to locate the codes in all the other steps. Am I missing something here?

 

**********

* STEP 1 *

**********

 

in catalog/index.php

 

Find this:

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

 

It means that you are not using osCommerce rc2a or earlier OR you have such a modified store that the base code is no longer recognizable. If the second case is true, you should hire a coder to do it for you.

 

Scott

Link to comment
Share on other sites

Thanks for the information Scott. Can I just not put the code somewhere on the index page? What purpose does that part of the code serve?

 

You can put it wherever you want - all it does is show a message saying that your store is closed and when it will re-open.

 

Scott

Link to comment
Share on other sites

  • 2 weeks later...

I downloaded and follow the instructions 2 times -

 

But when I log to the admin are I do not see anything about STORE MODE...

 

I click through every link in the admin area - no store mode...

 

??

 

Anyone - I am reading about a SQL thing in the forum but the DOWNLOAD as of April 30, 2009 did not have a sql or any instructions about it??

 

Thanks

Link to comment
Share on other sites

I downloaded and follow the instructions 2 times -

 

But when I log to the admin are I do not see anything about STORE MODE...

 

I click through every link in the admin area - no store mode...

 

??

 

Anyone - I am reading about a SQL thing in the forum but the DOWNLOAD as of April 30, 2009 did not have a sql or any instructions about it??

 

Thanks

 

Please do not make such statements without carefully reading through the instructions. You are incorrect. I have copied the instructions from the txt file:

 

********************
* PRE-installation *
********************

1. BACKUP your database and all files to be modified by this addon (I'm serious; you'll be glad you did)
2. RUN store_mode.sql (update your osC database) using phpMyAdmin or comparable mySQL control panel software
3. UPLOAD the files in the new_files directory to their appropriate osC paths

 

Scott

Link to comment
Share on other sites

  • 3 weeks later...

I have a problem with this contribution. When I access to www.mysite.com/admin/index_maintenance.php found the next error:

 

Fatal error: Call to a member function add() on a non-object in /home/mysite/domains/domain/public_html/admin/index_maintenance.php on line 31

 

 

Can you help me please?

 

Thanks a lot

Link to comment
Share on other sites

  • 1 month later...

I need to start from scratch with store mode as i am currently having problems with adding items to my cart.

I backed up the database but have never had much luck restoring it and have never really had to, is there a find and replace i can do on the SQL file which will go through and remove the store mode sql additions?

 

Regards

Dan

Link to comment
Share on other sites

  • 3 weeks later...
This is the support forum for the addon Store Mode (Open | Closed | Maintenance): http://addons.oscommerce.com/info/6332

 

Scott, I have installed this contribution and all is working well. Viewable http://ba.barkavenuedogboutique.com/ in the closed mode,....(through 20 July 09 anyway).

 

Thank you much for your work.

 

SK

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

  • 1 month later...

Hi Scott,

 

Thanks for this great contrib. It works very well.

 

I have a suggestion for adding a function to it. When I was on vacation I wanted to tell my customers

that the store was open but we were on vacation. The thing I needed was like an index_information.php

instead of index_maintenance.php. I just want to inform my customers with a splashpage that they will be

able to place their order but we cant ship it until we're back from vacation. Just add some text and dates

when shipping will start again and a closebutton that takes the customer to the store again.

 

What do You think about that?

 

Br,

 

Clas

Link to comment
Share on other sites

Scott,

 

I have installed the modified code and have run the SQL but I cannot see the option for store mode on the admin page. When I try to access the php file I get this warning:

 

Warning: main(includes/languages/english/index_maintenance.php) [function.main]: failed to open stream: No such file or directory in /blablabla/oscommerce/catalog/admin/index_maintenance.php on line 12

 

Fatal error: main() [function.require]: Failed opening required 'includes/languages/english/index_maintenance.php' (include_path='.:/usr/lib/php') in /blablabla/oscommerce/catalog/admin/index_maintenance.php on line 12

 

What am I doing wrong here, your directions are very straightforward I just can't seem to get this to work.

 

Josh

Link to comment
Share on other sites

The server is telling you that you failed to upload /admin/includes/languages/english/index_maintenance.php

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 >

Link to comment
Share on other sites

  • 2 weeks later...

Great contribution Scott! Very well written. :) And very easy to install and get going.

 

One (Probably dumb) question though - Does the contribution automatically put the store into a given mode at the dates/times defined in 'Store Offline' and 'Store Online' dates/times?

 

Thanks in advance,

 

Dwane.

Link to comment
Share on other sites

  • 3 weeks later...

Hey Scott,

Thanks for a great contribution. Works as advertised. Very well written, and easy to install. Everything tested fine. I did take a couple of lines of code and added them to the catalog\contact_us and the catalog\includes\languages\english\contact_us files so the "store_name strives to respond to all inquiries within 24 hrs" will be visible on the contact_us form during normal operation. Also, thanks for the reCaptcha contribution which was also great.

 

Thanks again,

 

Kuai

Link to comment
Share on other sites

on maintance store mode, when the users try to get into the site, the script takes him automatically to index_maintenance.php? Because i moved my shop on new domain with new cart script, and i am looking for a way when a customer get into my oscommerce site, to see a message and automatically redict him to my new shop. So if that script on the maintance mod moves the customer to index_maintenance.php (no matter on which product / url the customer trys to open) it could be good, coz i can add the code for redirection to this file..

I am Maintaining :

Product_Short_Description (i added it on specials.php and in shopping_cart.php)

City Shipping Rates With Admin (fixed the error that was giving wrong total shipping charges)

I had Created :

UTF bug fix on standard reviews system (admin & block)

Corrupted character on mysql with utf-8

Link to comment
Share on other sites

  • 2 weeks later...

Hey Scott great contribution!

 

I have been using it for a couple of months now, but now need a modification to the contributions Maintenance Page. I need the Store mode to be able to redirect customers to a specific url.

 

When store mode is set to maintenance it redirects customers to www.domain.com/catalog/index_maintenance.php, but I would like to be able to redirect customers to www.domain2.com/store/index.php. I'm not to sure if this is possible, but if it is I would greatly appreciate the help.

Edited by helpme:(
Link to comment
Share on other sites

  • 3 weeks later...

hi I am having trouble with this module in that the email doesnt get sent although it says it has.

 

we certainly dont recieve an email.

 

heres the code

 

 

<?php
/*
 index_maintenance.php 11/18/2008
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . MAINTENANCE_FILENAME);

 $error = false;
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
   $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
   $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
   $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

   if (tep_validate_email($email_address)) {
     tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, SEND_NAME . $name . "\r\n" . SEND_EMAIL . $email_address . "\r\n\r\n" . $enquiry, $name, $email_address);

     $messageStack->add('maintenance', EMAIL_SUCCESS, 'success');
   } else {
     $error = true;

     $messageStack->add('maintenance', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
   }
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(MAINTENANCE_FILENAME));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php
// BOF: Store Mode
// Hide header if not to show
if (HEADER_OFF == 'false') {
?>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<?php
}
// EOF: Store Mode
?>
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<?php
// BOF: Store Mode
// Hide column_left.php if not to show
if (COLUMN_LEFT_OFF == 'false') {
?>
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
<?php
}
// EOF: Store Mode
?>
   </table></td>

<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('maintenance', tep_href_link(MAINTENANCE_FILENAME, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if ($messageStack->size('maintenance') > 0) {
?>
     <tr>
       <td><?php echo $messageStack->output('maintenance'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo MAINTENANCE_TEXT . tep_date_long(ONLINE_DATE_TIME) ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo MAINTENANCE_TEXT2 ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><?php echo ENTRY_NAME; ?></td>
			<td class="main" rowspan="6" align="center" valign="middle"><?php echo MAINTENANCE_TEXT3 ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo tep_draw_input_field('name'); ?></td>
             </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
             <tr>
               <td class="main"><?php echo ENTRY_EMAIL; ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
             </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
             <tr>
               <td class="main" colspan="2"><?php echo ENTRY_ENQUIRY; ?></td>
             </tr>
             <tr>
               <td class="main" colspan="2"><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<?php
// BOF: Store Mode
// Hide column_right.php if not to show
if (COLUMN_RIGHT_OFF == 'false') {
?>
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
<?php
}
// EOF: Store Mode
?>
   </table></td>
 </tr>
</table>
<!-- body_eof //-->
<?php
// BOF: Store Mode
// Hide footer.php if not to show
if (FOOTER_OFF == 'false') {
?>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<?php
}
// EOF: Store Mode
?>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

Can you help get this to work or pioint me to what I need to look at to get this ressolved.

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

  • 2 weeks later...

Very, very well written contribution. Excellent instructions whether you are upgrading or installing from new, with a huge amount of care and thought gone into what is needed. Great stuff, Scott. Very much appreciated here.

Link to comment
Share on other sites

  • 1 month later...

I've chosen this contribution over the other ones for 'store closed' type contributions due to the added maintenance option, yet I seem to have encountered a problem.

 

When I put the store into a 'Closed' status, rather than getting the message advising that the store is closed, my page displays the following:

 

CLOSED_MESSAGEDate and Time

 

Now, here is the PHP code from the index.php file

 

<?php
// BOF: Store Mode  -  CRC
 if (STORE_MODE == 'Closed') {
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="storeClosed" align="center"><?php echo CLOSED_MESSAGE . ONLINE_DATE_TIME ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
// EOF: Store Mode
?>

 

Please, if someone could help me with this, I'd be most grateful.

 

Naloomi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...