Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More Category Boxes


Guest

Recommended Posts

Hello,

 

about sts and this (good) contribution there is something that I dont understand,

I had code in STS's specific files (sts_display_output.php, sts_templare.html) an in column_left.php I put this code

 /* Commented out for More Category Boxes contrib
 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_categories_box();
 } else {
   include(DIR_WS_BOXES . 'categories.php');
 }
// More Category Boxes contrib
*/

// More Category Boxes contrib
$default_category_box_enabled_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_CATEGORY_BOX_ENABLED' ");
$default_category_box_enabled = tep_db_fetch_array($default_category_box_enabled_query);

if ($default_category_box_enabled['configuration_value'] == 'true') {

 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_categories_box();
 } else {
   include(DIR_WS_BOXES . 'categories.php');
 }
}
// STS: ADD
 $sts_block_name = 'categorybox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD
 
// ****
 include(DIR_WS_BOXES . 'more_categories.php');

// STS: ADD
 $sts_block_name = 'categorybox_2';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 

This part of code after // **** must apply specific style for more_categories.php

so it would give the same style for all boxes created because all boxes are managed by more_categories.php, aren't they??

but " style" it's only good for the

first box the second box doesn't have style

 

If anyone can help me please and thanks :blink:

Link to comment
Share on other sites

I am having problems in phpMyAdmin. I had ran the query, sql file named "more_categories-50.sql", when I should have ran "more_categories.sql. I deleted the table from phpMyAdmin and ran "more_categories.sql", but I get an error.

 

Error:

MySQL said: Documentation

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

What do you advise me to do now?

 

Kitti :o

Link to comment
Share on other sites

I am having problems in phpMyAdmin. I had ran the query, sql file named "more_categories-50.sql", when I should have ran "more_categories.sql. I deleted the table from phpMyAdmin and ran "more_categories.sql", but I get an error.

 

Error:

MySQL said: Documentation

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

What do you advise me to do now?

 

Kitti :o

 

Nevermind I got it. When I deleted the more_categories, I forgot to delete the more_categories in the configuration group. After I deleted that group, I then ran the more_categories.sql and the install went fine.

 

Kitti :thumbsup:

Link to comment
Share on other sites

I'm glad you got it, Kitti!  It's always more satisfying to solve your own problems. 

 

-jared

 

I am trying to get this mod to show correctly on the store pages. I am getting the error noted below.

 

Error:

1146 - Table 'progroom_com.TABLE_CATEGORIES_MORE' doesn't exist

 

select * from TABLE_CATEGORIES_MORE where enabled = 1

 

Help please.

 

Kitti

Link to comment
Share on other sites

@kittidid

 

delete following:

 

progroom_com.

 

 

@topic

 

is it possible to integrate multilanguage support?

Edited by ts-coins
Link to comment
Share on other sites

  • 2 weeks later...

Looks like a super contribution.

However I have been looking for ages for a categories box which will only list certain categories selectively....

Look at this site:

 

http://www.hechts.com/gifts/OnlineShopping...&cm_id=hdr_logo

 

Its got a menu bar across the top with main categories and subcategories as dropdowns. When one clicks any main category 'women', for example, on the next page the categories box in the left hand column ONLY shows the categories box and subcategories related to women. And so on.

 

Can I achive this via this contribution? Or is there a contribution our there taht does this? Any advice would be appreciated.

 

Many thanks.

Link to comment
Share on other sites

Mazhar,

 

Unfortunately, this contribution cannot dynamically change which contributions are displayed based on which page you're on. The categories displayed are always the same ones, based on the configuration that you give it.

 

-jared

Link to comment
Share on other sites

Hi Jcall, and thanks for this great contribution.

I am using BTS, and step 4 is a little different than your detailed readme.

