Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Packing Slip - Adding Manufacturer

Packing Slip - Adding Manufacturer

Locked

Views: 1,399

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Dec 2006, 11:09 AM
#1
pip avatar

pip

New Zenner

Join Date:
Dec 2006
Posts:
1
Plugin Contributions:
0

Packing Slip - Adding Manufacturer

I'm a complete novice who has only written in HTML before, but from reading the posts on this forum have managed to set up an online shop that is better than I imagined I could achieve. I do have one problem...

I would like to add the manufacturers name to my packing slip (as I have the same product made by different people). How can I do this? I have managed to add the shipping method and customer comments, but can't work out how to add in the manufacturer. I imagine I need to join in another table as this isn't in the same table as the other info that appears on this page. help!

I am using 1.3.5.

12 Dec 2006, 2:37 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Packing Slip - Adding Manufacturer

NOTE: it is strongly recommended that you upgrade to v1.3.6 ...

The Manufactuer's information is not stored with the product on the orders_products table ... however, you can pick up the manufactuers_name via a function call ...

There is a function in the:
/includes/functions/functions_lookups.php

/*
 * 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'] : "";
  }

This could be added to the:
/admin/includes/functions/extra_functions

directory in your own file to use in the Admin ...