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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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. |
|
#2
| |||
| |||
| 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);
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 |
| The Following User Says Thank You to met00 For This Useful Post: | ||
awesomepay (02-14-2008) | ||
|
#3
| |||
| |||
| 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. |
| Thread Tools | |
| |
| ||||
| 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 |