Snaf

Views: 40,728

Results 201 to 220 of 298
2 Nov 2013, 11:18 PM
#201
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Snaf

DivaVocals:

So I finally have hit a snag using SNAF.. I've always preferred this module of the Column Product Listings mod because Column Product Listing module only converts the category product listing into grid listings, whereas SNAF covers ALL products listings including the Specials, Feature, and New Products listings..

The issue I've run into with SNAF is the tables used to create the grids.. It looks like code that drive this are in these files:
includes/templates/custom_template/common/tpl_columnar_display.php
includes/templates/custom_template/common/tpl_tabular_display.php

I need to convert the tables to a CSS grid like the one used for the category listings in the Column Product Listings mod. Otherwise this mod will be a bit of a bear to deal with in responsive templates..

I've been staring at the code in these two files hoping to "figure it out", but I am waving the white flag and admitting that I haven't a CLUE here.. Hoping that if not niccol, that some kind community member can help me with the changes I need to make..

I prefer flexible product listing over both but that is here nor there.

I have converted the tables for you (done previously):

<?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 requires additional css to make work. I do not have a clean version but you can check the source code out here: www[.]zcadditions[.]com/9172013/index.php?main_page=index&cPath=12_13

3 Nov 2013, 3:24 AM
#202
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

I appreciate the hand.. I prefer SNAF because while I know (based on the author) that "Flexible Product Listing" is very well written, my understanding is that "Flexible Product Listing" only applies a grid layout option to the product category listings. SNAF on the other hand also allows me to apply a grid layout to the Specials, New Products, All Products, and Featured Product listings as well.

That said, not sure if the change to the includes/templates/custom_template/common/tpl_tabular_display.php alone will work with SNAF.

SNAF makes modifications to both of these files:
includes/templates/custom_template/common/tpl_columnar_display.php
includes/templates/custom_template/common/tpl_tabular_display.php

Your posted edit to the includes/templates/custom_template/common/tpl_tabular_display.php is based on the default version.. the SNAF version of this file only makes one small edit to this file.. I've combined it with your edits and this is the result (SNAF changes are highlighted in red):

<?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';

[B]if ($current_listing_style == 'columns') $cell_type = 'td'; /*SNAF CHANGES*/[/B]
      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>

I'm assuming that logically, this change should look like this to work with your edits:

[B]if ($current_listing_style == 'columns') $cell_type = 'div'; /*SNAF CHANGES*/[/B]

However the listing grids for Specials, New Products, All Products, and Featured Product listings in SNAF comes from the changes to the includes/templates/custom_template/common/tpl_columnar_display.php file. This is the file with the major SNAF changes, and it's the one I'm unsure of how to convert..

<?php
/**
 * Common Template - tpl_columnar_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_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $
 */

?>
<?php
  if ($title) {
  ?>
<?php echo $title; ?>
<?php
 }
 ?>
  <div class="centerBoxWrapperContents">
<table width="100%" align="center" cellpadding="1" cellspacing="15" border="0">

<?php
if (is_array($list_box_contents) > 0 ) {

$MaxCol=0;
 for($row=0;$row<sizeof($list_box_contents);$row++) {
    $params = "";
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
?>
<tr>
<?php
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
      $r_params = "";
      if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
     $r_params = str_replace(" back", "", $r_params);
     $r_params = str_replace("50", "100", $r_params);
     $r_params = str_replace("33", "100", $r_params);
     
     // bof: Replace all widths with 100% for Column Divider Pro
     $startpos = strpos($r_params, "width:");
     if ($startpos != false) {
        $endpos = strpos($r_params, ";", $startpos);
        $res = substr($r_params, $startpos, ($endpos - $startpos ));
        $r_params = str_replace($res, "width:100%", $r_params);
     }
     // eof: Replace all widths with 100% for Column Divider Pro
     
     if (isset($list_box_contents[$row][$col]['text'])) {
?>
    <?php 
    echo '<td width="'. (intval($col_width) - 0.5) .'%" align="center" valign="top"><div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] .  '</div></td>' . "\n";
     ?>
    <?php if ($row == 0 && $col < (sizeof($list_box_contents[$row]) - 1)) {
            echo '<td class="vDotLine" rowspan="' . ((sizeof($list_box_contents))*2) . '"></td>' . "\n";
              $MaxCol += 1;
          }

      }
    }
?>

</tr>

<?php 
    if ($row < (sizeof($list_box_contents)-1)) {?>
<tr>
    <?php    for($col=0;$col<($MaxCol + 1);$col++) {
      echo '<td class="hDotLine"></td>';
    } ?>
</tr>
<?php    }
    ?>


<?php
  }
}
?>
</table>
 </div>

