Forums / General Questions / Question in the Categories in admin area...

Question in the Categories in admin area...

Locked

Views: 562

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
8 Dec 2009, 8:27 PM
#1
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Question in the Categories in admin area...

I have a question....

In the admin area when you have your product listings in the categories when you add your products to the store is there a way you can put in the manufaturer listed. like for an example:

ID..... Categories/Products........ and your "Manufacturer goes here.... Model#........ and so forth. Is that possible to do?

11 Dec 2009, 4:12 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Question in the Categories in admin area...

You need to do a couple changes for this ...

Edit the file:
/admin//includes/modules/category_product_listing.php

and change the line:

<td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_MANUFACTURERS; ?></td>

to add:

                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_MANUFACTURERS_NAME; ?></td>

Then change the line:

                <td class="dataTableContent"><?php echo $products->fields['products_model']; ?></td>

to add:

                <td class="dataTableContent"><?php echo zen_get_products_manufacturers_name($products->fields['products_id']); ?></td>
                <td class="dataTableContent"><?php echo $products->fields['products_model']; ?></td>

Then you need to add a new function ...

Create a new file:
/admin/includes/functions/extra_functions/extra_functions.php

NOTE: you can call the file anything you want ...

<?php
// my extra functions

/*
 * Return a product's manufacturer's name, from ID
 * TABLES: products, manufacturers
 */
  function zen_get_products_manufacturers_name($product_id) {
    global $db;

    $product_query = "select m.manufacturers_name
                      from " . TABLE_PRODUCTS . " p, " .
                            TABLE_MANUFACTURERS . " m
                      where p.products_id = '" . (int)$product_id . "'
                      and p.manufacturers_id = m.manufacturers_id";

    $product =$db->Execute($product_query);

    return ($product->RecordCount() > 0) ? $product->fields['manufacturers_name'] : "";
  }


?>

Then create the file:
/admin/includes/languages/english/extra_definitions/extra_definitions.php

<?php
  define('TABLE_HEADING_MANUFACTURERS_NAME', 'Manufactuer');
?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!