this is my admin catalog.php part:

                                  tep_admin_files_boxes(FILENAME_CATEGORIES, BOX_CATALOG_CATEGORIES_PRODUCTS) .

                                  tep_admin_files_boxes(FILENAME_PRODUCTS_ATTRIBUTES, BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES) .

                                  tep_admin_files_boxes(FILENAME_MANUFACTURERS, BOX_CATALOG_MANUFACTURERS) .

                                  tep_admin_files_boxes(FILENAME_REVIEWS, BOX_CATALOG_REVIEWS) .

                                  tep_admin_files_boxes(FILENAME_SPECIALS, BOX_CATALOG_SPECIALS) .

          tep_admin_files_boxes(FILENAME_XSELL_PRODUCTS, BOX_CATALOG_XSELL_PRODUCTS) .

          tep_admin_files_boxes(FILENAME_EASYPOPULATE, BOX_CATALOG_EASYPOPULATE) .

          tep_admin_files_boxes(FILENAME_DEFINE_MAINPAGE, BOX_CATALOG_DEFINE_MAINPAGE) .

          tep_admin_files_boxes(FILENAME_NEW_ATTRIBUTES, BOX_CATALOG_ATTRIBUTE_MANAGER) .

          tep_admin_files_boxes(FILENAME_MORE_CATEGORIES, BOX_CATALOG_MORE_CATEGORIES) .

                                  tep_admin_files_boxes(FILENAME_PRODUCTS_EXPECTED, BOX_CATALOG_PRODUCTS_EXPECTED));

I am not sure what i did wrong, but step 2 of configuration doesnt show up.

Thanks for your help.

Link to comment
Share on other sites

Recommended:

Kitti, run the portion of the SQL file that starts with:

 

DROP TABLE IF EXISTS `categories_more`;

 

-jared

 

I did just as you recommended. I am still getting the same error. Also, in the admin, when I click on more categories, I see 2 rows of "Enable Default Category Box". I don't think I should have 2.

 

I have tried and tried to get this contribution to work for me. I am totally not getting it. Don't know what to do at this point except to await somebody's help.

 

Any help appreciated.

 

Kitti

Edited by kittidid
Link to comment
Share on other sites

  • 3 weeks later...

Hi Jcall,

 

Looks a great contribution and thanks for your hard work.

 

However to test it I've installed on a clean osCommerce MS2 and everything works great except

the

red lighting from class="errorText"
for Categories ( the code is from Category Box Enhancement).

 

It's a small thing but i can't find where is the problem.

I have disactivated the standard category box, looked in the code, changed the styles - always is the the same thing. The color of the Categories remain always black.

 

I surely omit something.

 

Thanks in advance and best regards.

My Contributions:

 

 

New Attributes Manager+Sort v1.0

http://www.oscommerce.com/community/contributions,3301/

Bulgarian Language Total Pack

http://www.oscommerce.com/community/contributions,3261/

Link to comment
Share on other sites

Nobody has found a similar problem?

 

It doesn't matter if I change the code with pure HTML - the categories lighting always remain the same - standard black.

 

???

 

Best regards

My Contributions:

 

 

New Attributes Manager+Sort v1.0

http://www.oscommerce.com/community/contributions,3301/

Bulgarian Language Total Pack

http://www.oscommerce.com/community/contributions,3261/

Link to comment
Share on other sites

I'm sorry, Kiril - - I've seen this problem before, but just not had time to chase it down. I'll see if I can get it addressed in the next few days.

 

Feel free to hassle me if I'm taking too long.

 

-jared

Link to comment
Share on other sites

I'm sorry, Kiril - - I've seen this problem before, but just not had time to chase it down.  I'll see if I can get it addressed in the next few days.

 

Feel free to hassle me if I'm taking too long.

 

-jared

 

Hi Jared,

 

first of all thanks for the respone.

 

Well i found a some kind of solution but it isn't the best variant.

 

// commented for CategoryBox Enhancement      $categories_string .= '<b>' . $tree[$counter]['name'] . '</b>';
     $categories_string .= '<b>';
     
// CategoryBox Enhancement  
     if ($cat_name == $tree[$counter]['name']) {
       $categories_string .= '<span class="errorText">';
        }
// CategoryBox Enhancement  
     
     $categories_string .= $tree[$counter]['name'];

// CategoryBox Enhancement        
 if ($cat_name == $tree[$counter]['name']) {
	 $categories_string .= '</span>';
          }