rbarbour:

I prefer flexible product listing over both but that is here nor there.

I have converted the tables for you (done previously):

This requires additional css to make work. I do not have a clean version but you can check the source code out here: www[.]zcadditions[.]com/9172013/index.php?main_page=index&cPath=12_13

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 5:35 AM
#203
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

So I've made some progress, but I'm not quite there yet.. I have incorporated the Column Divider Pro module with SNAF, and the column dividers are not behaving EXACTLY as they should with the CSS tables and I'm puzzled how to fix it.. The horizontal dividers is repeated 4 times, and I cannot get the vertical dividers to work just on the between the inner cells.. (my current edit only displays them on the left -- I commented out the code which is supposed to display it between cells because it didn't work) You can see my progress here:
http://eitestsite(dot)eyeitalia(dot)com/shop/index.php?main_page=products_all

Here's my modified includes/templates/custom_template/common/tpl_columnar_display.php file and the CSS to support my changes:
Supporting CSS

.vDotLine
{
    background-color: transparent;
    background-image: url(../images/delim_v.gif);
    background-repeat: repeat-y;
    background-attachment: scroll;
    width: 20px;
    /*font-size: 1px;*/
}

.hDotLine
{
    background-image: url(../images/delim_v.gif);
    padding:1px 0;
}

.tabTable {display: table;padding-left: 20px;/*font-size: 8pt;*/}
.trRow {display: table-row;}
.tdContent {display: table-cell;padding: 5px 8px;}

tpl_columnar_display.php changes

<?php
/**
 * Common Template - tpl_columnar_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_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $
 */

?>
<?php
  if ($title) {
  ?>
<?php echo $title; ?>
<?php
 }
 ?>
  <div class="centerBoxWrapperContents">
<div class="tabTable">

<?php
if (is_array($list_box_contents) > 0 ) {

$MaxCol=0;
 for($row=0;$row<sizeof($list_box_contents);$row++) {
    $params = "";
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
?>
<div class="trRow">
<?php
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
      $r_params = "";
      if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
     $r_params = str_replace(" back", "", $r_params);
     $r_params = str_replace("50", "100", $r_params);
     $r_params = str_replace("33", "100", $r_params);
     
     // bof: Replace all widths with 100% for Column Divider Pro
     $startpos = strpos($r_params, "width:");
     if ($startpos != false) {
        $endpos = strpos($r_params, ";", $startpos);
        $res = substr($r_params, $startpos, ($endpos - $startpos ));
        $r_params = str_replace($res, "width:100%", $r_params);
     }
     // eof: Replace all widths with 100% for Column Divider Pro
     
     if (isset($list_box_contents[$row][$col]['text'])) {
?>
    <?php 
    echo '<div class="tdContent vDotLine" style="width:'. (intval($col_width) - 0.5) .'%">' . $list_box_contents[$row][$col]['text'] .  '</div>' . "\n";
     ?>
    <?php if ($row == 0 && $col < (sizeof($list_box_contents[$row]) - 1)) {
//            echo '<div class="tdContent vDotLine"></div>' . "\n";
              $MaxCol += 1;
          }

      }
    }
?>

</div> <!--end trRow-->

<?php 
    if ($row < (sizeof($list_box_contents)-1)) {?>
<div class="trRow">
    <?php    for($col=0;$col<($MaxCol + 1);$col++) {
      echo '<div class="tdContent hDotLine"></div>';
    } ?>
</div> <!--end trRow-->
<?php    }
    ?>


<?php
  }
}
?>
</div> <!--end table-->
 </div>

DivaVocals:

I appreciate the hand.. I prefer SNAF because while I know (based on the author) that "Flexible Product Listing" is very well written, my understanding is that "Flexible Product Listing" only applies a grid layout option to the product category listings. SNAF on the other hand also allows me to apply a grid layout to the Specials, New Products, All Products, and Featured Product listings as well.

That said, not sure if the change to the includes/templates/custom_template/common/tpl_tabular_display.php alone will work with SNAF.

SNAF makes modifications to both of these files:
includes/templates/custom_template/common/tpl_columnar_display.php
includes/templates/custom_template/common/tpl_tabular_display.php

Your posted edit to the includes/templates/custom_template/common/tpl_tabular_display.php is based on the default version.. the SNAF version of this file only makes one small edit to this file.. I've combined it with your edits and this is the result (SNAF changes are highlighted in red):

<?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';

