Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Setting the number of columns in new_products.php - how?


Guest

Recommended Posts

Posted

Hey,

 

I have completly forgotten how to set the value of how manny columns to show in the new_products.php file (catalog/includes/modules/new_products.php)

 

Its at 3 at the moment, did i set this in Admin somewhere again?

 

 

Thank you very much for reading >_<

Posted

Was it done under Maximum values? Hmm I was picturing something called Default values but cant find it

Posted

Look into your osc Admin->Configuration->Maximum Values->New Products to list per row.

Posted

Address Book Entries 5

Search Results 20

Page Links 5

Special Products 9

New Products Module 18

Products Expected 10

Manufacturers List 0

Manufacturers Select Size 1

Length of Manufacturers Name 15

New Reviews 6

Selection of Random Reviews 10

Selection of Random New Products 10

Selection of Products on Special 10

Categories To List Per Row 3

New Products Listing 9

Best Sellers 10

Also Purchased 6

Customer Order History Box 6

Order History 10

Categories To List Per Row 3

 

 

this is what i have there hmm

Posted

Hi Suzz,

 

this is not an admin setting ... it's directly in the file

catalog/includes/modules/new_products.php

 

right now you should see this

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" width="33%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

$col ++;

if ($col > 2) {

$col = 0;

$row ++;

}

 

change it into this, and you can then either create a key for admin to modify in admin configuration or just plain old hardcode it here:

$howmanycols = '4';

 

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" width="' . round(100/($howmanycols), 0). '%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

$col ++;

if ($col > ($howmanycols - 1)) {

$col = 0;

$row ++;

}

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

That worked, simply magnificent!

 

Thank you very much!

 

Thanks to enigma1 too

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...