// CategoryBox Enhancement      

     $categories_string .= '</b>';
    }

   else
   {
// CategoryBox Enhancement  
     if ($cat_name == $tree[$counter]['name']) {
       $categories_string .= '<b><span class="errorText">';
        }
// CategoryBox Enhancement  

     $categories_string .= $tree[$counter]['name'];
     
// CategoryBox Enhancement        
 if ($cat_name == $tree[$counter]['name']) {
	 $categories_string .= '</span></b>';
          }
// CategoryBox Enhancement  

 

I've changed to this:

 

// commented for CategoryBox Enhancement      $categories_string .= '<b>' . $tree[$counter]['name'] . '</b>';
     $categories_string .= '<b><font color="red">';
     
// CategoryBox Enhancement  
     if ($cat_name == $tree[$counter]['name']) {
       $categories_string .= '<span>';
        }
// CategoryBox Enhancement  
     
     $categories_string .= $tree[$counter]['name'];

// CategoryBox Enhancement        
 if ($cat_name == $tree[$counter]['name']) {
	 $categories_string .= '</span>';
          }
// CategoryBox Enhancement      

     $categories_string .= '</font></b>';
    }

   else
   {
// CategoryBox Enhancement  
     if ($cat_name == $tree[$counter]['name']) {
       $categories_string .= '<b><font color="red">';
        }
// CategoryBox Enhancement  

     $categories_string .= $tree[$counter]['name'];
     
// CategoryBox Enhancement        
 if ($cat_name == $tree[$counter]['name']) {
	 $categories_string .= '</font></b>';
          }
// CategoryBox Enhancement    

 

In this mode the Redlighting works but the Main Category remain red too when you go in some SubCategory.

 

For me it's better than first.

I'm still don't understand why exist this STYLES dependence from the standard Category infobox.

 

Best regards.

My Contributions:

 

 

New Attributes Manager+Sort v1.0

http://www.oscommerce.com/community/contributions,3301/

Bulgarian Language Total Pack

http://www.oscommerce.com/community/contributions,3261/

Link to comment
Share on other sites

Hi Jared,

 

I am well pleased with this contrib!

 

However I do have one little problem. I have changed the infobox header to an image using this code

 

    $info_box_contents = array();
   $info_box_contents[] = array('text' => new_tep_show_category($boxId,$cPath_array,$tree,$first_element));

   new infoBox($info_box_contents);
 }

?>
<!-- categories //-->
         <tr>
           <td>

<TABLE WIDTH=162 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
 <TD COLSPAN=3>
	 <IMG SRC="images/boxes/table_simfree.gif" WIDTH=162 HEIGHT=25></TD>
</TR>
<?php

 $_infoBox = array();

//  define('TABLE_CATEGORIES_MORE','categories_more');

 $categories_this_infobox_query = tep_db_query("select * from " . TABLE_CATEGORIES_MORE . " where enabled = 1");

 while ($_categories = tep_db_fetch_array($categories_this_infobox_query))

 

and I have closed all the tables etc at the bottom of the file, the problem is that when the category box is disabled the header image still shows.

 

I presume this has something to with the way it is called in column_left.

 

Can you shed me some light on how to correct this so that when the box is disabled so is the header.

 

You can see an example here

 

Thanks

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

As well as my problem above, is there anyway to stop the categories shown in the more_categories box showing in the regular categories box apart from using an earlier suggestion in this thread about making all category boxes more_categories and removing the regular box.

 

I hope that made sense!

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Mark,

 

Regarding the image: enclose your HTML code that calls the image in this:

<?php if (DEFAULT_CATEGORY_BOX_ENABLED == 'true') 
{
?>

<insert code that calls your header image>

<?php 
}
?>

 

Regarding putting constraints on the "regular" categories infobox: Just disable it. Admin >> Configuration >> More Categories. You can simply create a new categories box, with the title you want, with the categories inside it that you want.

 

 

 

