Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product name AND manufacturer


Guest

Recommended Posts

Hi there.

 

Bear with me as I'm still fairly new to PHP.

 

What I'd like to be able to do is to display the manufacturer name before the product name when viewing product info and also in the 'New Products for' box.

 

It seems a little wierd just to have a product code and a price.

 

Obviously one way of doing it is just including the manufacturer in the product name, but thats a little messy IMO, and the information obviously exists in the db, its just a case of getting it out.. so how do I do it?

 

Cheers

Chris

Link to comment
Share on other sites

I've customized my product info page quite a lot including showing manufacturer.

 

Around line 20 I have added:

   $the_man_info_query = tep_db_query("select m.manufacturers_name from " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = '$the_product_info[manufacturers_id]' "); 
   $the_man_info = tep_db_fetch_array($the_man_info_query);

 

Around lines 90-100 I have:

    if (tep_not_null($product_info['products_model'])) {
     $products_name = $the_man_info['manufacturers_name'] . ' ' . $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $the_man_info['manufacturers_name'] . ' ' . $product_info['products_name'];
   }

 

 

HTH

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 2 weeks later...

Hi Carine,

 

Many thanks for your code!

 

What does it do exactly? I have uploaded the new product_info.php to a test (duplicate) site I have and I can't see any changes..

 

Any help? (Obviously I've got something wrong!!) - :-" >_<

Link to comment
Share on other sites

  • 2 weeks later...
Hi Carine,

 

Many thanks for your code!

 

What does it do exactly? I have uploaded the new product_info.php to a test (duplicate) site I have and I can't see any changes..

 

Any help? (Obviously I've got something wrong!!) -  :-"  >_<

 

In my installation

 

  $the_man_info_query = tep_db_query("select m.manufacturers_name from " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = '$the_product_info[manufacturers_id]' ");

 

had to be changed to

 

 $the_man_info_query = tep_db_query("select m.manufacturers_name from " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = '$product_info[manufacturers_id]' ");

 

in order to work

Link to comment
Share on other sites

OK I've made the change. Thanks for your help but I still can't see any differences. I have uploaded it correctly to my root shop directly (is this correct - its where I found my product_info..)

 

Cheers

Chris

Link to comment
Share on other sites

Have you put the code AFTER this code in the origial product_info file:

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

   $product_info = tep_db_fetch_array($product_info_query);

 

the "product_info" must be correspond in the code added, so if is called something different you must correct it correspondantly.

 

Christian

Link to comment
Share on other sites

  • 2 weeks later...

Christian,

 

Thanks for your reply, as far as I can tell I have added the code after the code you specified..

 

What do you mean when you say the product_info must correspond to the code added?

 

Cheers

Chris

Link to comment
Share on other sites

Christian,

 

Thanks for your reply, as far as I can tell I have added the code after the code you specified..

 

What do you mean when you say the product_info must correspond to the code added?

 

Cheers

Chris

I changed the "$the_product_info" to "$product_info"

 

so if in your installation it is called something different you have to change it also.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...