Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    16
    Plugin Contributions
    0

    Default 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 :)
    Attached Images Attached Images  

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default 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:
    Code:
    $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:
    Code:
        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:
    Code:
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    so it reads like this:
    Code:
    $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.
    Last edited by bunyip; 17 Feb 2009 at 05:40 AM. Reason: code correction
    Neville
    An assumption is what you arrive at when you get tired of thinking...

 

 

Similar Threads

  1. v150 Products Profit/Margin Calculator + Report
    By jfreeman in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Sep 2012, 11:35 AM
  2. Bottom Margin on Whats New Product Boxes
    By wotnow in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Jul 2010, 12:01 PM
  3. Margin between products
    By NateL in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 20 Apr 2009, 03:28 AM
  4. Margin Left of New Product Images:
    By limelites in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 3 Feb 2009, 03:49 AM
  5. Right Margin and New Products Issue
    By trisha1581 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Jan 2007, 12:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg