Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add sub categories to product_info


Guest

Recommended Posts

Hi all.

 

I have several categories with several sub categories.

for example one of the categories is: DVD and is sub categories are: Action; Comedy and so on...

Many movies are action and comedy movies... I would like that in the product_info page, the subcategories of that particullary movie to be displayed (as link or not :) ). Is that possible???

it has been 2 days searching and getting nowhere!!! :(

 

Could please someone help me... I've searched the contribuitions but I don't know if it's lack of sleep, but didn't find any.

 

Thank you in advanced. :)

Link to comment
Share on other sites

Hi all.

 

I have several categories with several sub categories.

for example one of the categories is: DVD and is sub categories are: Action; Comedy and so on...

Many movies are action and comedy movies... I would like that in the product_info page, the subcategories of that particullary movie to be displayed (as link or not :) ). Is that possible???

it has been 2 days searching and getting nowhere!!! :(

 

Could please someone help me... I've searched the contribuitions but I don't know if it's lack of sleep, but didn't find any.

 

Thank you in advanced. :)

You mean like the breadcrumb trail above the product itself? You want it repeated in the product information again?

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

No. What I was thinking is for example under the product description something like:

 

Description

bla bla bla...

 

Action, Comedy, Drama (the sub caterogories that the product is linked to).

 

The breadcrumb trail only shows one of the sub categories that the product is linked.

 

I don't know if is understandable what i'm asking for... I've seen it on one dvd store, but don't recall where :(

Link to comment
Share on other sites

No. What I was thinking is for example under the product description something like:

 

Description

bla bla bla...

 

Action, Comedy, Drama (the sub caterogories that the product is linked to).

 

The breadcrumb trail only shows one of the sub categories that the product is linked.

 

I don't know if is understandable what i'm asking for... I've seen it on one dvd store, but don't recall where :(

Ok, I see. A movie is linked to multiple categories and you want to display the other categories....

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

Exactly. Is that possible? could you help me? Thank you

Yeah, it is, but it will take a while. Maybe someone will know of an add on that does this already and post.

 

When a product is linked to another category a new entry with the same product_id is written into the products_to_categories table with the same product_id. It is just a matter of querying the db and look for additional instances of the current product_id.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

This is crude and not tep compliant, and doesn't provide the entire category path, just the final sub-cat. Maybe someone will edit this for you with those features... If someone is kind enough to do that I'll package it up into a contribution.

 

<!-- add in for products linked to multiple categories -->
     <tr>
      <td align=center class="main">
        <BR><BR>
        <?php
        // set product_id
        $mlp_pid = $product_info['products_id'];
        $mlp_check = array();
        // see if it is linked to multiple categories
        $mlp_check_query = mysql_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $mlp_pid . "'");
        echo "This product appears in the following categories:<BR><BR>";
        while ($mlp_check = mysql_fetch_array($mlp_check_query)) {
           // looping through each category
           $mlp_categories_query = mysql_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $mlp_check['categories_id'] . "' limit 1");
           $mlp_category_name = mysql_fetch_array($mlp_categories_query);
           echo "<a href=\"index.php?cPath=" . $mlp_check['categories_id'] . "\">" . $mlp_category_name['categories_name'] . "</a><BR>";
        }
        ?>
      </td>
     </tr>
<!-- end add in for products linked to multiple categories -->

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...