This is a discussion on Conditional formatting in header.php file within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi! I want to put some code in the header.php to do some conditional formatting based on Category. Is that ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi! I want to put some code in the header.php to do some conditional formatting based on Category. Is that possible... How can I do this: IF Category = "Ice Cream" then A IF Category = "Chili" then B IF Category = "Coffee" then C Else D I know a little php...but not sure how to check the category. Is that a URL string I should check?? Any help would be GREATLY appreciated!! |
|
#2
| |||
| |||
| The categories are passed along the URL with the name cPath, and the value is the same as the category id that's set in the database. You can do what you're trying to do like this: Code: if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
switch ($cPath) {
case "2" : // "Ice Cream" id
echo "Ice Cream HTML code here";
break;
case "3" : // "Chili" id
echo "Chili HTML code here";
break;
case "6" : // "Coffee" id
echo "Coffee HTML code here";
break;
}
} else {
echo "Default HTML code here";
}
|
|
#3
| |||
| |||
| THANK YOU, THANK YOU! I could not figure that out!! |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WYSIWYG Newsletter ignores Text formatting? | Nocturnaloner | osCMax v1.7 Discussion | 4 | 08-15-2006 02:30 PM |
| Conditional Attributes | davem | osCMax v1.7 Discussion | 0 | 07-18-2005 05:43 AM |
| Problem with the header.php file | emikey24 | osCMax v1.7 Discussion | 1 | 04-07-2005 02:43 PM |
| header / header.php top logo problem | the_error_king | osCommerce 2.2 Modification Help | 0 | 04-05-2004 05:02 PM |
| Need help with my header file.. | Irata | osCommerce 2.2 Installation Help | 2 | 08-17-2003 10:36 PM |