[B]if ($current_listing_style == 'columns') $cell_type = 'td'; /SNAF CHANGES/[/B]
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> ``` > I'm assuming that logically, this change should look like this to work with your edits: > ``` [B]if ($current_listing_style == 'columns') $cell_type = 'div'; /*SNAF CHANGES*/[/B] ``` > > However the listing grids for Specials, New Products, All Products, and Featured Product listings in SNAF comes from the changes to the includes/templates/custom_template/common/tpl_columnar_display.php file. This is the file with the major SNAF changes, and it's the one I'm unsure of how to convert.. > > ``` <?php /** * Common Template - tpl_columnar_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_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $ */

?>

<?php if ($title) { ?> <?php echo $title; ?> <?php } ?> <div class="centerBoxWrapperContents"> <table width="100%" align="center" cellpadding="1" cellspacing="15" border="0"> <?php if (is_array($list_box_contents) > 0 ) { $MaxCol=0; for($row=0;$row<sizeof($list_box_contents);$row++) { $params = ""; //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params']; ?> <tr> <?php for($col=0;$col<sizeof($list_box_contents[$row]);$col++) { $r_params = ""; if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params']; $r_params = str_replace(" back", "", $r_params); $r_params = str_replace("50", "100", $r_params); $r_params = str_replace("33", "100", $r_params);
 // bof: Replace all widths with 100% for Column Divider Pro
 $startpos = strpos($r_params, "width:");
 if ($startpos != false) {
    $endpos = strpos($r_params, ";", $startpos);
    $res = substr($r_params, $startpos, ($endpos - $startpos ));
    $r_params = str_replace($res, "width:100%", $r_params);
 }
 // eof: Replace all widths with 100% for Column Divider Pro
 
 if (isset($list_box_contents[$row][$col]['text'])) {

?>
<?php echo '<td width="'. (intval($col_width) - 0.5) .'%" align="center" valign="top"><div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] . '</div></td>' . "\n"; ?>
<?php if ($row == 0 && $col < (sizeof($list_box_contents[$row]) - 1)) {
echo '<td class="vDotLine" rowspan="' . ((sizeof($list_box_contents))*2) . '"></td>' . "\n";
$MaxCol += 1;
}

  }
}

?>

</tr> <?php if ($row < (sizeof($list_box_contents)-1)) {?> <tr> <?php for($col=0;$col<($MaxCol + 1);$col++) { echo '<td class="hDotLine"></td>'; } ?> </tr> <?php } ?> <?php } } ?> </table> </div> ```

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 6:31 AM
#204
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

Whoops.. my bad.. it looks like all the changes I'm trying to work out are related to the Column Divider Pro module not SNAF.. let me move this to the right place..

DivaVocals:

So I've made some progress, but I'm not quite there yet.. I have incorporated the Column Divider Pro module with SNAF, and the column dividers are not behaving EXACTLY as they should with the CSS tables and I'm puzzled how to fix it.. The horizontal dividers is repeated 4 times, and I cannot get the vertical dividers to work just on the between the inner cells.. (my current edit only displays them on the left -- I commented out the code which is supposed to display it between cells because it didn't work) You can see my progress here:
http://eitestsite(dot)eyeitalia(dot)com/shop/index.php?main_page=products_all

Here's my modified includes/templates/custom_template/common/tpl_columnar_display.php file and the CSS to support my changes:
Supporting CSS

.vDotLine
{
background-color: transparent;
background-image: url(../images/delim_v.gif);
background-repeat: repeat-y;
background-attachment: scroll;
width: 20px;
/font-size: 1px;/
}

.hDotLine
{
background-image: url(../images/delim_v.gif);
padding:1px 0;
}

.tabTable {display: table;padding-left: 20px;/font-size: 8pt;/}
.trRow {display: table-row;}
.tdContent {display: table-cell;padding: 5px 8px;}

> 
> **tpl_columnar_display.php** changes
> ```
<?php
/**
 * Common Template - tpl_columnar_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_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $
 */

?>
<?php
  if ($title) {
  ?>
<?php echo $title; ?>
<?php
 }
 ?>
  <div class="centerBoxWrapperContents">
<div class="tabTable">

