osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Categories On Front Page

This is a discussion on Categories On Front Page within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Hi all I used a good contrib in OSC to show a picture grid of all categories on the front ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 04-17-2008, 12:46 PM
Lurker
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
oscjww103 is on a distinguished road
Default Categories On Front Page

Hi all I used a good contrib in OSC to show a picture grid of all categories on the front page but can't seem to get it working in OSCMAX. How does this WYSIWYG editor affect changes to the index.php code?


The code I used is below.

PHP Code:
 <table border="0" width="1000" cellspacing="0" cellpadding="10" align="center">
  <
tr>
    <
td width="<?php echo BOX_WIDTH; ?>" valign="top" background="aqb/images/left_column.jpg"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="2" cellpadding="2">
<!-- 
left_navigation //-->
<?php require(DIR_WS_INCLUDES 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
<?php
if ($category_depth == 'nested') {
    
$category_query tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.categories_id = '" . (int)$current_category_id "' and cd.categories_id = '" . (int)$current_category_id "' and cd.language_id = '" . (int)$languages_id "'");
    
$category tep_db_fetch_array($category_query);
?>
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td><h1><?php echo $category['categories_htc_title_tag']; ?></h1></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTHHEADING_IMAGE_HEIGHT); ?></td>
          </tr>
           <?php if (tep_not_null($category['categories_htc_description'])) { ?> 
          <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
          </tr>
<?php if (DISPLAY_CATS_ON_MAIN == 'true'){
        include(
DIR_WS_MODULES FILENAME_CAT_TEXTBOX_MODULE); // added for Subcategory textboxes
    
}
?>
<?php 
if (DISPLAY_CATS_ON_MAIN == 'true'){
        include(
DIR_WS_MODULES FILENAME_CAT_TEXTBOX_MODULE); // added for Subcategory textboxes
    
}
?>
          <tr>
           <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
          </tr>
          <?php ?>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
<?php
    
if (isset($cPath) && strpos('_'$cPath)) {
// check to see if there are deeper categories within the current category
      
$category_links array_reverse($cPath_array);
      for(
$i=0$n=sizeof($category_links); $i<$n$i++) {
        
$categories_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "'");
        
$categories tep_db_fetch_array($categories_query);
        if (
$categories['total'] < 1) {
          
// do nothing, go through the loop
        
} else {
          
$categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
          break; 
// we've found the deepest category the customer is in
        
}
      }
    } else {
      
$categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$current_category_id "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
    }

    
$number_of_categories tep_db_num_rows($categories_query);

    
$rows 0;
    while (
$categories tep_db_fetch_array($categories_query)) {
      
$rows++;
      
$cPath_new tep_get_path($categories['categories_id']);
      
$width = (int)(100 MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
      echo 
'                <td align="center" class="smallText" width="' $width '" valign="top"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '">' tep_image(DIR_WS_IMAGES $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br>' $categories['categories_name'] . '</a></td>' "\n";
      if (((
$rows MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
        echo 
'              </tr>' "\n";
        echo 
'              <tr>' "\n";
      }
    }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 04-17-2008, 03:45 PM
osCMax Testing Team
 
Join Date: Mar 2008
Location: The Netherlands
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Rep Power: 0
Gizmor is on a distinguished road
Default Re: Categories On Front Page

If i read your code quick then i see it isnt following the BTS code that OSCmax uses, so instead of putting it in index.php you should put it in templates/template_name/content/index_nested.tpl.php

but i could be wrong ofcourse.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 04-18-2008, 01:06 AM
Lurker
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
oscjww103 is on a distinguished road
Default Re: Categories On Front Page

Thanks for the suggestion Gizmor - not being familiar with the OSCMAX code I'm struggling to implement it. The default AABOX template doesn't seem to have the index_nested file you mention so i tried the main_page.tpl.php but i'm not sure where to put the code or how much of it i need to copy over
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 04-18-2008, 05:10 AM
osCMax Testing Team
 
Join Date: Oct 2006
Location: Atlanta GA
Posts: 143
Thanks: 8
Thanked 13 Times in 9 Posts
Rep Power: 2
ALElder
Default Re: Categories On Front Page

Then you need to look in:

templates/fallback/content/index_nested.tpl.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 04-18-2008, 05:24 AM
Lurker
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
oscjww103 is on a distinguished road
Default Re: Categories On Front Page

Thanks for the suggestion but adding the code into that file doesn't seem to do anything. Does anyone know how to integrate this contrib?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 04-18-2008, 07:16 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,246
Thanks: 66
Thanked 294 Times in 280 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Categories On Front Page

You have to add the code correctly

See the BTS template primer for info on how to add mods to the template sytem.
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Front Page? justedee osCMax v2 Customization/Mods 1 08-14-2007 09:21 AM
Products/Categories on front page webguy262 osCommerce 2.2 Modification Help 1 08-01-2005 05:45 AM
change front page? lil-raskals osCommerce 2.2 Modification Help 2 09-28-2004 12:19 AM
Products/Categories on front page webguy262 osCommerce 2.2 Modification Help 0 05-12-2004 04:31 PM
Am I right about the front page products? elijahweb osCommerce 2.2 Modification Help 5 01-25-2003 12:35 PM


All times are GMT -8. The time now is 08:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax