Post by jules_nz » Tue Jan 26, 2010 7:47 am

Hi

I need to change the default home page of my shop

There is only the one product, so I want to skip all the welcome and category pages and just have go straight into the product page.

This should also be the default page that any continue button points too

I tried changing the code on the index.php page but just keep getting a page not found error

Code: Select all

// Router
if (isset($request->get['route'])) {
	$action = new Action($request->get['route']);
} else {
	$action = new Action('common/home');
}
Does any one know what I need to do to change this?

Thanks in advance
Julie

Active Member

Posts

Joined
Tue Aug 11, 2009 12:58 pm

Post by Qphoria » Tue Jan 26, 2010 9:12 am

Code: Select all

// Router
if (isset($request->get['route']) && $request->get['route'] != 'common/home') {
   $action = new Action($request->get['route']);
} else {
   $action = new Action('product/product&product_id=48');
}

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SapporoGuy » Mon Nov 22, 2010 10:24 pm

hmmm, this could be interesting.
Put a checkbox setting on a product, then have it called using a variable and then use the variable instead of hardcoding it.

hmmmm, better than a featured box ... ???

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by grelle » Fri Jan 21, 2011 3:17 am

This does not work in the latest version ? At least I have tried it and it returns "The page you requested cannot be found!"

I would like to show a specific product as startpage (just going to sell one product).

Newbie

Posts

Joined
Fri Jan 21, 2011 3:15 am

Post by jcd » Tue May 31, 2011 11:56 am

This seemed to work:

catalog/controller/home.php
Delete contents of file and replace with:

<?php

header( 'Location: index.php?route=cms/category&path=15' ) ;

?>

or whatever..

"If it can't be fixed with a sledgehammer then it can't be fixed"


jcd
Newbie

Posts

Joined
Tue May 03, 2011 9:43 pm

Post by nickey » Wed Jun 22, 2011 8:54 pm

jcd wrote:This seemed to work:

catalog/controller/home.php
Delete contents of file and replace with:

<?php

header( 'Location: index.php?route=cms/category&path=15' ) ;

?>

or whatever..
This will create problems such as not staying on the same page when the language or the currency change and more.
The idea is correct but the file that should be changed is
/catalog/view/theme/default/template/common/home.tpl
In this file simply remove everything and write:
<?php
header( 'Location: index.php?route=product/category&path=59' ) ;
?>
(or whatever page you want your home page to be.)
This will affect all the references to this page (site logo, default homepage, etc)

Newbie

Posts

Joined
Wed Jun 22, 2011 8:46 pm
Who is online

Users browsing this forum: No registered users and 16 guests