<?php
if (is_array($list_box_contents) > 0 ) {

$MaxCol=0;
 for($row=0;$row<sizeof($list_box_contents);$row++) {
    $params = "";
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
?>
<div class="trRow">
<?php
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
      $r_params = "";
      if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
     $r_params = str_replace(" back", "", $r_params);
     $r_params = str_replace("50", "100", $r_params);
     $r_params = str_replace("33", "100", $r_params);
     
     // bof: Replace all widths with 100% for Column Divider Pro
     $startpos = strpos($r_params, "width:");
     if ($startpos != false) {
        $endpos = strpos($r_params, ";", $startpos);
        $res = substr($r_params, $startpos, ($endpos - $startpos ));
        $r_params = str_replace($res, "width:100%", $r_params);
     }
     // eof: Replace all widths with 100% for Column Divider Pro
     
     if (isset($list_box_contents[$row][$col]['text'])) {
?>
    <?php 
    echo '<div class="tdContent vDotLine" style="width:'. (intval($col_width) - 0.5) .'%">' . $list_box_contents[$row][$col]['text'] .  '</div>' . "\n";
     ?>
    <?php if ($row == 0 && $col < (sizeof($list_box_contents[$row]) - 1)) {
//            echo '<div class="tdContent vDotLine"></div>' . "\n";
              $MaxCol += 1;
          }

      }
    }
?>

</div> <!--end trRow-->

<?php 
    if ($row < (sizeof($list_box_contents)-1)) {?>
<div class="trRow">
    <?php    for($col=0;$col<($MaxCol + 1);$col++) {
      echo '<div class="tdContent hDotLine"></div>';
    } ?>
</div> <!--end trRow-->
<?php    }
    ?>


<?php
  }
}
?>
</div> <!--end table-->
 </div>

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 7:55 AM
#205
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

Okay.. so for now I'm dropping CDP stuff for now.. Too much work for very little gain.. If I figured it out later then so be it and I will share that revelation if I do..

In the meantime I've got one last thing to work through with SNAF. Column views work JUST fine.. Rows views do not.

So looking at my example: http://eitestsite(dot)eyeitalia(dot)com/shop/index.php?main_page=products_all

If you use the button on the listing page to switch the view to rows, things are not laying out correctly..

So far I made this change:

.productListing-data, .productListing-heading {
    padding: .5em 0;
[B]    display: table-cell;[/B]
}

This as least fixed it so that things would at least line up in rows.. But I am stumped how I would go about fixing the spacing issues.. I get I may have to add more classes and IDs, but I am confused/stumped which files to edit..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 10:25 AM
#206
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Snaf

DivaVocals:

So far I made this change:

.productListing-data, .productListing-heading {
padding: .5em 0;
[B] display: table-cell;[/B]
}


Instead of table-cell  try float:left;

You may need to do more than that and add further classses but try that first.

Nick
iszent.com

3 Nov 2013, 2:22 PM
#207
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

niccol:

Instead of table-cell try float:left;

You may need to do more than that and add further classses but try that first.

Nick you are a doll.. :hug:

Okay so that at least got things to things to align vertically.. But the spacing is still wrong, and I do know that I need to add more classes/IDs to help fix things up, but I'm still quite clueless where.. I have been using the developers toolkit to help narrow things down, but I am nowhere close to finding the "right" files..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 2:42 PM
#208
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

DivaVocals:

Nick you are a doll.. :hug:

Okay so that at least got things to things to align vertically.. But the spacing is still wrong, and I do know that I need to add more classes/IDs to help fix things up, but I'm still quite clueless where.. I have been using the developers toolkit to help narrow things down, but I am nowhere close to finding the "right" files..

Spoke too soon.. float:left; only worked on some rows.. not all..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 4:40 PM
#209
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

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:

  1. display: table;
  2. display: table-row;
  3. 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:

  1. display: table;
  2. 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

============================================

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:

  1. product image (Display Product Image)
  2. product name (Display Product Name)
  3. 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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Nov 2013, 5:38 PM
#210
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

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..

<div class="tabTable">
<div class="trRow">
[INDENT=2]<div class="productListing-heading"> … </div> <div class="productListing-heading"> … </div> <div class="productListing-heading"> … </div> [/INDENT]
</div> <div class="trRow">
[INDENT=2]<div class="productListing-data"> … </div> <div class="productListing-data"> … </div> <div class="productListing-data"> … </div> [/INDENT]
</div>
</div>
.tabTable {display: table;}
.trRow {table-row;}
.productListing-data, .productListing-heading {padding: .5em 0;[B]display: table-cell;[/B]}

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

4 Nov 2013, 11:01 AM
#211
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

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:

  1. display: table;
  1. display: table-row;
  1. 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:

  1. display: table;
  1. 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

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..

<div class="tabTable">

<div class="trRow">

[INDENT=2]<div class="productListing-heading"> … </div>

<div class="productListing-heading"> … </div> <div class="productListing-heading"> … </div> [/INDENT]
</div>

