Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't add or edit products in Admin


TomCavendish

Recommended Posts

In Admin.

 

When I click to add a 'new product' or to 'edit product' I am taken to the correct page and then it displays the OSC menu on the left.

 

However, the main body of the page is blank and it does not display the boxes or text where I add/edit the product info.

 

A reward to whoever can help. I have to launch the site in a couple of days, and still have to add products and do the SSL, else I could be out of a job :(

Link to comment
Share on other sites

what is in the address bar

 

admin/categories.php?cPath=&pID=37&action=new_product

 

ignore the number 37 as this is specific to my setup

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

do you get the same blank page if you type this in the address bar

 

admin/categories.php?cPath=&action=new_product

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

have you modified any files recently and are you getting any error messages

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

No error messages.

 

I did use the category_descriptions mod(http://www.oscommerce.com/community/contributions,1373) which did make changes to the admin/categories.php page. The mod works fine, but I do seem to have a problem with adding/editing products showing a blank 'content' part of the page.

 

I'm new-ish to php (moving over from asp) so I'm not completely sure about indents, formating etc. The mod instructions to admin/categories.php:

 

7. CHANGES TO admin/categories.php

 

1) Locate the following line near the top of the file (approximately line 13):

? require('includes/application_top.php');

? ? Add the following line AFTER it:

require('includes/functions/categories_description.php');

 

2) Locate the following two lines (approximately line 35):

? ? ? case 'insert_category':

? ? ? case 'update_category':

? ? Add the following 5 lines BEFORE "case 'insert_category':"

? ? ? case 'new_category':

? ? ? case 'edit_category':

? ? ? ? if (ALLOW_CATEGORY_DESCRIPTIONS == 'true')

? ? ? ? ? $HTTP_GET_VARS['action']=$HTTP_GET_VARS['action'] . '_ACD';

? ? ? ? break;

 

3) Add the following 3 lines AFTER "case 'update_category':"

? ? ? ? if ( ($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) ) {

? ? ? ? ? $HTTP_GET_VARS['action'] = 'edit_category_ACD';

? ? ? ? } else {

 

4) The line after "} else {" line you added should read:

? ? ? if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

? ?  Add the following 3 lines AFTER it:

? ? ? ? if ($categories_id == '') {

? ? ? ? ?  $categories_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

? ? ? ?  }

 

5) Indent by two spaces ALL lines after the "} else {" up to (but not

? ? including) the line that reads "break;". In the version of catetories.php I

? ? worked on, I indented 42 lines (not including blank lines). (You don't

? ? really have to do this step, but it makes the indenting of the pgp code

? ? correct, and may make it easier to find and correct any mistakes you make

? ? while doing these changes.)

 

6) Locate the following line (approximately line 78):

? ? ? ? ? ? $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]));

 

? ?  Add the following 5 lines AFTER it:

? ? ? ? ? ? if (ALLOW_CATEGORY_DESCRIPTIONS == 'true') {

? ? ? ? ? ? ? $sql_data_array = array('categories_name' => tep_db_prepare_input($HTTP_POST_VARS['categories_name'][$language_id]),

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'categories_heading_title' => tep_db_prepare_input($HTTP_POST_VARS['categories_heading_title'][$language_id]),

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'categories_description' => tep_db_prepare_input($HTTP_POST_VARS['categories_description'][$language_id]));

? ? ? ? ? ? }

 

7) Locate the following 7 lines (approximately line 97):

? ? ? ? if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

? ? ? ? ? tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

? ? ? ? }

 

 

? ? ***New Change from 1.4**** REPLACE those 7 lines with the following 11 lines:

? ? ? ? ? if (ALLOW_CATEGORY_DESCRIPTIONS == 'true') {

? ? ? ? ? ? tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $HTTP_POST_VARS['categories_image'] . "' where categories_id = '" .? tep_db_input($categories_id) . "'");

? ? ? ? ? ? $categories_image = '';

? ? ? } else {

? ? ? ? if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

? ? ? ? ? tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

? ? ? ? }

? ? ?  }

 

 

8) Locate the two lines that read (approximately line 103):

? ? ? ? break;

? ? ? case 'delete_category_confirm':

 

? ?  Add the following 1 line BEFORE the line that reads "break;":

? ? ? ? }

 

9) Locate the three lines that read (approximately line 377):

 

<!-- body_text //-->

? ? ? <td width="100%" valign="top">

<?php

 

Change to:

 

<!-- body_text //-->

? ? ? <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

? ? 

?  ***New Change from 1.4**** Now insert the contents of the file "new_category.insert" AFTER the "<?php"

? ?  line.? Once you have done this, you can remove the "new_category.insert"

? ?  file--you don't need it any more.

 

10) Locate the following line (approximately line 560):

? ?  if ($action == 'new_product') {

 

? ?  CHANGE that line to:

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

Link to comment
Share on other sites

? ? ? ? if (ALLOW_CATEGORY_DESCRIPTIONS == 'true')

is this activated.

 

are you using the non BTS or the BTS version

 

did you perform this part of the changes

 

<?php

? ? 

?  ***New Change from 1.4**** Now insert the contents of the file "new_category.insert" AFTER the "<?php"

? ?  line.? Once you have done this, you can remove the "new_category.insert"

? ?  file--you don't need it any more.

 

did you keep a backup prior to mod

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Yep, did those things. I've now re-installed the whole 'Admin', and can now edit products again, but lost the Category Descriptions mod.

 

Will have another go at installing the Admin part of the Category Descriptions mod from scratch, and see what happens. :blink:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...