Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

know its been asked before


socom

Recommended Posts

Posted

but i havnt found one that works there must be a way to do it in the product_info.php

 

tryed this code

 

<title><?php echo $products_name; ?> <?php echo $products_price; ?></title>

 

Also tryed

<title><?php echo $model['products_name'] .' - '; echo TITLE; ?></title>

 

But when i do this just shows the URL in the title bit not any info

 

 

please help its one of the last things on my list to do and unable to do it

Posted

You are trying to access data b4 its been read!!

 

You have also come across (accidently) one of the sillier pieces of coding in osc

 

code at the start of product info mearly does a count of product matching the passed products_id, further on if this count is zero an error messAGE IS DISPLAYED, otherwise the product data is read then output, since 99.99% of time 2nd will happen, 1st is a waste of time & sql queries

 

my fix:

 

find:

 

$product_check_query = tep_db_query("select count(*) as total 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_check = tep_db_fetch_array($product_check_query);

 

replace with:

 

$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);

 

then find:

 

  if ($product_check['total'] < 1) {

 

replace with:

 

if (!tep_db_num_rows($product_info_query)) {

 

next find:

 

$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);

 

and delete it.

 

now for your title you can put:

 

<title><?php echo ($product_info['products_name'] ? $product_info['products_name'] . ' ' . $product_info['products_price'] . ' ' . TITLE : TITLE ); ?></title>

 

Hope that helps B)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Archived

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

×
×
  • Create New...