Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello, I had this contribution working on a previously installed store but now it is killing me.

 

This is the problem admin1.gif

 

I believe the problem is in the "new catagory. insert" section.

 

//----- new_category / edit_category (when ALLOW_CATEGORY_DESCRIPTIONS is 'true') ----- if ($HTTP_GET_VARS['action'] == 'new_category_ACD' || $HTTP_GET_VARS['action'] == 'edit_category_ACD') { if ( ($HTTP_GET_VARS['cID']) && (!$HTTP_POST_VARS) ) { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $HTTP_GET_VARS['cID'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name"); $category = tep_db_fetch_array($categories_query); $cInfo = new objectInfo($category); } elseif ($HTTP_POST_VARS) { $cInfo = new objectInfo($HTTP_POST_VARS); $categories_name = $HTTP_POST_VARS['categories_name']; $categories_heading_title = $HTTP_POST_VARS['categories_heading_title']; $categories_description = $HTTP_POST_VARS['categories_description']; $categories_url = $HTTP_POST_VARS['categories_url']; } else { $cInfo = new objectInfo(array()); } $languages = tep_get_languages(); $text_new_or_edit = ($HTTP_GET_VARS['action']=='new_category_ACD') ? TEXT_INFO_HEADING_NEW_CATEGORY : TEXT_INFO_HEADING_EDIT_CATEGORY; ?>

 

categories_id, $languages[$i]['id']))); ?>

 

categories_id, $languages[$i]['id']))); ?>

categories_id, $languages[$i]['id']))); ?>

 

 

categories_image . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image); ?>

 

sort_order, 'size="2"'); ?>

 

date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>

categories_image; } $form_action = ($HTTP_GET_VARS['cID']) ? 'update_category' : 'insert_category'; echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); $languages = tep_get_languages(); for ($i=0; $icategories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']); $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']); $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']); } else { $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]); $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]); $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]); } ?> categories_heading_title; ?>categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?> categories_id; } ?> ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>

 

There are several ending ?> tags with out any <?php tags to match.

 

 

Here is a section of my catagories file.

 

<!-- 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">

<?php

//----- new_category / edit_category (when ALLOW_CATEGORY_DESCRIPTIONS is 'true') ----- if ($HTTP_GET_VARS['action'] == 'new_category_ACD' || $HTTP_GET_VARS['action'] == 'edit_category_ACD') { if ( ($HTTP_GET_VARS['cID']) && (!$HTTP_POST_VARS) ) { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $HTTP_GET_VARS['cID'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name"); $category = tep_db_fetch_array($categories_query); $cInfo = new objectInfo($category); } elseif ($HTTP_POST_VARS) { $cInfo = new objectInfo($HTTP_POST_VARS); $categories_name = $HTTP_POST_VARS['categories_name']; $categories_heading_title = $HTTP_POST_VARS['categories_heading_title']; $categories_description = $HTTP_POST_VARS['categories_description']; $categories_url = $HTTP_POST_VARS['categories_url']; } else { $cInfo = new objectInfo(array()); } $languages = tep_get_languages(); $text_new_or_edit = ($HTTP_GET_VARS['action']=='new_category_ACD') ? TEXT_INFO_HEADING_NEW_CATEGORY : TEXT_INFO_HEADING_EDIT_CATEGORY; ?>

 

categories_id, $languages[$i]['id']))); ?>

 

categories_id, $languages[$i]['id']))); ?>

 

categories_id, $languages[$i]['id']))); ?>

 

 

 

categories_image . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image); ?>

 

sort_order, 'size="2"'); ?>

 

date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>

categories_image; } $form_action = ($HTTP_GET_VARS['cID']) ? 'update_category' : 'insert_category'; echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); $languages = tep_get_languages(); for ($i=0; $icategories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']); $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']); $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']); } else { $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]); $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]); $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]); } ?>

categories_heading_title; ?>

categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?> categories_id; } ?> ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>

 

} elseif ($action == 'new_product') {

$parameters = array('products_name' => '',

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

'products_price' => '',

'products_weight' => '',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

$pInfo = new objectInfo($parameters);

 

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

 

$pInfo->objectInfo($product);

} elseif (tep_not_null($HTTP_POST_VARS)) {

$pInfo->objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_url = $HTTP_POST_VARS['products_url'];

}

 

$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

'text' => $manufacturers['manufacturers_name']);

}

 

$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");

while ($tax_class = tep_db_fetch_array($tax_class_query)) {

$tax_class_array[] = array('id' => $tax_class['tax_class_id'],

'text' => $tax_class['tax_class_title']);

}

 

$languages = tep_get_languages();

 

if (!isset($pInfo->products_status)) $pInfo->products_status = '1';

switch ($pInfo->products_status) {

case '0': $in_status = false; $out_status = true; break;

case '1':

default: $in_status = true; $out_status = false;

}

?>

<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">

<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

<script language="javascript"><!--

var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

//--></script>

<script language="javascript"><!--

var tax_rates = new Array();

<?php

for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {

if ($tax_class_array[$i]['id'] > 0) {

echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";

}

}

?>

 

function doRound(x, places) {

return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);

}

 

function getTaxRate() {

var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;

var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

 

if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {

return tax_rates[parameterVal];

} else {

return 0;

}

}

 

function updateGross() {

var taxRate = getTaxRate();

var grossValue = document.forms["new_product"].products_price.value;

 

 

Can anyone help me please?

 

Thanks much, Kevin

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...