Jump to content



- - - - -

[Contribution] Categories Images Box support thread


  • Please log in to reply
204 replies to this topic

#81 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 20 May 2009 - 12:46 AM

No, that's not something this Contribution was designed to do. To get rid of the subcategories on the main page, open catalog/index.php and find these lines:
	  $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
	  if ($category_parent['total'] > 0) {
		$category_depth = 'nested'; // navigate through the categories
	  } else {
		$category_depth = 'products'; // category has no products, but display the 'no products' message
	  }
and change to this:
	 $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
//	  if ($category_parent['total'] > 0) 
//		 $category_depth = 'nested'; // navigate through the categories
//	  } else {
		$category_depth = 'products'; // category has no products, but display the 'no products' message
//	  }

That should now show only products. If a category has no products, the page will be empty. I hope that's what you want.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#82   111oneeleven

111oneeleven
  • Members
  • 50 posts
  • Real Name:Adrian

Posted 20 May 2009 - 07:39 AM

View Postkymation, on May 20 2009, 12:46 AM, said:

No, that's not something this Contribution was designed to do. To get rid of the subcategories on the main page, open catalog/index.php and find these lines:
	  $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
	  if ($category_parent['total'] > 0) {
		$category_depth = 'nested'; // navigate through the categories
	  } else {
		$category_depth = 'products'; // category has no products, but display the 'no products' message
	  }
and change to this:
	 $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
//	  if ($category_parent['total'] > 0) 
//		 $category_depth = 'nested'; // navigate through the categories
//	  } else {
		$category_depth = 'products'; // category has no products, but display the 'no products' message
//	  }

That should now show only products. If a category has no products, the page will be empty. I hope that's what you want.

Regards
Jim

Hello Jim,

thank you so much. That is exactly what I wanted to do.  :D I knew that there would be an easy way to cut this off.
With your help, I found out that the information "no products in this category" can be removed too by changing in catalog/index.php
	 $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
//	  if ($category_parent['total'] > 0) 
//		 $category_depth = 'nested'; // navigate through the categories
//	  } else {
		$category_depth = 'products'; // category has no products, but display the 'no products' message
//	  }


to
	 $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
	  $category_parent = tep_db_fetch_array($category_parent_query);
//	  if ($category_parent['total'] > 0) 
//		 $category_depth = 'nested'; // navigate through the categories
//	  } else {
//		$category_depth = 'products'; // category has no products, but display the 'no products' message
//	  }


Thank you again for the support,
Adrian

#83 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 09 June 2009 - 03:56 AM

I've added a floating categories box option. This is similar to the Grid arrangement, except here the number of columns is automatically sized to fit the width of the browser window. The categories each have an optional border that changes color on mouseover. This option is in addition to the options in the previous version.

A live demo is included in the distribution to show how this looks.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#84   shan15

shan15
  • Members
  • 4 posts
  • Real Name:alexander

Posted 16 June 2009 - 02:07 PM

Hello.

i,ve installed your modul. Thank's/ But I have sach problem, when i try to choose "Box frame style" as plain, i get  error
Fatal error: Class 'borderlessBox' not found in C:\WWWROOT\shop\includes\modules\categories_images.php on line 205

I find borderlessBox in categories_images.php

// Output the box in the selected style
      switch (CATEGORIES_IMAGES_BOX_FRAME_STYLE) {
        case 'Plain':
          new borderlessBox ($info_box_contents);
          break;
        case 'Simple':
          new productListingBox ($info_box_contents);
          break;
        case 'Stock':
        default:
          new contentBoxHeading ($info_box_heading, false, false);
          new contentBox ($info_box_contents);
          break;
      }

and i don't understand, why it does'n work?
can you hepl me?

and one more question, where can i change image

Edited by shan15, 16 June 2009 - 02:15 PM.


#85 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 16 June 2009 - 04:30 PM

There's a file missing from the current distribution. Add the following code to the bottom of catalog/includes/classes/boxes.php, just before the final ?>
// Start Categories Images Box
  class borderlessBox extends tableBox {
	function borderlessBox ($contents) {
	  $this->table_parameters = 'class="main"';
	  $this->tableBox ($contents, true);
	}
  }