<div class="trRow">


[INDENT=2]<div class="productListing-data"> … </div>

<div class="productListing-data"> … </div> <div class="productListing-data"> … </div> [/INDENT]
</div>

</div>

> 
> ```
.tabTable {display: table;}
.trRow {table-row;}
.productListing-data, .productListing-heading {padding: .5em 0;[B]display: table-cell;[/B]}

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..

rbarbour:

<?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: ``` for([B]$row=0[/B]; $row<sizeof($list_box_contents); $row++) { ``` and added a little CSS to tidy things up
.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

<?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
```
$lc_price = zen_get_products_display_price($listing->fields['products_id']);

Line 212
```
$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
```
$lc_text = implode('', $product_contents);
```

Now the rows and grid displays are all worked out!! :clap:

I could use a little help to figure out a few final things though..:smile:

> **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:
> 
> 1. >
2. product image (**Display Product Image**) 
>
3. product name (**Display Product Name**) 
>
4. 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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

4 Nov 2013, 6:23 PM
#212
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

A little CSS, and a few obscure (strange) admins settings and I've got these last things all worked out now.. Wanna thank niccol for the nudges, hints, and answers.. You are the BEST!!!:hug:

Gonna go eat, grab some green tea, and maybe take a nap.. :laugh:Was working most of the night (not on just this of course..:laugh:) and have only had 3 hours of sleep.. Need to rejuvenate..

DivaVocals:


I could use a little help to figure out a few final things though..:smile:

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:

  1. product image (Display Product Image)
  1. product name (Display Product Name)
  1. 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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

23 Nov 2013, 12:39 PM
#213
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Snaf

I downloaded SNAf and when I go to extract the files it asks for a password. If I try and copy and paste certain files, for example in auto_loaders it won't.
Anyone know why?

23 Nov 2013, 3:21 PM
#214
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

Annie_zaz:

I downloaded SNAf and when I go to extract the files it asks for a password. If I try and copy and paste certain files, for example in auto_loaders it won't.
Anyone know why?

Nope.. Something unique going on with your computer.. Plus you haven't really given any details..

Asks for password?? What EXACTLY are you doing when this happens. As you extracting th file locally?? using your hosts cPanel File Manager?? DETAILS

"If I try and copy and paste certain files, for example in auto_loaders it won't."
Copy and paste??? where? when, WHY??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

24 Nov 2013, 10:36 AM
#215
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Snaf

Ok, here's more detail.
I am using xampp on my local computer. I download the snaf zip and then when I click extract these files
I get the password prompt. See picture:
Attachment 13404
So then because I can't extract the files I tried opening the folder and then copying and pasting the files individually to the directory.
Most files do copy and paste but some don't.
I hope this explains it better.

24 Nov 2013, 11:27 AM
#216
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Snaf

Ok SOLVED. I basically downloaded winrar and it extracted all files without password prompt.
I have been able to open other zip's with no problem..weird how it wouldn't do this one.
Thanks to anyone who tried to help.

24 Nov 2013, 2:16 PM
#217
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Snaf

Annie_zaz:

Ok SOLVED. I basically downloaded winrar and it extracted all files without password prompt.
I have been able to open other zip's with no problem..weird how it wouldn't do this one.
Thanks to anyone who tried to help.

and as I said in my original answer this is NOT an issue with the SNAF module.. this is an issue with your LOCAL computer..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

10 Apr 2014, 5:40 AM
#218
jenniferxo avatar

jenniferxo

New Zenner

Join Date:
Apr 2014
Location:
Los Angeles
Posts:
41
Plugin Contributions:
0

Re: Snaf

Hi, I am getting errors trying to extract with winrar and winzip as well. Is the file okay?

10 Apr 2014, 5:57 AM
#219
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Snaf

Well, with 1000+ downloads of the file I believe it is just fine. But try downloading it again and see how you get on. Perhaps the download was corrupted.

Personally, I do not use windows so I can't comment on winrar and winzip problems. Probably someone else on the forum can confirm that tey have unzipped with these just fine. If you continue to have problems then post again and we will see what we can do.

JenniferXO:

Hi, I am getting errors trying to extract with winrar and winzip as well. Is the file okay?

Nick
iszent.com

10 Apr 2014, 6:19 AM
#220
jenniferxo avatar

jenniferxo

New Zenner

Join Date:
Apr 2014
Location:
Los Angeles
Posts:
41
Plugin Contributions:
0

Re: Snaf

I downloaded the file 3 times. I'm fairly certain the file is corrupt. Perhaps a recent development. Is there an alternative download location?