Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

IF "mainpage" THEN


wex

Recommended Posts

Hello fellow OSC users,

 

Im in the middle of designing/upgrading my OSC store.

 

One of the new features is a different structure on the front page.

 

My question? How do i make it determine if your on the frontpage.

 

I tried using:

 

<?php if ( ($cPath == '') && ($products_id == '') ) {  echo "CONTENT ON THE FRONTPAGE HERE";} ?>

 

It worked great, but since Manafactures page dosent use a cPath, it shows on that page too, and i might even popup on more pages.

 

So anyone got an solid solution?

Link to comment
Share on other sites

Hello fellow OSC users,

 

Im in the middle of designing/upgrading my OSC store.

 

One of the new features is a different structure on the front page.

 

My question? How do i make it determine if your on the frontpage.

 

I tried using:

 

<?php if ( ($cPath == '') && ($products_id == '') ) {  echo "CONTENT ON THE FRONTPAGE HERE";} ?>

 

It worked great, but since Manafactures page dosent use a cPath, it shows on that page too, and i might even popup on more pages.

 

So anyone got an solid solution?

 

Try this ..

 

<?php
// Mod to show mainpage when index.php and  $_GET['cPath'] / $_GET['manufacturers_id'] are not set
$fwr_mainpage = ( str_replace('/', '', $_SERVER['SCRIPT_NAME']) == FILENAME_DEFAULT && !isset($_GET['cPath']) && !isset($_GET['manufacturers_id']) ? true : false );
		  if ($fwr_mainpage) echo 'CONTENT ON THE FRONTPAGE HERE';
unset($fwr_mainpage);
// End mainpage mod
?>

Link to comment
Share on other sites

Although why you need it I can't imagine, index.php does this as standard ..

 

} else { // default page

Link to comment
Share on other sites

Let's KISS:

 

  if($category_depth == 'top') {
// do stuff!
 }

Richard

 

KISS = Keep It Simple Sucker

 

Like most simple things in life it doesn't happen to work :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...