Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Question about subcategories and $cPath


oki.tu

Recommended Posts

Posted

I'm working with the product_listing.php and got a problem with a custom query.

 

I use the coolmenu.php with up to 5 subcategories in the tablesystem.

 

The $cPath can therefore look like: "46_245_513_623"

 

I need the last part of the categories_id-string, to use it with the "tep_get_subcategories"-function. This would be 623 in the example string.

 

Here is what i tried to use to split it out:

 

  $subcategories_array = array();
 $subcategories_parent_id = split("_", $cPath);

 $count = sizeof($subcategories_parent_id);

 if($count > 1){
 $subcategories_parent_id = $subcategories_parent_id[$count];
 }else{
 $subcategories_parent_id = $cPath;
 }

 

 

I cant find any parse errors but anyway this returns "46_245_513_623" for $subcategories_parent_id.

 

Why hasnt it be splitted?

 

Can anyone help me with this?

 

 

Im german, sorry for bad english

Archived

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

×
×
  • Create New...