Cleve (and others) who would like to disable the ?infoBox=x in the URL: In includes/boxes/more_categories.php, change this:

    $categories_string .= tep_href_link(FILENAME_DEFAULT, 'infoBox=' . $boxId . '&' . $cPath_new) . '">';

to this:

 
//    $categories_string .= tep_href_link(FILENAME_DEFAULT, 'infoBox=' . $boxId . '&' . $cPath_new) . '">';
   $categories_string .= tep_href_link(FILENAME_DEFAULT, '&' . $cPath_new) . '">';

 

 

NOTE: The purpose of the ?infoBox= variable in the URL is so that if you list the same item in several of the more_categories infoboxes, the code knows in which box to expand to the subcategories (if any). If you don't need to display the same data in several boxes, then you can use the code change above.

 

Now that I think about it, it may be more common to NOT list a category in 2 boxes. If you agree, then I'll change the default behavior to work as above, and document the change in the readme (for those who want/need to change it back).

 

What say ye?

 

-jared

 

P.S. On my medium-long term list of things to do is add header image functionality to this contrib. In other words, I want to be able to specify a header image (that you've created) for each infobox. Whaddya think?

Edited by jcall
Link to comment
Share on other sites

Regarding the image: enclose your HTML code that calls the image in this:

CODE

<?php if (DEFAULT_CATEGORY_BOX_ENABLED == 'true')

{

?>

 

<insert code that calls your header image>

 

<?php

}

?>

 

Hi Jared,

 

Thanks for your time, I will try the above code.

 

Regarding putting constraints on the "regular" categories infobox: Just disable it. Admin >> Configuration >> More Categories. You can simply create a new categories box, with the title you want, with the categories inside it that you want.

 

The only problem I will have if I disable the original categories box and use the more_categories instead is that I have different images for the the headers of the boxes.

 

Any way around this?

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hi,

 

I am hoping for a bit of help as I am now quite lost!

 

I am trying to acheive different header images for different boxes, I have tried to use the code from the array to acheive this but I either end up with all boxes with the same header image or no images at all.

 

This is the code from the array

 

    $_infoBox[] = array(
     'categories' => array(
       $_categories['category1_id'],
       $_categories['category2_id'],
       $_categories['category3_id'],
       $_categories['category4_id'],
       $_categories['category5_id'],
       $_categories['category6_id'],
       $_categories['category7_id'],
       $_categories['category8_id'],
       $_categories['category9_id'],
       $_categories['category10_id'],
       $_categories['category11_id'],
       $_categories['category12_id'],
       $_categories['category13_id'],
       $_categories['category14_id'],
       $_categories['category15_id'],
       $_categories['category16_id'],
       $_categories['category17_id'],
       $_categories['category18_id'],
       $_categories['category19_id'],
       $_categories['category20_id'],
       $_categories['category21_id'],
       $_categories['category22_id'],
       $_categories['category23_id'],
       $_categories['category24_id'],
       $_categories['category25_id'],
     ),
     'name'    => $_categories['infobox_name'],
     'enabled' => $_categories['enabled']
   );

 

and this is the code I have so far (minus my feable attempts at filling the if statement)

 

<table width=162 border=0 cellpadding=0 cellspacing=0>
<?php
  if (*********************) {
?>
        <tr>
           <td>
              <table width=162 border=0 cellpadding=0 cellspacing=0>
            <tr>
         <td colspan=3>
          <img src="images/boxes/table_simfree.gif" width=162 height=18></td>
    </tr>
<?php
  }elseif (*********************) {

?>
         <tr>
           <td>
              <table width=162 border=0 cellpadding=0 cellspacing=0>
           <tr>
       <td colspan=3>
         <img src="images/boxes/table_categories.gif" width=162 height=25></td>
    </tr>
<?php
  }elseif (********************) {

?>
         <tr>
           <td>
              <table width=162 border=0 cellpadding=0 cellspacing=0>
           <tr>
       <td colspan=3>
        <img src="images/boxes/table_unlock.gif" width=162 height=25></td>
    </td>

<?php
}
?>
</table></td></tr>

 

If anyone could help with this then it would help me a great deal and save me lots of hair!

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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