Zen Cart Logo

New products margin

Locked

Views: 979

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
16 Feb 2009, 11:59 PM
#1
sollynz avatar

sollynz

New Zenner

Join Date:
Jan 2007
Posts:
16
Plugin Contributions:
0

New products margin

Hey again, sorry im going to be asked alot of questions if thats okay ^_^

Ok what i have is featured product at the top which only displays one product,

Under is a row of 3 products each product has a margin-right: of 10px;

How do i make it so that the third product doesnt have any margin so it can sit flush up against the edge of its frame.

Picture attached shows example of what i want it to look like and here is a link to what ive got so far.

http://feed.office.bunkermedia.co.nz/

Cheers :)

17 Feb 2009, 4:36 AM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: New products margin

You're going to have to do some tweaking of your new_products module and stylesheet.
First off, edit an override copy of includes/modules/new_products.php
Find the line of code that starts with:

$list_box_contents[$row][$col] = array

Now you're going to want a little extra code here so that if you are adding content to the last column in the row, you want to specify a different css class to the container.
So, before that line of code specified above, add this:

    if ($col == (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS-1)) {
      $content_class = 'class="centerBoxContentsNew centeredContent back"';
    } else {  
      $content_class = 'class="myNewStylesheetClass"';
    }

where myNewStylesheetClass is whatever you want to use in your stylesheet

Now, edit the next line of code:

$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',

so it reads like this:

$list_box_contents[$row][$col] = array('params' => $content_class . ' ' . 'style="width:' . $col_width . '%;"',

Now you just need to add the new class to your stylesheet, duplicating most of what was already there for .centerBoxContentsNew, but so there's no right padding or margin. You may have to tweak the original settings for .centerBoxContentsNew as well till you get the results you want.