// End Categories Images Box
You set up your images in Admin -> Catalog -> Categories/Products. Select your category and click Edit.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#86   teochris

teochris
  • Members
  • 25 posts
  • Real Name:teo
  • Gender:Male
  • Location:greece

Posted 16 June 2009 - 10:11 PM

hi! I just installed it BUT i can not see the description of each category in the main index page! Checked and double checked everything BUT i can not see it! I see you wrote that something is missing for the current upped package! Is the only thing that is missing what you write above? Also i can not see float as an option in the style in admin section! I recovered everything from my backups and i will wait for your complete contrib! Thanks for the excelent work! Can i also see the same way the subcategories like the main categories?

Thanks for your time

#87 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 16 June 2009 - 11:41 PM

The box works in my test store. Did you add description text for your categories?

I'll put the revised version up in a minute.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#88 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 16 June 2009 - 11:56 PM

I've uploaded the latest version. This fixes a couple of bugs, including those reported in this thread. Thanks to everyone who posts bug reports and fixes.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#89   shan15

shan15
  • Members
  • 4 posts
  • Real Name:alexander

Posted 17 June 2009 - 06:45 AM

View Postkymation, on Jun 16 2009, 08:30 PM, said:

You set up your images in Admin -> Catalog -> Categories/Products. Select your category and click Edit.

Regards
Jim

I was mistaked. I want to know , where can i change size of the image.

#90   2fix4u

2fix4u
  • Members
  • 77 posts
  • Real Name:Harry
  • Gender:Male
  • Location:EU

Posted 17 June 2009 - 01:03 PM

Hell and thanks for this nice contrib!
I've updated to the last version and it works very well! :rolleyes:  

Now i've got a question: How i can center the categories boxes in categories_images.php when i select box style float in admin settings?
Even better would be if i can select e.g. 3 categories boxes per row and then center the boxes in the categories_images box because i've got not so many categories and it looks not so great when e.g. 3 categories appear in the first row and then only 1 category in the next row on the left side.

Many thanks!

Sorry for my awful english

#91   teochris

teochris
  • Members
  • 25 posts
  • Real Name:teo
  • Gender:Male
  • Location:greece

Posted 17 June 2009 - 01:07 PM

If you want to center categories images in float style:

find in stylesheet.css

float: left;  /* Don't change this */

change to

float: none;


hope this helps

#92   2fix4u

2fix4u
  • Members
  • 77 posts
  • Real Name:Harry
  • Gender:Male
  • Location:EU

Posted 17 June 2009 - 01:20 PM

View Postteochris, on Jun 17 2009, 02:07 PM, said:

If you want to center categories images in float style:

find in stylesheet.css

float: left;  /* Don't change this */

change to

float: none;


hope this helps

Thank you for your fast reply

Your suggestion woks great for IE but in firefox the images are now all in a vertical line :blink:

#93 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 17 June 2009 - 03:02 PM

Yes, there's a reason it says Don't change this. It doesn't work if you change it.

If you want a fixed number of categories in a row, select Grid instead of Float.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#94   2fix4u

2fix4u
  • Members
  • 77 posts
  • Real Name:Harry
  • Gender:Male
  • Location:EU

Posted 17 June 2009 - 04:14 PM

View Postkymation, on Jun 17 2009, 04:02 PM, said:

Yes, there's a reason it says Don't change this. It doesn't work if you change it.

If you want a fixed number of categories in a row, select Grid instead of Float.

Regards
Jim

Thank you, but i like the float view more than grid :blush:
is there really no possibility to change the float mode?

thank you

#95 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 17 June 2009 - 05:59 PM

You can change it to anything you want, as long as there is a way to make HTML/CSS/Javascript do what you want. You always have the option of changing the code yourself. It's Open Source, after all.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#96   eyal_barouk

eyal_barouk
  • Members
  • 33 posts
  • Real Name:Eyal Barouk
  • Gender:Male
  • Location:Isreal

