Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Categories box


rikpotts

Recommended Posts

Posted

Ive got a category of free gifts which I want to remove from the list in the categories box, does anyone know how I can do this?

 

I have deleted the name which gets rid of the text but I have all categories listed on the mainpage with a thumbnail also a little arrow in the box on the left so its still acessable.

Posted

actually just did something very similar. probably more than one way to do it but what you're looking for is in catalog/includes/boxes/categories.php, look for this query:

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, 
c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . 
" cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.langu
age_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

 

what i did was gave my 'Free Gifts' category a Sort Order of 999 and made the above code into this:

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, 
 c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . 
 " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.langu
 age_id='" . (int)$languages_id ."' and sort_order < 900 order by sort_order, cd.categories_name");

 

i used 900 just so i don't have to go back and change it after christmas ;). Now I can make any category i don't want displayed just have a 'Sort Order' 900 or higher. But you could also do it by category id. Say you'r Free Gifts category is 42, do this:

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, 
  c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . 
  " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.langu
  age_id='" . (int)$languages_id ."' and c.categories_id!=42 order by sort_order, cd.categories_name");

 

on a side note, when doing mine, after putting them in, i had to click the red button to inactivate them, otherwise they were showing up in the new products infoboxes and such.

 

you can check what i did at http://furpeaceranch.com/catalog

you get 1 gift at $50, a different one at $75, another different one at $100, and all 3 at $150

 

i did add some code to remove the quantity box, but realized the way i have it setup is that it removes all gifts from the cart before it checks the total, so no one could try ordering 50 free gifts and they can't delete it either. Haha ;)

 

hope this helps, and let me know if you need any more..

  • 1 month later...
Posted

I missed your reply!

 

This worked a treat.

 

I started to install a hidden product contrib but it invlolved so much editting I gave up.

 

Many Thanks!

Rik

Archived

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

×
×
  • Create New...