Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

.Css by Categories ?


Gasse1014life

Recommended Posts

re all,

 

any one know how to create a cmd with the if / else tag to get a line like this;

 

if  $HTTP_GET_VARS['cPath']= index.php?cPath=30 {
blablablabla......
} else {
bloblobloblo.....
}

 

for the categories #30

 

(catalog/index.php?cPath=30 )

 

 

thank you very much

Link to comment
Share on other sites

Two issues,

 

1)make sure '$HTTP_GET_VARS['cPath']= index.php?cPat' is the correct OSCommerce format for a cat path

 

2)You have a couple of php syntax errors

it should be like this

 

if ($HTTP_GET_VARS['cPath']= index.php?cPath==30) {
blablablabla......
} else {
bloblobloblo.....
}

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

i have found an easy way to get only wanted categories linked to another .css

 

in included/template_top.php

 

replace line #48

 

<link rel="stylesheet" type="text/css" href="stylesheet30.css" />

 

 

with

 

 

<link rel="stylesheet" type="text/css" href=" <?php
$filename = 'stylesheet' . $_GET['cPath'] . '.css';

if (file_exists($filename)) {
   echo $filename;
} else {
   echo "stylesheet.css";
}
?> " />

 

 

 

this is the only thing you have to modif.

 

if you want to change .css to categories # 45 by example, only add a stylesheet45.css in same directory as stylesheet.css (/catalog)

 

if not catalog will use original stylesheet.

 

thank you for your help.

Link to comment
Share on other sites

Hi all ,

 

a lil question...

 

 

any 1 know why where i put this code,

 

  <?php

   if ((int)$HTTP_GET_VARS['cPath']=='30'){
echo ''; 
}else{ 

echo include(DIR_WS_MODULES . FILENAME_SUB_CAT_IND); }
 ;
?>

 

a lil 1 appear.

 

*** FILENAME_SUB_CAT_IND are a blank page

 

 

 

 

 

lil1.png

Link to comment
Share on other sites

try it like it this:

 

<?php

   if ((int)$HTTP_GET_VARS['cPath']=='30'){
       echo ''; 
     }else{ 
    echo include(DIR_WS_MODULES . FILENAME_SUB_CAT_IND);
    }
?>

 

maybe that extra ; is the issue.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...