Posted 22 June 2009 - 09:09 AM

Hi,

I have installed and have it working. Looks great!

Problem: I don't see the description for the category image in "Box style = Grid" mode.

Switched to "Box style = Rows" and I can see the desc.
Is there a way to display desc in the grid mode?

What a great contribution!
Thank you,
Eyal
Eyal
How About an Open Source Car?

#97 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 22 June 2009 - 03:15 PM

I didn't put that in because there's not much room to show text in the Grid mode. Figures someone would want it. So, find this code in catalog/includes/modules/categories_images.php (Lines 69-71)
			  $info_box_text .= $category['name'];
			  $space_above = true;
			} //if (CATEGORIES_IMAGES_BOX_SHOW_NAME
and insert this code just after that
	  
			// Show the products description if selected in Admin
			if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION == 'True') {
			  if ($space_above == true) {
				$info_box_text .= '<br>';
			  } // if ($space_above
			  $info_box_text .= $category['description'];
			} //if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION
and you should have your description text. I'll add this to a new version as soon as I get a chance.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#98 ONLINE   Mort-lemur

Mort-lemur
  • Members
  • 1,710 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 23 June 2009 - 09:55 PM

Installed the latest version and now get the following error when trying to access my site:

Fatal error: Cannot redeclare tep_set_banner_status() in /home/suppneqs/public_html/catalog/includes/functions/banner.php on line 15

line 15 of that file reads :

function tep_set_banner_status($banners_id, $status) {

What have I done wrong ??

Thanks
Now running on a fully modded 2.3.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

#99 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 7,798 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 23 June 2009 - 10:07 PM

The most common cause of this is uploading a file to the wrong location, e.g. loading catalog/index.php to catalog/includes/languages/english/index.php. Reloading the correct file will fix this.

You could also have an incorrect edit to catalog/includes/application_top.php, or an incorrect edit to another file that includes application_top.php.You would need to check your edits to find this.

Regards
Jim
My Addons

Banners Box 2.3.x  Support Updated!
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Price in Cart Only/MAPP 2.3.x Support New!
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Superfish Categories Box 2.3x Support New!
Theme Switcher 2.3.x  Support

#100   eyal_barouk

eyal_barouk
  • Members
  • 33 posts
  • Real Name:Eyal Barouk
  • Gender:Male
  • Location:Isreal

Posted 23 June 2009 - 10:19 PM

View Postkymation, on Jun 22 2009, 03:15 PM, said:

I didn't put that in because there's not much room to show text in the Grid mode. Figures someone would want it. So, find this code in catalog/includes/modules/categories_images.php (Lines 69-71)
			  $info_box_text .= $category['name'];
			  $space_above = true;
			} //if (CATEGORIES_IMAGES_BOX_SHOW_NAME
and insert this code just after that
	  
			// Show the products description if selected in Admin
			if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION == 'True') {
			  if ($space_above == true) {
				$info_box_text .= '<br>';
			  } // if ($space_above
			  $info_box_text .= $category['description'];
			} //if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION
and you should have your description text. I'll add this to a new version as soon as I get a chance.

Regards
Jim

Great! Thank you so much Jim.
You were right, I have way to much text going on in my grid now. Time to rephrase some descs I guess...

I would only suggest, if you will allow me, to place the new code after the link closing tag:

$info_box_text .= $category['name'];
$space_above = true;
} //if (CATEGORIES_IMAGES_BOX_SHOW_NAME			
					
			$info_box_text .= '</a>';
// Show the products description if selected in Admin
			if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION == 'True') {
			  if ($space_above == true) {
				$info_box_text .= '<br>';
			  } // if ($space_above
			  $info_box_text .= $category['description'];
			} //if (CATEGORIES_IMAGES_BOX_SHOW_DESCRIPTION

so the description will not show as a link.

Thanks again,
Eyal.

Edited by eyal_barouk, 23 June 2009 - 10:21 PM.

Eyal
How About an Open Source Car?