osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

How to display one column on front page?

This is a discussion on How to display one column on front page? within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Does anyone know how to make the file that displays the new products on the front page (/includes/modules/new_products.php) show only ...


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 02-12-2008, 05:54 PM
Lurker
 
Join Date: Sep 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
awesomepay is on a distinguished road
Default How to display one column on front page?

Does anyone know how to make the file that displays the new products on the front page (/includes/modules/new_products.php) show only 1 column? Right now it displays 2.

I tried editing the fields in admin-product listing (Product Display Type (Default = 0 or Columns = 1) and Number of Columns for product listings ) but that did not do the job. I also tried searching the forum for new_products.php and no one has asked this question yet. Any help would be greatly appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 02-13-2008, 10:57 PM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 444
Thanks: 3
Thanked 75 Times in 70 Posts
Rep Power: 6
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: How to display one column on front page?

In what I believe is one of the silliest code decisions in OSC the new, featured and the specials do not call the product_listing_col.php or product_listing.php, but actually duplicate the code in the featured.php and specials.php to do the same thing as product_listing_col.php

Now, if you wanted to do the "right thing" you would pull out the code that builds the table display for new, featured and specials and add a require to product_listing_col.php or product_listing.php that builds the display table. This is a somewhat major hackjob, but will actually make the code more maintainable in the long run. It would also move the code from a module to a function, again, a better way to do it.

Here is the code you will want to hack
Code:
//  $info_box_contents = array();
  $box_content = array();

//  while ($new_products = tep_db_fetch_array($new_products_query)) {
    for ($x = 0; $x < $no_of_new_products; $x++) {
    $new_products[$x]['products_name'] = tep_get_products_name($new_products[$x]['products
_id']);

    $box_content[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" vali
gn="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_
PRODUCT_INFO, 'products_id=' . $new_products[$x]['products_id']) . '">' . tep_image(DIR_WS
_IMAGES . $new_products[$x]['products_image'], $new_products[$x]['products_name'], SMALL_I
MAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INF
O, 'products_id=' . $new_products[$x]['products_id']) . '">' . $new_products[$x]['products
_name'] . '</a><br>' . $currencies->display_price($new_products[$x]['products_price'], tep
_get_tax_rate($new_products[$x]['products_tax_class_id'])));

    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
   } // end for ($x = 0; $x < $no_of_new_products; $x++)
 } //  end if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0)
  new contentBox($box_content);
and specifically here is the hardcode

Code:
$col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to met00 For This Useful Post:
awesomepay (02-14-2008)
  #3  
Old 02-14-2008, 09:03 AM
Lurker
 
Join Date: Sep 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
awesomepay is on a distinguished road
Default Re: How to display one column on front page?

Thanks for the reply. I was finally able to figure it out thanks to you. I greatly appreciate your help. When pouring over all the code, I sometimes get lost in the great abyss - lol.
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
How do you edit title on front page? WildCard osCMax v2 Installation issues 2 06-21-2005 03:06 PM
change front page? lil-raskals osCommerce 2.2 Modification Help 2 09-28-2004 12:19 AM
IP addresses on front page! mikeyboy osCMax v1.7 Discussion 3 01-15-2004 09:57 AM
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 11:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax