Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

little help with coding please


hatimad

Recommended Posts

Hello All,

 

i am using this code to get the sub category list

 

<?php

$query1 = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '1' and  c.categories_id = cd.categories_id";

 if ($status >0)

 $query1.= " and c.status = '1'";

 $query1.= " and cd.language_id='" . $languages_id ."'order by sort_order, cd.categories_name";

 $categories1_query = tep_db_query($query1);

 $categories1 = tep_db_fetch_array($categories1_query);

 $subcategories1_query = tep_db_query($query1);

echo '<table>';

echo '<tr>';

echo '<td class="newfootercontent" valign="top">';

$i=0;   



 while ($subcategories1 = tep_db_fetch_array($subcategories1_query)) {

    $cPath_new_sub1 = tep_get_path($categories1['categories_id']) . "_" . $subcategories1['categories_id'];

    echo '?<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub1, 'NONSSL') . '">' . $subcategories1['categories_name'] . '</a><br>' . " ";

if ($i=='3'){

echo '</td><td class="newfootercontent" valign="top">';

$i=0;

} else {

$i++;

}

}

echo '</td></tr></table>';

?>

 

and i am able to retrive the list and also display it, but, the problem is some where in the line

$cPath_new_sub1 = tep_get_path($categories1['categories_id']) . "_" . $subcategories1['categories_id'];

    echo '?<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub1, 'NONSSL') . '">' . $subcategories1['categories_name'] . '</a><br>' . " ";

 

insted of giving me new subcategory path, it gives me path attached to first sub-category

 

let me try to explain a bit better

 

when i click on the link of subcategory generated by above code, insted of giving me nomal link it gives me link attached with first sub category

 

insted of

default.php/cPath/1_17

default.php/cPath/2_34

etc.

 

it gives me

default.php/cPath/1_17_17

default.php/cPath/2_34_35

etc.

 

and accordingly breadcrum gives me wierd outputs

 

am i making any sens?

 

can anyone help me with this??

 

if you would like to check on my website i can send URL maybe that will explain it better

 

thank you

 

i am almost done with the modification this is the only thing needs to be resolved :cry:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...