Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Php help - selecting a single category_id


Guest

Recommended Posts

I'm making my first real store using oscommerce - however like always i'm very picky when it comes to details. Problem is i want different banners to be shown depending on which category is chosen.

 

I'm not sure that the way i came up with is the easiest but its atleast the one most obvious to me:

 

i figured i need some .php code telling something like: if category_id=21 response write blabla

 

else..

 

question is how do i do that in .php ?

 

This is the code i'm looking at:

 

<?php

if ($category_depth == 'nested') {

$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

?>

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td>

I think its around here i need something telling it to show a different banner group if id = xx

 

 

<?php

if ($banner = tep_banner_exists('dynamic', '440x100-al')) {

?>

 

<?php echo tep_display_banner('static', $banner); ?>

 

 

 

<?php

}

 

 

(yeah i know i'm a .php n00b) - anyways hope it makes a little senses and someone can help me!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...