Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / line spacing in product listing

line spacing in product listing

Locked

Views: 2,430

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
22 Sep 2006, 5:10 AM
#1
p_m avatar

p_m

New Zenner

Join Date:
Sep 2006
Posts:
27
Plugin Contributions:
0

line spacing in product listing

i'm trying to adjust the line spacing between the product listing as it appears on a category page.

in the shop, there's a category "prints", and shop-->prints shows the array of individual prints in that category. i'm using product listing in columns, 3 per row. you can see the page here.

i just want the product image, name, price, and more info button (i've replaced the text defined with an image), one per row. i only want a single line break between each. below the last element (the more info button) i want a nice 2-3 space gap separating it from the lower product row.

so: image/name/price/"more info"/(2-3 breaks)

i've being trying to edit includes/modules/product_listing.php to create this effect. i found a break tag at the end of the "case: PRODUCT_LIST_PRICE" line and took that out. i also added a break tag to the end of the line defining the "more info" button.

but i can't figure out how to get the space out from between the product name and the price! i've got this pattern:
image/name/(break)/price/"more info"/(2-3 breaks)

the relevant block of code is:

$product_contents = array(); // Used For Column Layout (Grid Layout) Add on module

    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
      $lc_align = '';

      switch ($column_list[$col]) {
        case 'PRODUCT_LIST_MODEL':
          $lc_align = '';
          $lc_text = $listing->fields['products_model'];
          break;
        case 'PRODUCT_LIST_NAME':
          $lc_align = '';
          if (isset($_GET['manufacturers_id'])) {
            $lc_text = '<h4 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h4><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
          } else {
            $lc_text = '<h4 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h4><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
          }
          break;
        case 'PRODUCT_LIST_MANUFACTURER':
          $lc_align = '';
          $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
          break;
        case 'PRODUCT_LIST_PRICE':
          $lc_price = zen_get_products_display_price($listing->fields['products_id']);
          $lc_align = 'right';
          $lc_text =  $lc_price;

the lines "break;" seem to separate the cases defined. taking them out has no effect on spacing. i never use the manufacturers option, so i tried taking that out -- no effect.

any ideas?

22 Sep 2006, 5:25 AM
#2
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: line spacing in product listing

The topic below may has the info. you want.
adjust spacing on Column Layout Grid - HELP!

.

22 Sep 2006, 6:34 AM
#3
p_m avatar

p_m

New Zenner

Join Date:
Sep 2006
Posts:
27
Plugin Contributions:
0

Re: line spacing in product listing

thanks for the quick reply.

the code you offered on the other thread...

.centerBoxContentsProducts .itemTitle {
margin-bottom: -1em;
}

...worked perfectly.

i added the new class at the end of the /list box contents/ in stylesheet.css

thanks for your help!

22 Sep 2006, 7:07 AM
#4
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: line spacing in product listing

Glad to hear you had the problem sorted. :smile: