Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default A different page for the homepage... :P

    Is it possible to setup Zen Cart to display a different page (instead of index.php) as the main homepage?

    The reason for this is simple, one of my clients has asked me to setup Zen Cart so it displays a different page (index.php?main_page=welcome) when people first load up the site. Then when they click on 'Online Shop' they are taken to index.php.

    However, when people load the website they are taken directly to index.php and not index.php?main_page=welcome.

    Is there a way I can change this? Maybe htaccess or some nifty php code?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: A different page for the homepage... :P

    /includes/init_includes/init_sanitize.php
    line 115 says:
    Code:
      if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';
    Change $_GET['main_page'] = 'index' to $_GET['main_page'] = 'welcome';
    ... and save it to the overrides folder
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: A different page for the homepage... :P

    Thanks for the speedy reply! :)

    I've just tried what you said and it worked. However, I am then unable to browse to index.php (which I really need to do).

    Is there another solution that you know of?

    Thanks for the help so far!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: A different page for the homepage... :P

    http://www.your_site.com/ will go to welcome
    http://www.your_site.com/index.php will go to your regular index.php

    It's all in how you write your URLs
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: A different page for the homepage... :P

    Just tested this out again and it doesn't appear to work. :|

    I've changed the code (like you advised), but I still have the same problem of www.mysite.com/index.php displaying my 'welcome' page.

    However, I'm going to work around this by linking to my index page like so...

    Code:
    index.php?main_page=index
    Hope that's right... it seems to work this end! :)

    Thanks again for the help.

  6. #6
    Join Date
    Jun 2005
    Location
    Cheney WA
    Posts
    1,134
    Plugin Contributions
    0

    Default Re: A different page for the homepage... :P

    Another alternative:

    go to www.mysite.com/index.php

    View source in ie, or view generated source if you're using firefox.

    Save the source as index.html.

    Now put that file at the same level as your index.php page.

    Now you can edit index.html to show whatever content you want. The links are still php.

    If you want to, you can also save every category page as html in the same manor and then change the category links to go to the html pages. It's best to save them in a seperat folder at first, ie: /public_html/htmlpages/ that way when it's time to chang the link, you can do a find and replace on that folder. Once you've changed them, move them to the /public_html/ folder and walla you have an html representation of your website, which is all seo friendly and can be changed independantly of your sites pages.

    However keep in mind that once the customer gets to the product level they are back in the php site, and the php links will keep them there. So they will see the other pages after they reach the product level. so keep them maintained as well.

    Kind of a double maintance job if you know what I mean.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: A different page for the homepage... :P

    John's suggestion is one that will work in many hosting configurations, but, as he mentioned, it's a double-maintenance issue.

    Reformatting the URL is the key to making the low-maintenance method I mentioned earlier work -- adding main_page=index is correct.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: A different page for the homepage... :P

    Excellent. Thanks for clearing this up! :)

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: A different page for the homepage... :P

    Another possible solution: build the home page however you want, and put the shop in a subdirectory. On the home page, simply have a link to the shop (in the subdirectory). Some folks use this approach, esp. if their site already has a lot of content and the cart came later.

    Good luck,
    Scott
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. v151 Display a different homepage when changing the currency
    By Michy in forum General Questions
    Replies: 0
    Last Post: 27 May 2013, 11:19 AM
  2. Need to set the quantity for different sizes on one page?
    By redrob in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jun 2012, 10:39 AM
  3. Replies: 2
    Last Post: 27 Oct 2010, 01:45 PM
  4. Apply a different image background for the home page only?
    By arniesbarmyarmy in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Nov 2009, 07:36 PM
  5. Different 'Product info page' layouts for different products
    By DML73 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Aug 2009, 02:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR