Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Manufacturer to Order, Invoice and Packing Slip


Guest

Recommended Posts

I would like to add the Manufacturer Name to the Customers Order information, as well as the Invoice and Packing Slip within osCAdmin. I have browsed the Forum, but could not find any solutions, nor could I find a contribution available that will add the necessary information.

 

Has anyone done this successfully or have any ideas how to do it?

 

Thanks in advance.

 

-R

Link to comment
Share on other sites

Thanks... but I figured it out on my own.

 

I was successfully able to display the Manufacturers Name in between the Product name and Model Number on the Order Information, Invoice and Packing List Pages. :D

 

Good Luck.

 

-R

Link to comment
Share on other sites

  • 4 months later...

Hi,

 

Could you tell me how can I do it?

 

I'm not very good with php and mysql, but I think there is a "hard" way, editing:

 

- orders_products table (adding manufacturers field),

- checkout_process.php

and maybe order.php (class definition) and other files...

 

I think maybe is possible a easier way with this message suggestion:

 

http://www.oscommerce.com/forums/viewtopic.php...5544&highlight=

 

Any idea?

 

Thanks a lot,

 

Joan

[email protected]

www.delaterra.net

organic food in Catalonia

Link to comment
Share on other sites

It's gorgeous :-) I've done it... I'm beggining to think I've got possibilities to earn my life as a computer guy ;-)

 

Let's go... Thanks this zlack&Mattreicher message: http://www.oscommerce.com/forums/viewtopic.php...5544&highlight=

I find a possible way to do it... That is:

 

In admin/includes/classes/order.php (after line 69 aprox)

 

Coment:

 

// $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and replace by:

 

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and then

 

// This is a new code line

                                       'joan_product_id' => $orders_products['products_id'],

 

In admin/invoice.php (after line 95 aprox)

 

<!-- comment: if you use models you must not comment these lines, you should arrange the table columns

       <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

my new line:    -->

  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MANUFACTURER; ?></td>

 

In admin/invoice (after line 123 aprox)

 

// if you use models you must not comment these lines, you should arrange them...

//           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "n";

// This is my new line:

          '        <td class="dataTableContent" valign="top">' . tep_get_products_manufacturer($order->products[$i]['joan_product_id']) . '</td>' . "n";

 

In admin/includes/functions.php (doesn't matter where)

 

// For print Products manufacturer - Thank you very much zlack!

function tep_get_products_manufacturer($product_id) {

$products_manufacturer_query = tep_db_query("SELECT manufacturers_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $product_id . "'");

$products_manufacturer = tep_db_fetch_array($products_manufacturer_query);

$manufacturer_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . $products_manufacturer['manufacturers_id'] . "'");

$manufacturer = tep_db_fetch_array($manufacturer_query);



return ($manufacturer['manufacturers_name'] == "" ? "N/A" : $manufacturer['manufacturers_name']);

}

 

In admin/includes/languages/catalan/invoices.php (replace catalan by your shop languages)

 

define('TABLE_HEADING_PRODUCTS_MANUFACTURER', 'Marca');  // this is a new line :-)

 

I hope anyone could take profit of these lines :-)

 

Regards,

 

Joan

Freesoft is incredible but is real!

[email protected]

www.delaterra.net

organic food in Catalonia

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hello,

I've been working on this for MS2 but can't get it to work.... any ideas on MS2?

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

  • 3 weeks later...

I'd like to add the Manufacturer to the order confirmation email. I have applied some of Joan's code to achieve this, but I'm still not quite there yet. If anyone can help...

 

This is what I have done so far:

 

In catalog/includes/classes/order.php

Coment:

 

// $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and replace by:

 

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and then

 

// This is a new code line

                                       'manufacturer_product_id' => $orders_products['products_id'],

 

In catalog/checkout_process.php

Coment:

 

//   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

 

Replace with:

 

   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . tep_get_products_manufacturer($order->products[$i]['manufacturer_product_id']) . ' ' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

 

In catalog/includes/functions/general.php

 

// For print Products manufacturer - Thank you very much zlack!

function tep_get_products_manufacturer($product_id) {

$products_manufacturer_query = tep_db_query("SELECT manufacturers_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $product_id . "'");

$products_manufacturer = tep_db_fetch_array($products_manufacturer_query);

$manufacturer_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . $products_manufacturer['manufacturers_id'] . "'");

$manufacturer = tep_db_fetch_array($manufacturer_query);

return ($manufacturer['manufacturers_name'] == "" ? "N/A" : $manufacturer['manufacturers_name']);

}

 

Thank you Joan :)

 

When I do a test order I receive an email with

Products

------------------------------------------------------

1 x Girls' All Occasion Footed Tights (N/A 51) = $2.93

Color Theatrical Pink

Size Medium

------------------------------------------------------

 

The N/A by the 51 is where the manufacturer's name should apear, but I don't know what else to do to make it work. Please help.

 

Erica

Link to comment
Share on other sites

  • 4 years later...
I'd like to add the Manufacturer to the order confirmation email. I have applied some of Joan's code to achieve this, but I'm still not quite there yet. If anyone can help...

 

This is what I have done so far:

 

In catalog/includes/classes/order.php

Coment:

 

// $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and replace by:

 

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and then

 

// This is a new code line

									'manufacturer_product_id' => $orders_products['products_id'],

 

In catalog/checkout_process.php

Coment:

 

//   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

 

Replace with:

 

   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . tep_get_products_manufacturer($order->products[$i]['manufacturer_product_id']) . ' ' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

 

In catalog/includes/functions/general.php

 

// For print Products manufacturer - Thank you very much zlack!

function tep_get_products_manufacturer($product_id) {

$products_manufacturer_query = tep_db_query("SELECT manufacturers_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $product_id . "'");

$products_manufacturer = tep_db_fetch_array($products_manufacturer_query);

$manufacturer_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . $products_manufacturer['manufacturers_id'] . "'");

$manufacturer = tep_db_fetch_array($manufacturer_query);

return ($manufacturer['manufacturers_name'] == "" ? "N/A" : $manufacturer['manufacturers_name']);

}

 

Thank you Joan :)

 

When I do a test order I receive an email with

 

 

The N/A by the 51 is where the manufacturer's name should apear, but I don't know what else to do to make it work. Please help.

 

Erica

 

 

Does anyone know the answer to Erica's questions - how to put manufacturer in the email confirmation

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...