Jump to content

Recommended Posts

Hi Guys,

 

I am playing with the layout in the BS version and was wondering how the number of new products per row is determined as 3

 

In the 2.3.4 standard version it is controlled by this code

      $counter++;

      if ($col === 0) {
        $new_prods_content .= '<tr>';
      }

      $new_prods_content .= '<td width="33%" align="center" valign="top"><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'])) . '</td>';

      $col ++;

      if (($col > 4) || ($counter == $num_new_products)) {
        $new_prods_content .= '</tr>';

        $col = 0;
      }
    }

I have moved the module to above the footer and I would like to increase the amount of products to 5 but can not see where this is located.

 

Any help would be appreciated.

 

Thanks

 

Mark


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

Hi Mark

 

If I'm not mistaken you have to play with the col-xx-xx class setting inside the includes/modules/new_products.php file.

Look for this piece of code around line 25-26

 while ($new_products = tep_db_fetch_array($new_products_query)) {
      $new_prods_content .= '<div class="col-sm-6 col-md-4">';

and change for example the number col-md-4 to col-md-3 (4 products per row) or col-md-2 (6 products per row). The problem that you might encounter is that the name of the product might be too long and break one line down and therefore result in different height sizes and that again results in uneven sizes of boxes that can't align correctly. To fix that you will have to define certain sizes % or px inside the css file.

I have no clue how to achieve 5 products per row though, sorry.

Edited by Tsimi

Share this post


Link to post
Share on other sites

As noted, you have to change the col-xx-xx class, but you will not be able to get five in 1 row. The bootstrap class just doesn't equal out to 5. Every thing divides into 12.

 

So currently you have three as the class is col-md-4  ~ 4/8/12 = 3

 

You can do 4 across by using col-md-3

 

or jump to 6 across by using col-md-2

 

You may also need to adjust the settings in admin/configuration/maximum values/new products module


Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Share this post


Link to post
Share on other sites

Thanks guys,

 

I am still trying to get my head around this whole bootstrap thing lol

 

The next question(s) are

 

1. What is the best way / correct way to add padding/margin to the left and right so it does not look to squished up?

 

2. The correct way to set all boxes to equal height?

 

 


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×