Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with product_info.php


Guest

Recommended Posts

I have added the additional_infov1.2 contribution to my site. I am currently using it on one category. the problem is that I cant get the text to center on the page. This is the text I need to center:

 

We are having a "Back to School" Sale on All Acer Laptops

Just enter the coupon code "rpc0001" on checkout!

 

The above text is on this page just below the product discription:

 

Acer AS5520-5908/LX.AJ70X.027 15.4 inch Athlon 64 X2 1.8GHz/ 1GB/ 120GB/ DVDRW/ WVHP Notebook Computer

 

this is the code from product_info.php:

 

// CUSTOMIZATION ADDITIONAL INFORMATION TO DESC.....

  require(DIR_WS_MODULES . FILENAME_ADDITIONAL_INFO);

// END OF CUSTOMIZATON.......

 

should I edit the admin/additional_discription.php?

<?php
/*
 $Id: additional_description.php,v 1.2 2003/05/14 08:21:48 erisen Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

//1 - We allow category and manufacturer information only

$additional_info_array = array ("CATEGORY","CATLEVEL","MANUFACTURER");
// so the shop owner will chose which one the additional info is for.



$languages = tep_get_languages();

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="1" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="1" width="100%" cellspacing="0" cellpadding="2">

<?php
if (($HTTP_POST_VARS['task'] == '')&&($task=='')) {
echo "<FORM name='add' action='$PHP_SELF' method='post'>";
echo "<select name = 'what_info'>";
while (list($key,$value)=each($additional_info_array)) {
echo "<option value='$value'>$value</option>";
}
echo "</select>";
echo "<input type='hidden' name='task' value='gen_entry_form'>";
echo "<input type='submit' name='submit' value='submit'>";

echo "</FORM>";

}

if ($HTTP_POST_VARS['task']=='gen_entry_form') {

echo "<form name='add2' action='$PHP_SELF' method='post'>";
echo "<input type='hidden' name='task' value='enter_data'>";
if     ($HTTP_POST_VARS['what_info']== 'CATEGORY' || $HTTP_POST_VARS['what_info']== 'CATLEVEL') {

$cat_query = "select cd.categories_name object_name,cd.categories_id object_id
                   from ".TABLE_CATEGORIES_DESCRIPTION." cd,
                  ".TABLE_LANGUAGES." l
              where 1=1
              and   cd.language_id = l.languages_id
              and   l.directory  = '$language' ";
} elseif ($HTTP_POST_VARS['what_info']== 'MANUFACTURER') {
$cat_query = "select cd.manufacturers_name object_name,
                    cd.manufacturers_id   object_id
             from ".TABLE_MANUFACTURERS." cd
             where 1=1       ";
}
$cat_result = tep_db_query($cat_query);

echo "<TABLE>";
echo "<tr><th colspan='2'></th>";
while ( $cat_array_first=tep_db_fetch_array($cat_result)) {

echo "<tr><td>".$cat_array_first['object_name']."</td>\n
    <td valign='top'><a href='".$PHP_SELF."?task=prep_edit_form&what_info=$what_info&what_info_id=".$cat_array_first['object_id']."'>
        <img src='includes/languages/".$language."/images/buttons/button_edit.gif' border='0'></a></td></tr>";

}
echo "</table>";
}          

if ($task == 'prep_edit_form') {
  echo "<form name='edit_form' action='$PHP_SELF' method='post'>\n";
 $n = count($languages);
 reset($languages);
 for ($i=0;$i<$n;$i++) {

 $additional_info_query_raw = "SELECT add_desc_id,
		context,
		context_value,
		additional_description,
		language,
		sort_order 
FROM ".TABLE_ADD_INFO." where context='$what_info'
            and    context_value='$what_info_id'
            and    language = '".$languages[$i]['directory']."'
            order by sort_order,language  ";


 $additional_info_query = tep_db_query($additional_info_query_raw);

 if (mysql_num_rows($additional_info_query) =='1') { $action = 'update'; } 
 else {  $action ='insert' ; }

 $additional_info = tep_db_fetch_array($additional_info_query); 
echo "<input type='hidden' name='action[]' value='$action'>\n";
 echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']);
 echo "<br>\n"; 
 echo  tep_draw_textarea_field('description[]', 'soft', '70', '10',$additional_info['additional_description'] );
 echo "<input type='hidden' name='lang[]' value='".$languages[$i]['directory']."'><br>\n";
     }


echo "<input type='hidden' name='context' value='$what_info'>\n";
echo "<input type='hidden' name='context_value'  value='$what_info_id'>\n";
echo "<input type='submit' name='submit' value='submit'>\n";
echo "<input type='hidden' name='task' value='process_edit'>\n";

echo "</form>\n";
}

if ($HTTP_POST_VARS['task']=='process_edit') {

   $n_action = count($HTTP_POST_VARS['action']);
   reset ( $HTTP_POST_VARS['action']);
     for  ($ia=0;$ia<$n_action;$ia++) {

   $add_text = $HTTP_POST_VARS['description'][$ia];
   //   $add_text = nl2br($add_text);
   $add_language =  $HTTP_POST_VARS['lang'][$ia];

    if ($HTTP_POST_VARS['action'][$ia] == 'insert') {
                     $sql = "insert into ".TABLE_ADD_INFO." 
                (add_desc_id ,context,context_value,additional_description,language,sort_order)
    values ('','".$HTTP_POST_VARS['context']."','".$HTTP_POST_VARS['context_value']."','".$add_text."','$add_language','0') ";
     } elseif ($HTTP_POST_VARS['action'][$ia] == 'update') {
   $sql = "update ".TABLE_ADD_INFO." 
   set additional_description = '$add_text'
   where context = '".$HTTP_POST_VARS['context']."'
   and   context_value = '".$HTTP_POST_VARS['context_value']."'
   and   language = '$add_language' ";
        }
//echo $sql;	
$ress = tep_db_query($sql);
 }
if (!mysql_error()) { echo ICON_SUCCESS; } 
else { echo ICON_ERROR; }


}

  echo '      </td>' . "\n";

?>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I dont know enough about php to do this so any help would be greatly appreciated

Link to comment
Share on other sites

No.

 

You should edit something in the /catalog/includes/modules/FILENAME_ADITIONAL_INFO

 

Where FILENAME_ADITIONAL_INFO is some file related to the contrib you installed.

 

Because in product_info.php you are inluding DIR_WS_MODULES . FILENAME_ADITIONAL_INFO

 

Where DIR_WS_MODULES is the /catalog/includes/modules/ folder

and FILENAME_ADITIONAL_INFO is the file name

 

Maybe if you that FILENAME_ADITIONAL_INFO file we can do something. But it is recommended that you look for a thread that offers support for that contrib.

 

Regards,

Hey!!... I still need help with this http://www.oscommerce.com/forums/index.php?showtopic=309208. Please, take a look on it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...