Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Relocate Product Model number


tonymatt

Recommended Posts

Hi,

 

It isn't popping out right in front of me in Product_Info.php finding code to move the Product Number to a different location on the Product Info page. I see where it is queried from but searches have not come to light for me.

 

Any help where I could find this?

Link to comment
Share on other sites

How about this bit of code in product_info.php in 2.3.1

 

$products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>';

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

I'm in the process of relocating the model number in various places of my site for the product listing. I want to code the boxes best_sellers.php and order_history.php to display it, but the call is different than the rest of the queries to the database. I'm not to shabby with reading the PHP, but I'm thinking this wiil be a bit of code to crack. (w00t)

 

On the order_history.php box I want to have a rollover call as well, but for somereason it is broken. It's close I can feel it, but not working 100%

 

Here is the code for best_sellers.php:

<?php
/*
 $Id: best_sellers.php 1739 2007-12-20 00:52:16Z hpdl $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/
 if (isset($current_category_id) && ($current_category_id > 0)) {
// ADDED FOR MODEL IN LISTING			 p.products_model,
   $best_sellers_query = tep_db_query("select distinct p.products_id, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
 } else {
   $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
 }
 if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
?>
<!-- best_sellers //-->
	  <tr>
	    <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'bestsellers.gif', ' Best Sellers ', '179', '40'));
// CONTROLS AUTO HEADER
   new infoBoxHeading($info_box_contents, true, false);
   $rows = 0;
   $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="">';
   while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
  $rows++;
// CONTROLS NUMBERING
// ADDED FOR MODEL IN LISTING															   '<br>' . $best_sellers['products_model'] .
   $bestsellers_list .= '<tr><td class="infoBoxNumber3" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '<br>' . $best_sellers['products_model'] .'</a></td></tr>';
//  $bestsellers_list .= '<tr></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
   }
   $bestsellers_list .= '</table>';
   $info_box_contents = array();
   $info_box_contents[] = array('text' => $bestsellers_list);
   new infoBox($info_box_contents);
?>
	    </td>
	  </tr>
<!-- best_sellers_eof //-->
<?php
 }
?>

 

And here is the code for order_history.php:

<?php
/*
 $Id: order_history.php 1739 2007-12-20 00:52:16Z hpdl $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/
 if (tep_session_is_registered('customer_id')) {
// retreive the last x products purchased
   $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
   if (tep_db_num_rows($orders_query)) {
?>
<!-- customer_orders //-->
	  <tr>
	    <td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_CUSTOMER_ORDERS);
  new infoBoxHeading($info_box_contents, false, false);
  $product_ids = '';
  while ($orders = tep_db_fetch_array($orders_query)) {
    $product_ids .= (int)$orders['products_id'] . ',';
  }
  $product_ids = substr($product_ids, 0, -1);
  $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
  $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
  while ($products = tep_db_fetch_array($products_query)) {
    $customer_orders_string .= '  <tr>' .
							   '    <td class="infoBoxContents2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
							   '    <td class="infoBoxContents2" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) .
	   '"onMouseOver="MM_swapImage(\'Re-Order\', \'\', \'images/button_in_bag.gif\', 1)"
	  onMouseOut="MM_swapImgRestore()">' . tep_image(DIR_WS_IMAGES . 'button_out_bag.gif' , ' Re-Order ', 32, 33, 'name="Re-Order"') . '</a></td>' .
							   '  </tr>';
  }
  $customer_orders_string .= '</table>';
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $customer_orders_string);
  new infoBox($info_box_contents);
?>
	    </td>
	  </tr>
<!-- customer_orders_eof //-->
<?php
   }
 }
?>

 

Any ideas I would appreciate it.

 

My live site is www.comicunderground.net/catalog and has products loaded to emulate the real deal when fully live.

 

Thanks!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...