
Originally Posted by
DivaVocals
Okay.. still plugging away at this.. Still have had NO LUCK in fixing the look of the rows view.. I know I could make it work by using the following:
- display: table;
- display: table-row;
- display: table-cell;
I know I need to add additional containers so that I can add the required classes/IDs to use these two elements:
- display: table;
- display: table-row;
Just don't know where/how to accomplish this.. Everything points back to a change that needs to be made in the includes/modules/YOUR_TEMPLATE/product_listing.php file.. Just have no clue WHAT I need to change.. **sigh**

Originally Posted by
DivaVocals
Just wanted to add one more thing.. I KNOW that this is what the HTML output and CSS needs to look like to get the rows view to align correctly.. Still cannot see how to add the parts in red..
Code:
<div class="tabTable"><div class="trRow">
<div class="productListing-heading"> … </div>
<div class="productListing-heading"> … </div>
<div class="productListing-heading"> … </div>
</div>
<div class="trRow">
<div class="productListing-data"> … </div>
<div class="productListing-data"> … </div>
<div class="productListing-data"> … </div>
</div>
</div>
Code:
.tabTable {display: table;}
.trRow {table-row;}
.productListing-data, .productListing-heading {padding: .5em 0;display: table-cell;}
AT LAST a light at the end of the tunnel.. I found the issue and NOW things are working as they should.. I'm quoting my previous posts to try and help make following what I'm doing (or trying to do) a little easier..
After reviewing all the SNAF code plus the changes made to the tpl_tabular_display.php file, I realized that the tableless code I was using has a small modification over the default version which has a BIG impact on the HTML output.. It appears that part of this code strips out the the divs which are supposed to replace the table, table rows, and table data tags and therefore affects the the row layout when viewing the product categories or other product listings in the "rows" view.
Here's the code (quoted below) I used to covert the tpl_tabular_display.php to a tableless layout. I added the the ONE change which SNAF makes to this file to this code..

Originally Posted by
rbarbour
PHP Code:
<?php
/**
* Common Template - tpl_tabular_display.php
*
* This file is used for generating tabular output where needed, based on the supplied array of table-cell contents.
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_tabular_display.php 3957 2006-07-13 07:27:06Z drbyte $
*/
//print_r($list_box_contents);
$cell_scope = (!isset($cell_scope) || empty($cell_scope)) ? 'col' : $cell_scope;
$cell_title = (!isset($cell_title) || empty($cell_title)) ? 'list' : $cell_title;
?>
<div width="100%" id="<?php echo 'cat' . $cPath . 'Table'; ?>" class="tabTable">
<?php
for($row=1; $row<sizeof($list_box_contents); $row++) {
$r_params = "";
$c_params = "";
if (isset($list_box_contents[$row]['params'])) $r_params .= ' ' . $list_box_contents[$row]['params'];
?>
<div <?php echo $r_params; ?>>
<?php
for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
$c_params = "";
$cell_type = ($row==0) ? 'div' : 'div';
if (isset($list_box_contents[$row][$col]['params'])) $c_params .= ' ' . $list_box_contents[$row][$col]['params'];
if (isset($list_box_contents[$row][$col]['align']) && $list_box_contents[$row][$col]['align'] != '') $c_params .= ' align="' . $list_box_contents[$row][$col]['align'] . '"';
if ($cell_type=='div') $c_params .= ' scope="' . $cell_scope . '" id="' . $cell_title . 'Cell' . $row . '-' . $col.'"';
if (isset($list_box_contents[$row][$col]['text'])) {
?>
<?php echo '<' . $cell_type . $c_params . '>'; ?><?php echo $list_box_contents[$row][$col]['text'] ?><?php echo '</' . $cell_type . '>' . "\n"; ?>
<?php
}
}
?>
<br class="clearBoth" />
</div>
<?php
}
?>
</div>
This issue with this code is on Line 22.. Once I changed Line 22 to read:
Code:
for($row=0; $row<sizeof($list_box_contents); $row++) {
and added a little CSS to tidy things up
Code:
.tabTable {display: table;}
.trRow {display: table-row;}
.productListing-data, .productListing-heading/*, a.productListing-heading*/ {
padding: .5em 0;
display: table-cell;
vertical-align: top;
}
a.productListing-heading {
padding: 0em 0.5em;
}
.productListing-data h3, .listingDescription {
margin: 0 0 1em .5em;
}
and now the rows view works as it should..
Here's my FULL tpl_tabular_display.php file (I also removed the line break from this file)
PHP Code:
<?php
/**
* SNAF version 1.2
* Common Template - tpl_tabular_display.php
*
* This file is used for generating tabular output where needed, based on the supplied array of table-cell contents.
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_tabular_display.php 3957 2006-07-13 07:27:06Z drbyte $
*/
//print_r($list_box_contents);
$cell_scope = (!isset($cell_scope) || empty($cell_scope)) ? 'col' : $cell_scope;
$cell_title = (!isset($cell_title) || empty($cell_title)) ? 'list' : $cell_title;
?>
<div id="<?php echo 'cat' . $cPath . 'Table'; ?>" class="tabTable">
<?php
for($row=0; $row<sizeof($list_box_contents); $row++) {
$r_params = "";
$c_params = "";
if (isset($list_box_contents[$row]['params'])) $r_params .= ' ' . $list_box_contents[$row]['params'];
?>
<div class="trRow" <?php echo $r_params; ?>>
<?php
for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
$c_params = "";
$cell_type = ($row==0) ? 'div' : 'div';
if ($current_listing_style == 'columns') $cell_type = 'div'; /*SNAF CHANGES*/
if (isset($list_box_contents[$row][$col]['params'])) $c_params .= ' ' . $list_box_contents[$row][$col]['params'];
if (isset($list_box_contents[$row][$col]['align']) && $list_box_contents[$row][$col]['align'] != '') $c_params .= ' align="' . $list_box_contents[$row][$col]['align'] . '"';
if ($cell_type=='div') $c_params .= ' scope="' . $cell_scope . '" id="' . $cell_title . 'Cell' . $row . '-' . $col.'"';
if (isset($list_box_contents[$row][$col]['text'])) {
?>
<?php echo '<' . $cell_type . $c_params . '>'; ?><?php echo $list_box_contents[$row][$col]['text'] ?><?php echo '</' . $cell_type . '>' . "\n"; ?>
<?php
}
}
?>
</div> <!--end trRow-->
<?php
}
?>
</div> <!--end tabTable-->
I also removed some of the line breaks from the includes/modules/custom_template/product_listing.php file because they affected the grid view especially when I added the price and add to cart elements.
Line 180
Code:
$lc_price = zen_get_products_display_price($listing->fields['products_id']);
Line 212
Code:
$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
Line 272
Code:
$lc_text = implode('', $product_contents);
Now the rows and grid displays are all worked out!! 
I could use a little help to figure out a few final things though..

Originally Posted by
DivaVocals
In the meantime I've run across something else that I STUMPED how to execute..
So in
Configuration > Product Listing
I changed the sort order of the displayed content to the following order:
- product image (Display Product Image)
- product name (Display Product Name)
- price/add to cart (Display Product Price/Add to Cart)
Unfortunately the "
Display Product Name" option also includes the description.. In the grid layout, I'd like to be able to to get the product name to appear above the image and the description to appear below.
Also I'd like to know how to make the "add to cart" button appear below applicable items in the listing and NOT use the top and bottom "
add selected products to cart" button.. Similar to this site:
https://www(dot)ckrccrawlers(dot)com/specials.html. I thought this might be an admin setting.. but darned if I know what it is..