Zen Cart Logo
Forums / General Questions / Contact_us redirects to home page

Contact_us redirects to home page

Views: 1,386

Results 21 to 24 of 24
24 Dec 2015, 3:01 AM
#21
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Contact_us redirects to home page

If not do you think my only options would be to modify the code or create a custom contact form as a new page?
Yes and it should announce that the site is down for maintenance first

29 Dec 2015, 12:30 AM
#22
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,962
Plugin Contributions:
8

Re: Contact_us redirects to home page

SOLVED!!!!

first off, i think this board is great when people try to help other users with their problems. i think it is not nearly as great when we question other people's business practices.

i think this code is NOT a bug as it works as intended. the ZC coders do NOT want customers to get to the down for maintenance page if the site is up. pretty simple. whether you agree with that coding choice is a different story; for me i see no problem in the logic behind it.

so if the site is up and you set the down for maintenance page to contact_us, you can not get to the contact us page. which is the exact behavior the OP, badarac, saw. in addition, you can see the code where this happens in .../includes/init_includes/init_customer_auth.php

/**
 * do not let people get to down for maintenance page if not turned on unless is admin in IP list
 */
if (DOWN_FOR_MAINTENANCE=='false' and $_GET['main_page'] == DOWN_FOR_MAINTENANCE_FILENAME && !strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])){
  zen_redirect(zen_href_link(FILENAME_DEFAULT));
}

so if your site is up, you can NOT get to the page set in down for maintenance. if the site is down for maintenance, you can set the page to whatever page you would like and get there.

hope that helps.

29 Dec 2015, 9:15 AM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Contact_us redirects to home page

badarac:

The short answer is that's what the client wanted. So what you're saying is that that field in the admin is intended to send to a custom page not by default installed with zencart. Will replacing the file contents for down for maintenance with contact us work? If not do you think my only options would be to modify the code or create a custom contact form as a new page?

badarac:

So what you're saying is that that field in the admin is intended to send to a custom page not by default installed with zencart.
I'd actually phrase it as, a page that is only to be available when the site is down for maintenance. Relatively literal to the name of the page...

badarac:

Will replacing the file contents for down for maintenance with contact us work? If not do you think my only options would be to modify the code or create a custom contact form as a new page?

Yes and no to some of this. Straight copying of the contact_us code will ultimately result in a similar problem upon submission of the contact_us form... (See the zen_draw_form code on the tpl_contact_us_default.php page.... But, if things were modified just enough so that a new page was created with all of the "goodies" then the client can have a contact us type page when down for maintenance and the standard one for normal service... You may want to create a separate define file (like define_contact_us) so that the unique text for that condition is present... Just remember that when creating such html_includes files that a copy of the file must exist in the main html_includes directory to recognize the version in the overrides folder. At least that was the case up to 1.5.4... Haven't looked at how 1.5.5 handles that.

29 Dec 2015, 4:02 PM
#24
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,962
Plugin Contributions:
8

Re: Contact_us redirects to home page

alternatively you could comment out the redirect line in the ../includes/init_includes/init_customer_auth.php file; then add the if statement from that same file to the tpl_contact_us_default.php script with a bit of text about the site currently being down for maintenance, and to use the form below to contact us.

while i have not tested that idea, i'm pretty confident that would work.