Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show Model in Admin Specials Dropdown


TracyS

Recommended Posts

Posted

We have a lot of contributions added to our store, and I now need the ability to see an items model # in the dropdown list of products when creating a Special in the Admin. I have tried adding it, but so far I've only managed to come up with a not working specials page rather than seeing the model number - LOL

 

How do I get the pull down box to show

 

products_model products_name (RetailPrice WholesalePrice)

 

I have everything showing except the products_model

 

Thank you! :blush:

~Tracy
 

  • 4 months later...
Posted

In admin/includes/functions/general.php find the following code in the

tep_draw_products_pull_down function, ~ line 195

 

    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
   while ($products = tep_db_fetch_array($products_query)) {
     if (!in_array($products['products_id'], $exclude)) {
       $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';

 

replace that section with

   $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_model");
   while ($products = tep_db_fetch_array($products_query)) {
     if (!in_array($products['products_id'], $exclude)) {
       $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_model'] .  " - " . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';

 

You can also add the product # to the admin list of specials and to the update specials screens by editing admin/specials.php

by first adding p.products_model to the product_query ~line 197

 

      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_model,  p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");

 

and to the $specials_query raw ~ line 178

    $specials_query_raw = "select p.products_id, pd.products_name, p.products_model,  p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";

 

Then change this section ~ line 144

 

  <td class="main"><?php echo (isset($sInfo->products_name)) ?  $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>

 

to

 

  <td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_model . ' - ' . $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>

 

and

 

~ line 195

 

<td  class="dataTableContent"><?php echo  $specials['products_name']; ?></td>

 

to

 

               <td  class="dataTableContent"><?php echo $specials['products_model'] . ' - ' . $specials['products_name']; ?></td>

 

 

Hope that helps!

  • 6 months later...

Archived

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

×
×
  • Create New...