Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Enable/Disable Categories mod with Cat. Dropdown Box mod?


JenRed

Recommended Posts

Is it possible to have both the Enable/Disable Categories mod and the Categories Dropdown Box mod?

 

Has anyone successfully got both of these mods working together?

 

What code do I change? etc etc :)

 

 

thanks

 

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

I've got enable/disable categories installed and it works just fine...

 

Except, you will need to change all queries that query the product or category table...

You will need to filter out those categories/products who are inside a disabled category...

 

I've noticed that after the install that products were showing up that actually were in an enabled sub category that in his turn, was inside a disabled category...

 

When I got the time, I'm going to build a list of enabled categories somewhere in the application_top.php that I could use in all my product/category queries...

 

I haven't installed the categories drop down, but i'll guess you'll need to extend the query to exclude the disabled categories.

Link to comment
Share on other sites

yea, I got it to work together but I am not sure what I have done. (didn't jot a note) :?

 

however, here how my allcategoriesdropdown.php look like.. see if u have the same..

 

$categories_array = tep_get_categories($cat_choose);

for ($i=0; $i<sizeof($categories_array); $i++) {

$path = "";

$parent_categories = array();

tep_get_parent_categories($parent_categories, $categories_array[$i]['id']);

for ($j = sizeof($parent_categories) - 1; $j>=0; $j--) {

$path = ($path == "") ? $parent_categories[$j] : ($path . "_" . $parent_categories[$j]);

}

$categories_array[$i]['id'] = ($path == "") ? $categories_array[$i]['id'] : ($path . "_" . $categories_array[$i]['id']);

}

 

$info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">',

'align' => 'center',

'text' => tep_draw_pull_down_menu('cPath', $categories_array,'','onChange="this.form.submit();" size="' . ((sizeof($categories_array) < MAX_MANUFACTURERS_LIST) ? sizeof($categories_array) : MAX_MANUFACTURERS_LIST) . '" style="width:' . BOX_WIDTH . '"')

);

new infoBox($info_box_contents);

 

 

i have also changed many files, so we'll see if you have the same code in this file...and it still doesn't work, i will look at other related files to see what i changed.

Link to comment
Share on other sites

Glad to hear someone has managed to integrate the two.

 

Considering I don't even have a file called allcategoriesdropdown.php, I think it's safe to say that is one you added!

 

It would be great if you could decipher what changes you made - though I know it won't be easy! If you want to give it a try, let me know how you go...

 

Anybody else done a similar thing and remember what they did?

 

thanks

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

wait..i guess you want different feature..never mind :D

 

mine is pop down menu..like jump menu box on this forum script (jump to: )

 

the type you talk about should be even easier.

look at tep_db_query of table categories

add where 'clause'

ex; and categories_status = '1'

Link to comment
Share on other sites

I added that all queries that concerns with categories table.

 

The disabled category doesn't show in dropdown list.

However, if someone bookmarked the page when it was enabled, they could access the category and its products. :( Although the category status is 0

Link to comment
Share on other sites

  • 3 weeks later...
  • 11 months 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...