Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

grayson

Archived
  • Posts

    44
  • Joined

  • Last visited

Everything posted by grayson

  1. Thanks for a great contribution - I installed it tonight and it works beautifully. (Small apostrophe issue, but I know I read about that somewhere in this thread before I installed, so that's just a matter of going back through the posts after I've gotten some sleep.) One thing I did want to mention, however, is that despite having read that Easy Populate won't work with multiple entries for the same item (with the same product_model number) in the file to upload, I tried it anyway -- and it worked just fine! I stuck in an item twice, in two consecutive rows in the spreadsheet file, with identical information except for the category where it should go. EP added the product to both categories as a link (not two individual copies -- this is just the behavior I wanted). I guess it pays to try to break the rules after all :-). I don't know if somewhere in this thread there's a post saying someone added this functionality along the line somewhere, but if so, I just wanted to shout out a big THANKS, because it's wonderful. And if no one did add this functionality, then I don't know why it's working for me, but I sure hope it keeps on working. I'd be interested to hear if it works for others, too. I installed version 2.76b from 30 Apr 2005, by the way. Regards, --Grayson
  2. First: Many thanks for a very nice contribution. This post contains a simple modification to the categories_subtab.php file in this contribution, to highlight the subcategory currently being viewed. Background: Since I removed the categories box and the breadcrumb trail after adding this tabs contribution, I also wanted to have the current subcategory highlighted, so the visitor can still easily see where he/she is in the site. I searched to see if someone had already come up with a solution, but didn't find anything. Turns out it's a much simpler fix than I had envisioned -- in fact, it's the same trick that highlights the current subcategory in the original categories box in categories.php. To add highlighting in the subcategory bar, in the file [store path]/includes/categories_subtab.php, replace (around line 27): // display category name $subcategories_string .= $fooa[$counter]['name']; with if ( ($id) && (in_array($counter, $id)) ) { $subcategories_string .= "<b>"; } // display category name $subcategories_string .= $fooa[$counter]['name']; if ( ($id) && (in_array($counter, $id)) ) { $subcategories_string .= "</b>"; } That's all there is to it! Regards, --Grayson
  3. I had a small error which prevented the lines between top-level categories from showing as they should in Categories_tree. In [path to catalog]/includes/boxes/categories.php, change (on line 39 if you're using an exact replica of the categories.php from the previous post): if ($level{$categories['categories_id']} == 0) to if (($level{$categories['categories_id']}-1) == 0) This change to the Bullet and Line code is necessary because in the merged version, the Categories_tree code increments $level{$categories['categories_id']} before Bullet and Line gets a chance to check it. Regards, --Grayson
  4. Reposting this in new, aptly-named thread so as to make it easier to find when searching. Read this post for a categories.php file which combines the two contributions Categories_tree and Categories Box Bullet and Line. Hope this is useful for someone. Regards, Grayson
  5. Yesterday I said: Went ahead and reinvented the wheel. To use Categories_tree with Categories Box Bullet and Line on osc2.2M2, install the categories_tree contrib first, then make the changes to it shown below between "for BLC" and "end BLC" (alternatively, just copy the file here in its entirety): <?php /* $Id: categories.php,v 1.17 2002/03/07 20:53:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2001 osCommerce Released under the GNU General Public License */ // Categories_tree written by Gideon Romm from Symbio Technologies, LLC function tep_show_category($cid, $cpath, $COLLAPSABLE) { global $categories_string, $languages_id, $HTTP_GET_VARS, $aa; global $level; $selectedPath = array(); // Note: $aa is used only for Bullet Line contribution (BLC) // Get all of the categories on this level $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 = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; } $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1; // Add category link to $categories_string for ($a=1; $a<$level{$categories['categories_id']}; $a++) { $categories_string .= " "; } // for BLC // if ($foo[$counter]['level'] == 0) :updated with this file's var names below if ($level{$categories['categories_id']} == 0) { if ($aa == 1) { $categories_string .= "<hr>"; } else {$aa=1;} } // end BLC // for BLC // $categories_string .= '<a href="'; $categories_string .= '<nobr><a nowrap href="'; // end BLC $cPath_new = $cpath; if ($level{$categories['parent_id']} > 0) { $cPath_new .= "_"; } $cPath_new .= $categories['categories_id']; $cPath_new_text = "cPath=" . $cPath_new; $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text); // for BLC // $categories_string .= '">'; $categories_string .= '">' . tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif', '') . ' ';; // end BLC if ($HTTP_GET_VARS['cPath']) { $selectedPath = split("_", $HTTP_GET_VARS['cPath']); } if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '<b>'; } if ($level{$categories['categories_id']} == 1) { $categories_string .= '<u>'; } $categories_string .= $categories['categories_name']; if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string .= ' ->'; } if ($level{$categories['categories_id']} == 1) { $categories_string .= '</u>'; } if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '</b>'; } $categories_string .= '</a>'; if (SHOW_COUNTS) { $products_in_category = tep_count_products_in_category($categories['categories_id']); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '<br>'; // If I have subcategories, get them and show them if (tep_has_category_subcategories($categories['categories_id'])) { if ($COLLAPSABLE) { if (in_array($categories['categories_id'], $selectedPath)) { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); } } else { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); } } } } ?> <!-- categories //--> <tr> <td> <?php // for BLC $aa = 0; // end BLC $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES ); new infoBoxHeading($info_box_contents, true, false); $categories_string = ''; // tep_show_category(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>) tep_show_category(0,'',0); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => $categories_string ); new infoBox($info_box_contents); ?> </td> </tr> <!-- categories_eof //--> hope this helps someone. Regards, Grayson
  6. Dear Steve, I just installed the contribution and it looks great. Thanks for your work, and for all your support in this thread. I have a question about using this contribution together with something like the categories_tree contribution, which forces all categories and subcategories to show always. A similar question has already come up in this thread: But I haven't seen an answer come by, so I thought I'd ask if you (or someone else) had merged the two contributions or otherwise had a solution, so as to avoid reinventing the wheel :D . Many thanks, Grayson Morris
×
×
  • Create New...