Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Manufacturer table : more fields (address - phne...)


rosanna.patruno

Recommended Posts

Hi

 

I would like to have more information associated to supplier / manufacturer. Currently, we only have supplier name / image / url by country. I would like to be able to add :

1. main address information (addressline1, addressline2, zipcode, town, country, phone nb, fax nb, email, contact name...)

2. main financial information (account nb, bank...)

 

The interest is for exemple : you propose rooms / services / dinners from hotels. You need to be able to have the address of those hotels, which are suppliers, and associate to them some products (rooms, dinners...)

 

I could not find any contribution on that one. I would be ready to create one, but this request to change the manufacturer table. Anything comments ? and for sure this would mean new admin part for suppliers (as needing update capabilities...)

 

KIndest Regards

 

ROsanna

Link to comment
Share on other sites

  • 3 weeks later...

I'm looking for the very same thing....did you find anything like this in the contributions? It'd be great if there was something out there for Manufacturer that was as simple as the "Customer Extra Fields" contribution. That was a great one! Can anyone point me to the right place?

Link to comment
Share on other sites

  • 4 weeks later...

Hi Nikki

 

I solved it

 

You have to change the manufacturers.Php file of the admin section.

and add the corresponding fields in the table

 

Here is my code, please back up all your files and do not apply it directly, FYI I am not a professional developper...

 

[...]

if (isset($HTTP_GET_VARS['mID'])) $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']);

// New Supplier Fields

$manufacturers_address = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_address']);

$manufacturers_cp = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_cp']);

$manufacturers_town = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_town']);

$manufacturers_latitude = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_latitude']);

$manufacturers_longitude = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_longitude']);

$manufacturers_type = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_type']);

$manufacturers_tel = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_tel']);

$manufacturers_fax = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_fax']);

$manufacturers_email = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_email']);

$manufacturers_contact = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_contact']);

$manufacturers_comments = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_comments']);

// end New Supplier Fields

[...]

if ($manufacturers_image = new upload('manufacturers_image', DIR_FS_CATALOG_IMAGES)) {

tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_image = '" . $manufacturers_image->filename . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");

}

 

// New Supplier Fields

tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_address = '" . $manufacturers_address . "', manufacturers_cp = '" . $manufacturers_cp . "', manufacturers_town = '" . $manufacturers_town . "', manufacturers_latitude = '" . $manufacturers_latitude . "', manufacturers_longitude = '" . $manufacturers_longitude . "', manufacturers_type = '" . $manufacturers_type . "', manufacturers_tel = '" . $manufacturers_tel . "', manufacturers_fax = '" . $manufacturers_fax . "', manufacturers_email = '" . $manufacturers_email . "', manufacturers_contact = '" . $manufacturers_contact . "', manufacturers_comments = '" . $manufacturers_comments . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");

// New Supplier Fields end

 

[...]

 

</tr>

<?php

// New Supplier Fields

$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_address, manufacturers_cp, manufacturers_town, manufacturers_latitude, manufacturers_longitude, manufacturers_type, manufacturers_tel, manufacturers_fax, manufacturers_email, manufacturers_contact, manufacturers_comments, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";

// end New Supplier Fields

[...]

case 'new':

$heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_MANUFACTURER . '</b>');

 

$contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'action=insert', 'post', 'enctype="multipart/form-data"'));

$contents[] = array('text' => TEXT_NEW_INTRO);

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . tep_draw_input_field('manufacturers_name'));

 

// New Supplier Fields

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_ADDRESS . '<br>' . tep_draw_input_field('manufacturers_address', $mInfo->manufacturers_address, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_CP . '<br>' . tep_draw_input_field('manufacturers_cp', $mInfo->manufacturers_cp));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TOWN . '<br>' . tep_draw_input_field('manufacturers_town', $mInfo->manufacturers_town));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_LATITUDE . '<br>' . tep_draw_input_field('manufacturers_latitude', $mInfo->manufacturers_latitude));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_LONGITUDE . '<br>' . tep_draw_input_field('manufacturers_longitude', $mInfo->manufacturers_longitude));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TYPE . '<br>' . tep_draw_input_field('manufacturers_type', $mInfo->manufacturers_type));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TEL . '<br>' . tep_draw_input_field('manufacturers_tel', $mInfo->manufacturers_tel));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_FAX . '<br>' . tep_draw_input_field('manufacturers_fax', $mInfo->manufacturers_fax));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_EMAIL . '<br>' . tep_draw_input_field('manufacturers_email', $mInfo->manufacturers_email, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_CONTACT . '<br>' . tep_draw_input_field('manufacturers_contact', $mInfo->manufacturers_contact, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_COMMENTS . '<br>' . tep_draw_input_field('manufacturers_comments', $mInfo->manufacturers_comments, 'size="30"'));

// end of the New Supplier Fields Add-ins for case 'edit'

 

[...]

 

case 'edit':

$heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_MANUFACTURER . '</b>');

 

$contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=save', 'post', 'enctype="multipart/form-data"'));

$contents[] = array('text' => TEXT_EDIT_INTRO);

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . tep_draw_input_field('manufacturers_name', $mInfo->manufacturers_name));

 

// New Supplier Fields Add-ins : we add several fields : address...

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_ADDRESS . '<br>' . tep_draw_input_field('manufacturers_address', $mInfo->manufacturers_address, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_CP . '<br>' . tep_draw_input_field('manufacturers_cp', $mInfo->manufacturers_cp));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TOWN . '<br>' . tep_draw_input_field('manufacturers_town', $mInfo->manufacturers_town));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_LATITUDE . '<br>' . tep_draw_input_field('manufacturers_latitude', $mInfo->manufacturers_latitude));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_LONGITUDE . '<br>' . tep_draw_input_field('manufacturers_longitude', $mInfo->manufacturers_longitude));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TYPE . '<br>' . tep_draw_input_field('manufacturers_type', $mInfo->manufacturers_type));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_TEL . '<br>' . tep_draw_input_field('manufacturers_tel', $mInfo->manufacturers_tel));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_FAX . '<br>' . tep_draw_input_field('manufacturers_fax', $mInfo->manufacturers_fax));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_EMAIL . '<br>' . tep_draw_input_field('manufacturers_email', $mInfo->manufacturers_email, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_CONTACT . '<br>' . tep_draw_input_field('manufacturers_contact', $mInfo->manufacturers_contact, 'size="30"'));

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_COMMENTS . '<br>' . tep_draw_input_field('manufacturers_comments', $mInfo->manufacturers_comments, 'size="30"'));

// end of the New Supplier Fields Add-ins for case 'edit'

Link to comment
Share on other sites

  • 2 years later...

Archived

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

×
×
  • Create New...