Jump to content
Sign in to follow this  
blecky

Additional description for Category / Manufacturer

Recommended Posts

I thought I installed this contribution correctly, but I get the following error message when I try to load admin/additional_description.php: "Fatal error: Cannot redeclare tep_db_connect() in admin/ includes/functions/database.php on line 13" :cry: Anyone out there to point me in the right direction?

 

Thanks

Werner

Share this post


Link to post
Share on other sites

Sorry to trouble you - found the problem. The code is 2 x in the original file.

 

rgds

Werner

Share this post


Link to post
Share on other sites

Hi, Would you please post the codes for additional_discription which are in their twice as I am unable to find the same :oops:

Share this post


Link to post
Share on other sites

Search for:

 

<?php

/*

 $Id: additional_description.php,v 1.1 2003/4/22 23:21:48 erisen Exp $

 

Delete this and everything below it and that's it.

 

Joe

Share this post


Link to post
Share on other sites

It appears it was my fault. I checked the downloaded file again and the code is ok. Sorry, please accept my appologize. I made some modifications to the script and put some extra information in the language files. This zip file can be found at our ftp server ftp.optlectra.de/misc/shipcart.zip.

 

I wanted to do some more modifications because it seems there still is a problem with tax calculation (the prices in the database are net, but they are displayed with tax). The German authorities require that a B2B shop shows all prices with tax. We have also customers from other countries outside the EU and those customers do not need to pay tax. Therefore, I have 3 tax and shipping zones: Germany, Rest of the EU, Rest of the World. The first and the second need to pay tax, the third does not pay tax.

 

The idea is, when a non-taxable country is selected, all (also the cart content) prices do not include tax, in the other case all do.

 

I am a novice in PHP and I am also new to this great shop package, so it is hard to find out what to do. I (and I'm sure many other) would be grateful, if you could help.

 

Thanks for your attention and time!

 

regards

Werner

Share this post


Link to post
Share on other sites

I have made the correction , thank you Blecky.....

 

Please download the correct package.


GALATASARAY RULES!

ultrAslan - ultrAslan - ultrAslan

Share this post


Link to post
Share on other sites
It appears it was my fault. I checked the downloaded file again and the code is ok. Sorry, please accept my appologize. I made some modifications to the script and put some extra information in the language files. This zip file can be found at our ftp server ftp.optlectra.de/misc/shipcart.zip.

 

I wanted to do some more modifications because it seems there still is a problem with tax calculation (the prices in the database are net, but they are displayed with tax). The German authorities require that a B2B shop shows all prices with tax. We have also customers from other countries outside the EU and those customers do not need to pay tax. Therefore, I have 3 tax and shipping zones: Germany, Rest of the EU, Rest of the World. The first and the second need to pay tax, the third does not pay tax.

 

The idea is, when a non-taxable country is selected, all (also the cart content) prices do not include tax, in the other case all do.

 

I am a novice in PHP and I am also new to this great shop package, so it is hard to find out what to do. I (and I'm sure many other) would be grateful, if you could help.

 

Thanks for your attention and time!

 

regards

Werner

 

hello mate,

looks like to wrong topic ;) :shock:


GALATASARAY RULES!

ultrAslan - ultrAslan - ultrAslan

Share this post


Link to post
Share on other sites

Ooops, now I got what your reply meant: I mixed up two different applications. Sorry.

Share this post


Link to post
Share on other sites

hi i am a begginer in OSC and

 

i want to get a description of categories or manufacturer on my index.php

 

i am trying to do this like this

 

on index php

putting code

 

<?php

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

require(DIR_WS_MODULES . FILENAME_ADDITIONAL_INFO);

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

?>

 

but its not working :(

 

can you help me to get this description on my index page

 

in product_info its ok :))

 

sorry form my English ;)

Share this post


Link to post
Share on other sites

im trying to get this cont to work, it throws no errors, but it dont work.

 

in the admin section

after you click Additional Info

when you select manufacurers or categories

 

you do get the list of either, but the code is wrong

the link it generates to edit a cat or manufacturers additional info is missing somthing:

admin/additional_description.php?task=prep_edit_form&what_info=&what_info_id=36

 

the what_info is missing heres the code, ive looked but cannot see the problem.

 

any help would be great

Craig

 

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

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 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="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top"><table border="0" 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'); ?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×