osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Conditional formatting in header.php file

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 08-03-2004, 06:11 AM
Member
 
Join Date: Apr 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
ReginaStelling
Default Conditional formatting in header.php file

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!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 08-03-2004, 07:16 AM
New Member
 
Join Date: Jul 2004
Location: a mountaintop in Florida
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gravenimage
Default

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";
    }
As always, back up your file first
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 08-03-2004, 11:08 AM
Member
 
Join Date: Apr 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
ReginaStelling
Default

THANK YOU, THANK YOU! I could not figure that out!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 07:06 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax