Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello,

I've just installed the contribution Enable & Disable Categories.

In admin the status stays into 0 even if I put 1 and save it!

 

Status

0 1=Enabled 0=Disabled

 

Other problem:

Even if the status=0, categories are still enabled in the left box, cause of the contribution dhtml categories, I guess! The code is in javascript and I don't know what to change. :(

 

Anybody could help me, please!

Posted

My suggestion is to check the install instructions again and make sure you modified all files mentioned in the readme. Also you could check the support thread for this contribution for similar problems others posted. I have installed that module and I know it works.

Posted

I know what's the problem!

 

Actually I installed 3 contributions that have changes in the same area:

Categories Enable / Disable, Products_Sold v1.0, sort order!

I made a modification and now it works for Categories Enable / Disable but the button 'save sort order' doesn't work any more!

 

I'm lost, anybody could help me. Here is my code in admin/categories.php

 

l.22-89

//sort order
  case 'beginsort':
	$sorting = true;
	break;
	tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
  case 'setsortorder':
	for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
		tep_set_product_sort_order($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['sortorder'][$i]);
	  }
	$sorting = false;
	tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
	break;
//end sort order
  case 'setflag':
	if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
	  if (isset($HTTP_GET_VARS['pID'])) {
		tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
	  }

	  if (USE_CACHE == 'true') {
		tep_reset_cache_block('categories');
		tep_reset_cache_block('also_purchased');
	  }
	}

	tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));
	break;
	// ####################### Added Categories Enable / Disable ###############
  case 'setflag_cat':
	if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
	  if (isset($HTTP_GET_VARS['cID'])) {
		tep_set_categories_status($HTTP_GET_VARS['cID'], $HTTP_GET_VARS['flag']);
	  }

	  if (USE_CACHE == 'true') {
		tep_reset_cache_block('categories');
		tep_reset_cache_block('also_purchased');
	  }
	}

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&cID=' . $HTTP_GET_VARS['cID']));
break;
// Ajout pour Products_Sold v1.0
  case 'setsold':
	if ( ($HTTP_GET_VARS['sold'] == '0') || ($HTTP_GET_VARS['sold'] == '1') ) {
	  if (isset($HTTP_GET_VARS['pID'])) {
		tep_set_product_sold($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['sold']);
	  }

	  /*if (USE_CACHE == 'true') {
		tep_reset_cache_block('categories');
		tep_reset_cache_block('also_purchased');
	  }*/
	}

	tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));
	break;
// Fin ajout pour Products_Sold v1.0
// ####################### End Categories Enable / Disable ###############
  case 'insert_category':
  case 'update_category':
	if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
	$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
// ####################### Added Categories Enable / Disable ###############
	$sql_data_array = array('sort_order' => $sort_order);
	$categories_status = tep_db_prepare_input($HTTP_POST_VARS['categories_status']);
	$sql_data_array = array('sort_order' => $sort_order, 'categories_status' => $categories_status);
// ####################### End Added Categories Enable / Disable ###############

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...