Can we see the site where this is happening? It is not possible to diagnose or advise without more information.
Printable View
Can we see the site where this is happening? It is not possible to diagnose or advise without more information.
I installed Column Grid Sorter 2.3.1 this evening, but it doesn't seem to allow me to get more than one column. I've tried deselecting the display of name, model, etc., reducing the description size, etc. but I can't get more than one column. Layout style is set for columns, columns per row is 2, and the customer-controls are both zero. My site is www.heirloomstocherish.com, and I am v1.5.1. Can you suggest some other things I might try?
Thanks for any help you can give me.
Phil
Please ignore my previous transmission on this thread. Got it figured out.
Has anyone mentioned that only the alpha sorter label shows in a listing when the customer layout choice is enabled and there are no manufacturers and the alpha sorter is turned off? I don't see why. If I turn off the customer's choice, it's fine so it's just that one line of code that is the problem. Complicates the code enough that I can't see the solution (in my sleepy state)
PHP Code:
if ($do_filter_list || ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true') || (defined('PRODUCT_LISTING_LAYOUT_STYLE_CUSTOMER') and PRODUCT_LISTING_LAYOUT_STYLE_CUSTOMER == '1'))
if ($do_filter_list
|| ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true')
|| (defined('PRODUCT_LISTING_LAYOUT_STYLE_CUSTOMER') and PRODUCT_LISTING_LAYOUT_STYLE_CUSTOMER == '1'))
The way this is written, it will display the alpha sorter whenever any one of those three items is true. I don't remember who wrote it, but unless you want the sorter to always display when customer choice is enabled, I would remove the last term. The sorter should still appear when set in admin regardless of customer choice setting.
I'm going to ask a silly question, but is there a way that I can move away from <div>'s being used to using <table>'s. Reason I ask is because i'm having a little issue regarding the sizing of some "cells" as opposed to others.
Not a silly question and the answer is here : http://www.zen-cart.com/showthread.p...-a-solution-to
Just installed Column Layout Grid 2.31 on a fresh Zen Cart 1.53. No problems found.
Thanks for testing and reporting :)
I have v1.5.1 installed and am running CLG 2.3.1. I would like to have more space between rows so the Buy Now button doesn't look like it could apply to the item below it. I prefer not to have a line, but rather space, like maybe 1/4" or so, or something I can modify until it looks right...maybe even a line that I can edit the height on, yet specify a subtle/invisible color. I have searched and searched the forums, but can't find the answer to my question....it's probably in there somewhere. My site is www.heirloomstocherish.com.
Please advise.
Add to your stylesheet (anywhere)Adjust to taste.Code:.centerBoxContentsProducts {margin: 1em 0;}
Perfect!
Thanks,
Phil
Odd experience when running this mod on 1.5.1 - the SQL didn't work when run through Tools->Install SQL Patches. I had to run it through PHPMyAdmin. Otherwise works a treat!
Installed but can't figure out how to get it to display as a grid through the admin I've done it before but can't for the life of me remember how any suggestions greatly appreciated
Hi I installed this module on my test site which I am working on to upgrade my zc1.5 live site to the new version. I only have one more module installed at this point and it's Flexible Footer menu. I have installed this module before and it worked like a charm so I have a feeling that I am missing something basic. I have uninstalled and reinstalled but am facing the same problem.
This module is creating columns for all pages expcept "Featured Products", "New Products" and "All Products" page. That page is still being displayed in rows. When looking at the source, I see that it is still creating rows within a table. The Specials and other pages are using divs. I can't figure out how to fix this page or why this page is not displaying in columns format. The settings in admin-configuration-product listing for layout style is set to column, and number of column is set to 4.
My test site is located at www dot just-v i b r a t o r s dot com/zencart/zc153 (remove the dot and space. The hypen is part of the url. PLEASE NOTE: this site has adult products listed so if you are easily offended, please do not go to the link.
The featured products page link is http://www dot just-vibrators dot com/zencart/zc153/index.php?main_page=featured_products
Any help/direction would be highly appreciated.
I'm having a problem with price display.
On the file includes/modules/MY_TEMPLATE/product_listing.php around line 159 I commented out this:
Because if I un-comment it - I get this for products with attributes:Quote:
//$lc_price = zen_get_products_display_price($listing->fields['products_id']) . ' ';
And on products without attributes the prices displays THREE times (if that line is not commented-out). That is because I added a call for the price a few lines down to put the price where I want it on the Product Listing page. But it only displays on items without attributes. Like here: http://www.threesistersfabric.com/books-3/Quote:
$15.00
...more info
$15.00
I'd like my attribute item prices on the Product Listing page to look like they do on the New Products page.
Can someone please help me figure out how to fix this? Am I altering the wrong code? Not sure why I get the duplicate price display when that line is not commented out....
Thanks for any help you can offer!
I am using ZenCart vs 1.5.1 and v2.3.1 of CLG
Here is my product_listing.php page:
PHP Code:
<?php
/**
* product_listing module
*
* @package modules
* @copyright Copyright 2003-2007 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: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $
* UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004
// Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004
// Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
// Column Layout Support (Grid Layout) upgraded for v1.5.0 compatibility and changed to customer control asarfraz July 26 2012
// Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-20 test 20120929 grid sorter
//
if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE',(isset($_GET['view']) ? $_GET['view'] : 'rows'));
if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);
if (!defined('PRODUCT_LISTING_GRID_SORT')) define('PRODUCT_LISTING_GRID_SORT',0);
$product_listing_layout_style = isset($_GET['view'])? $_GET['view']: PRODUCT_LISTING_LAYOUT_STYLE;
$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';
$max_results = ($product_listing_layout_style=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
$show_submit = zen_run_normal();
$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
$how_many = 0;
// Begin Row Layout Header
if ($product_listing_layout_style == 'rows' or PRODUCT_LISTING_GRID_SORT) { // For Column Layout (Grid Layout) add on module
$list_box_contents[0] = array('params' => 'class="productListing-rowheading"');
$zc_col_count_description = 0;
$lc_align = '';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_IMAGE':
if ($product_listing_layout_style == 'rows') { //skip if grid
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
$zc_col_count_description++;
}
break;
}
if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
}
$list_box_contents[0][$col] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => $lc_text );
}
if ($product_listing_layout_style == 'columns') { //grid sort option
$grid_sort = $list_box_contents[0];
$list_box_contents = array();
}
} // End Row Layout Header used in Column Layout (Grid Layout) add on module
///////////// HEADER ROW ABOVE /////////////////////////////////////////////////
$num_products_count = $listing_split->number_of_rows;
if ($listing_split->number_of_rows > 0) {
$rows = 0;
// Used for Column Layout (Grid Layout) add on module
$column = 0;
if ($product_listing_layout_style == 'columns') {
if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
$col_width = floor(100/$num_products_count) - 0.5;
} else {
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
}
}
// Used for Column Layout (Grid Layout) add on module
$listing = $db->Execute($listing_split->sql_query);
$extra_row = 0;
while (!$listing->EOF) {
if ($product_listing_layout_style == 'rows') { // Used in Column Layout (Grid Layout) Add on module
$rows++;
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
$cur_row = sizeof($list_box_contents) - 1;
} // End of Conditional execution - only for row (regular style layout)
$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 = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><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 = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><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;
// more info in place of buy now
$lc_button = '';
if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
$lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
} else {
if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
if (
// not a hide qty box product
$listing->fields['products_qty_box_status'] != 0 &&
// product type can be added to cart
zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
&&
// product is not call for price
$listing->fields['product_is_call'] == 0
&&
// product is in stock or customers may add it to cart anyway
($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
$how_many++;
}
// hide quantity box
if ($listing->fields['products_qty_box_status'] == 0) {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
} else {
$lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
}
} else {
// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), 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="1" maxlength="6" size="4" /> @ ' . zen_get_products_display_price($listing->fields['products_id']) . ' ea.<br/ >' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_FLOWER_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' .
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = $listing->fields['products_quantity'];
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = $listing->fields['products_weight'];
break;
case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
} else {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
}
}
break;
}
$product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option
if ($product_listing_layout_style == 'rows') {
$list_box_contents[$rows][$col] = array('align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}
}
// add description and match alternating colors
//if (PRODUCT_LIST_DESCRIPTION > 0) {
// $rows++;
// if ($extra_row == 1) {
// $list_box_description = "productListing-data-description-even";
// $extra_row=0;
// } else {
// $list_box_description = "productListing-data-description-odd";
// $extra_row=1;
// }
// $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
// 'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
//}
// Following code will be executed only if Column Layout (Grid Layout) option is chosen
if ($product_listing_layout_style == 'columns') {
$lc_text = implode('<br />', $product_contents);
$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => $lc_text);
$column ++;
if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
$column = 0;
$rows ++;
}
}
// End of Code fragment for Column Layout (Grid Layout) option in add on module
$listing->MoveNext();
}
$error_categories = false;
} else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);
$error_categories = true;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) {
// bof: multiple products
echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
}
?>
OK - I got it. I just needed a better understanding of how PHP works. :)
Can anyone say if this mod works on 1.5.4?
Thanks much!
Kiddo
Yes I have it working on a number of new 1.54 carts!
Thanks Twitchtoo!
Kiddo
will this mod work in the new zencart 1.5.5?
I'm not sure if our site was upgrade or went through a fresh install, but either way we went from 1.3.9h to 1.5.5 and it appears things were updated to CLG V2
I do not see any log files pertaining to this issue. In the tabular layout, it shows "Displaying 1 to 6 (of 6 products)" but only 5 are populated. The last one is always left off. This happens no matter the number of products assigned to a category (ex: 25/26, 6/7, and so on)
I think I narrowed down the problem to includes/modules/your_temp/product_listing.php but I just haven't been able to find the culprit. If I remove this file and use the classic file includes/modules/product_listing.php, all of the results are returned to the screen.
Any thoughts. You can see the problem here (Remove all the spaces in the domain):
g e t 2 I t p a r t s DOT c o m /Index.php?main_page=index&cPath=135107_135090_119246_120153
Thanks
PHP Code:
<?php
/**
* product_listing module
*
* @package modules
* @copyright Copyright 2003-2007 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: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $
* UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006
* Modified by Anne (Picaflor-Azul.com) Winchester Respnsive v1.0
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004
// Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004
// Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
// Column Layout Support (Grid Layout) upgraded for v1.5.0 compatibility and changed to customer control asarfraz July 26 2012
// Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-20 test 20120929 grid sorter
//
if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE',(isset($_GET['view']) ? $_GET['view'] : 'rows'));
if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);
if (!defined('PRODUCT_LISTING_GRID_SORT')) define('PRODUCT_LISTING_GRID_SORT',0);
$product_listing_layout_style = isset($_GET['view'])? $_GET['view']: PRODUCT_LISTING_LAYOUT_STYLE;
$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';
$max_results = ($product_listing_layout_style=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
$show_submit = zen_run_normal();
$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
$how_many = 0;
// Begin Row Layout Header
// For Column Layout (Grid Layout) add on module
if ($product_listing_layout_style == 'rows' OR (in_array($current_category_id, explode(',','1045,1055,120528,')))) {
// For Column Layout (Grid Layout) add on module
$list_box_contents[0] = array('params' => 'class="productListing-rowheading"');
$zc_col_count_description = 0;
$lc_align = '';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_REF_NUMBER':
$lc_text = TABLE_HEADING_REF_NUMBER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_IMAGE':
if ($product_listing_layout_style == 'rows') { //skip if grid
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
$zc_col_count_description++;
}
break;
}
if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
}
$list_box_contents[0][$col] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => $lc_text );
}
if ($product_listing_layout_style == 'columns') { //grid sort option
$grid_sort = $list_box_contents[0];
$list_box_contents = array();
}
} // End Row Layout Header used in Column Layout (Grid Layout) add on module
///////////// HEADER ROW ABOVE /////////////////////////////////////////////////
$num_products_count = $listing_split->number_of_rows;
if ($listing_split->number_of_rows > 0) {
$rows = 0;
// Used for Column Layout (Grid Layout) add on module
$column = 0;
if ($product_listing_layout_style == 'columns' AND (!in_array($current_category_id, explode(',','1045,1055,120528,')))) {
if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
$col_width = floor(100/$num_products_count) - 0.5;
} else {
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
}
}
// Used for Column Layout (Grid Layout) add on module
$listing = $db->Execute($listing_split->sql_query);
$extra_row = 0;
while (!$listing->EOF) {
if ($_GET['main_page'] == "advanced_search_result") {
$current_category_id = "Advanced Search Result";
}
// Used in Column Layout (Grid Layout) Add on module
if ($product_listing_layout_style == 'rows' OR (in_array($current_category_id, explode(',','1045,1055,120528,')))) {
// Used in Column Layout (Grid Layout) Add on module
$rows++;
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
$cur_row = sizeof($list_box_contents) - 1;
} // End of Conditional execution - only for row (regular style layout)
$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_REF_NUMBER':
$lc_align = '';
$lc_text = $listing->fields['ref_number'];
break;
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><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 = 'Ref Number: ' . $listing->fields['ref_number'] . '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><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 = '<div class="pl-price">' . zen_get_products_display_price($listing->fields['products_id']) . '</div>';
$lc_align = 'right';
$lc_text = $lc_price;
// more info in place of buy now
$lc_button = '';
if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
$lc_button = '<div class="pl-details"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_GOTO_PROD_DETAILS, BUTTON_GOTO_PROD_DETAILS_ALT, 'class="listingBuyNowButton"') . '</a></div>';
} else {
if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
if (
// not a hide qty box product
$listing->fields['products_qty_box_status'] != 0 &&
// product type can be added to cart
zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
&&
// product is not call for price
$listing->fields['product_is_call'] == 0
&&
// product is in stock or customers may add it to cart anyway
($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
$how_many++;
}
// hide quantity box
if ($listing->fields['products_qty_box_status'] == 0) {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
} else {
$lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
}
} else {
// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), 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" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = $listing->fields['products_quantity'];
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = $listing->fields['products_weight'];
break;
case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
} else {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
}
}
break;
}
$product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option
if ($product_listing_layout_style == 'rows' OR (in_array($current_category_id, explode(',','1045,1055,120528,')))) {
$list_box_contents[$rows][$col] = array('align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}
}
// add description and match alternating colors
//if (PRODUCT_LIST_DESCRIPTION > 0) {
// $rows++;
// if ($extra_row == 1) {
// $list_box_description = "productListing-data-description-even";
// $extra_row=0;
// } else {
// $list_box_description = "productListing-data-description-odd";
// $extra_row=1;
// }
// $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
// 'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
//}
// Following code will be executed only if Column Layout (Grid Layout) option is chosen
if ($product_listing_layout_style == 'columns' AND (!in_array($current_category_id, explode(',','1045,1055,120528,')))) {
$lc_text = implode('<br />', $product_contents);
$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => $lc_text);
$column ++;
if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
$column = 0;
$rows ++;
}
}
// End of Code fragment for Column Layout (Grid Layout) option in add on module
$listing->MoveNext();
}
$error_categories = false;
} else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);
$error_categories = true;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) {
// bof: multiple products
echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
}
?>
Wondering too if this works correctly with 1.55a.
The one here is not responsive. You have to get this one https://github.com/DivaVocals/zen_SNAF-Responsive
Hi, i just tested zen_SNAF-Responsive-master on zencart 1.5.5b, after uploaded all files, login failed: WARNING: An Error occurred, please refresh the page and try again.
Errors from log:
[14-Nov-2016 11:59:06 UTC] Request URI: /update/admin/login.php?camefrom=index.php, IP address: ::1
#1 trigger_error() called at [D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:167]
#2 queryFactory->show_error() called at [D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:139]
#3 queryFactory->set_error() called at [D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:266]
#4 queryFactory->Execute() called at [D:\wamp\www\update\admin\includes\init_includes\init_snaf.php:106]
#5 require(D:\wamp\www\update\admin\includes\init_includes\init_snaf.php) called at [D:\wamp\www\update\includes\autoload_func.php:48]
#6 require(D:\wamp\www\update\includes\autoload_func.php) called at [D:\wamp\www\update\admin\includes\application_top.php:171]
#7 require(D:\wamp\www\update\admin\includes\application_top.php) called at [D:\wamp\www\update\admin\login.php:9]
[14-Nov-2016 11:59:06 UTC] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 900, now(), now(), NULL, 'zen_cfg_select_option(array(''True'',''False''),')' at line 2 :: INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
(NULL, 'Use Product Listing Format for All Products', 'USE_PRODUCT_LISTING_FOR_ALL_PRODUCTS', 'False', 'Use Product Listing Format instead of the Default All Product Format <br/><br/>
This will make some of the settings on this page inactive as the product listing settings will be used.', , 900, now(), now(), NULL, 'zen_cfg_select_option(array(''True'',''False''),') ==> (as called by) D:\wamp\www\update\admin\includes\init_includes\init_snaf.php on line 106 <== in D:\wamp\www\update\includes\classes\db\mysql\query_factory.php on line 167
[14-Nov-2016 11:59:06 UTC] PHP Stack trace:
[14-Nov-2016 11:59:06 UTC] PHP 1. {main}() D:\wamp\www\update\admin\login.php:0
[14-Nov-2016 11:59:06 UTC] PHP 2. require() D:\wamp\www\update\admin\login.php:9
[14-Nov-2016 11:59:06 UTC] PHP 3. require() D:\wamp\www\update\admin\includes\application_top.php:171
[14-Nov-2016 11:59:06 UTC] PHP 4. require() D:\wamp\www\update\includes\autoload_func.php:48
[14-Nov-2016 11:59:06 UTC] PHP 5. queryFactory->Execute() D:\wamp\www\update\admin\includes\init_includes\init_snaf.php:106
[14-Nov-2016 11:59:06 UTC] PHP 6. queryFactory->set_error() D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:266
[14-Nov-2016 11:59:06 UTC] PHP 7. queryFactory->show_error() D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:139
[14-Nov-2016 11:59:06 UTC] PHP 8. trigger_error() D:\wamp\www\update\includes\classes\db\mysql\query_factory.php:167
Can you please help?
anyone knows how to fix?
can anyone help please? any feedback is appreciated.
Hello,
I am attempting to install this module. (Zen Cart v1.5.4). When I setup up Zen Cart I used the default template and made changes directly to what was installed by default. Not the right thing, but it is what I have. I would like to install this module, however, what are the files that need to be replaced if necessary with the new files (if that makes any sense)?
Regards,
Ron
Column Grid Layout for Product Listing 3.0
January 16.2018
Zen Cart 1.55f
This new version comes with new install instructions packaged with the 1.55f fileset.
It is backwards compatible to 1.54 for certain however as always the line numbers will be off and I would recommend paying attention to the changes 1.55f has regarding new CSS elements that have been added to the stock Zen Cart 1.55x - these were NOT present in the older versions.
The module function is the same as the original - it allows you to display products in a column or grid in your product listing.
Check zen plugins ^ for the new package :)
I forgot to mention here that the new Column Layout Grid plugin is based on the Responsive Classic template that ships with Zen Cart 1.55f.
3.0 now works with mobile, tablet and desktop :)
Hey Twitch, I'm looking for the new Column Grid Layout for Product Listing 3.0 plugin you mentioned but can't seem to find it. When you say "Check zen plugins for the new package", are you talking about the plugins available on the zen cart site or are you talking about the plugins available on your own site? Please let me know... Thanks
I've submitted this for review with the Zen folks, I'm unsure what their turn around time is right now to get this rolling in the plugins.
I should have the Twitch version available on my website this week :) It's currently running in my code shop as it 'isn't just a place to provide functional Zen Cart modules, it's also actively using every Twitch module I've developed' ~ Sounds like a hair club for men ad ;)
New version is up in the plugins:
https://www.zen-cart.com/downloads.php?do=file&id=3
new version is made for <responsive Classic> is there a grid layout made for <classic contemporary Green>?
If you compare the files in this plugin package in classic contemporary green vs responsive classic and merge you will notice the two are very similar having mostly CSS control changes - for responsive.
Alternately...
In the step by step instructions included you will see how the code is inserted and you could use the instructions to add the code directly into each file, the line numbers would be off a bit but the functions are all stock zen and shared between the default, classic and responsive classic.
Note: There is no change between the two templates for the admin side install - SQL updates remain the same also.
I am so excited about this plug in.
I just installed the current Column layout grid on 1.5.5f. I ran sql from tools, I can see it in my admin.
I uploaded includes/languages/english/extra_definitions/YOUR_TEMPLATE/column_layout_grid_defines.php into my_template folder
I added this to the bottom of the css page
.centerBoxContentsProducts { padding: 1em 0; }
In admin:
Product Listing - Layout Style columns
Product Listing - Columns Per Row 4
Product Listing - Layout Style - Customer Control 0
Product Listing - Show Sorter for Columns Layout 0
https://www.uesakausa.com/index.php?...ndex&cPath=1_5
cleared cache and it still is in rows. Any ideas where I may have goofed?
Thanks in advance for your help.
I would assume that the file doing the work - includes/modules/YOUR_TEMPLATE/product_listing.php is not seeing or using the database switches/flags.
And/Or
includes/templates/YOUR_TEMPLATE/tpl_modules_product_listing.php isn't publishing what may or may not have been found in the previously mentioned product_listing.php.
Another common problem is the new files aren't overwritten on the server, all FTP software has timeout - memory problems natively. So be sure that the new merged version is in your template folder on the server.
THANK YOU twitchtoo for the quick response!
FTP bleep was the issue, missed some files.
Now looking at this I would like to move all the text under the images.
https://www.uesakausa.com/index.php?...ndex&cPath=1_5
I searched for itemTitle and it brought up
temp/product_listing.php
temp/templates/tpl_modules_products_all_listing.php
temp/templates/tpl_modules_products_featured_listing.php
temp/templates/tpl_modules_products_new_listing.php
templates/responsive_classic/templates/tpl_modules_products_all_listing.php
/responsive_classic/templates/tpl_modules_products_featured_listing.php
templates/responsive_classic/templates/tpl_modules_products_new_listing.php
Opened the first one and found several break statements. I am assuming I would need to put a break or p tag in the $lc_text definitions...? First I don't know if that is the solutions and second there are so many of them I am worried if I put them in all of them I am creating a can of worms.
It is responsive and I feel there has to be a better option.
Any ideas?
Thanks in advance for any help!
I've already done that in the Twitchtoo Code Shop Template here:
http://twitchtoo.com/tR_codeSHOP/ind...=index&cPath=2
It's done with CSS only.
In FireFox you can right click and View Code
Then click the .css links for the newest version.
Make yourself a file and compare it to your own. There are a lot of little changes to remove the floats and center everything so that it looks and works the same on all platforms/devices.
I continue to install new modules and make minor changes to the code shop so the live site always has the newest stable version.
Or, you could email me and I could send you a zip of the css folder :)
When unzipping the file i get Includes and Your Template in the same level, am i missing something?
Attachment 17968
I don't believe you need to make file changes.
In Admin > Configuration > Product Listing > Display Product Name - the value corresponds to the postion. I'm pretty sure this used to be explained in the comments, no more though. From memory, valid entries are 0,1,2,3 you can also apply these to the other elements to be displayed. Experiment with them to see their effect. I suspect that, depending on the values of the other elements, Display Product Name = 2 will place the name directly below the image.
Edit: just looked at your link and you seem to have resolved the issue.
Although I often forget, like now, I do sometimes find that the Zen Cart Wiki is a useful source of information. An explanation of how to control the appearance of the Product Listing pages can be found on this wiki page
Is there a clear instruction on how to install this addon?
As per this post and follow up:
https://www.zen-cart.com/showthread....05#post1348505
To correct the problem of product listing alignment issues on mobile/responsive landscape view after installing this CGL for 1.55f the following change will be added to the future release I would advise you to make the change to your site now:
In your CSS template specific files change the height: 100%; for all instances of .list-image to max-height: 100%; (especially the responsive_mobile.css)
As a result of CSS updates with the product listing and other ZC admin settings you may see the categories listed in a column that does not adhere to the parent display block CSS.
To fix this we can remove the inline php - css styling injection here:
includes/modules/YOUR_TEMPLATE/category_row.php
line 39
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
changes to this:
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' ,
Using responsive_classic template.
Note: If your custom template relied on the hard code this may or may not be a 'fix' for you.
I fought this for several days and still got in-line styling no matter what combination of changes I made to anything dealing with categoryListBoxContents. Don't know if your solution above works with strictly categories. Not to that point yet.
However, when the listing is of sub-categories, it just won't work. No matter what you do in category_row.php or product_listing.php, the inline styling still creates a problem. The layout was fine in most portrait scenarios, but the inline height call made landscape into a Salvador Dali-like mess.
What finally worked for me was actually a very simple change. One I found only after backing out of all the changes to css and files.
In the responsive_mobile.css stylesheet, There's a line that deals with center-boxes. You can search for .categoryListBoxContents for the line number in your template's version. Ours is line 45 (should be 39 with unmodified responsive_classic) and ended withChanging it to the folllowing fixed the layout problem.Code:..., div.categoryListBoxContents {width:48%!important;height:auto;margin:0;padding:10px 0;}
Now, all looks good for mobile and tablet in both portrait and landscape.Code:..., div.categoryListBoxContents {width:48%!important;height:auto!important;margin:0;padding:10px 0;}
HTH
If anyone is having a problem with the sort buttons displaying incorrectly in grid/list - I now have the fix for the Responsive Classic 1.55f template!
Included is a development warning from Redoc:
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_product_listing.php
Redoc Note: If you are seeing duplicate sort heading buttons, check Admin > Configuration > Product Listing > review sort order of all columns in your list - there can be NO conflicts!PHP Code:
<?php // bof Column Layout Grid
/**
* load the list_box_content template to display the products
*/
if ($product_listing_layout_style == 'columns') {
if (PRODUCT_LISTING_GRID_SORT) {
echo "\n" . '<div id="' . 'gridSorter' . 'cat' . $cPath . 'List' . '"' . ' class="tabTable"' . '>' . /*PRODUCT_LISTING_GRID_SORT_TEXT .*/ '';
echo '<div class="productListing-rowheading">' ;
for ($col=0;$col<sizeof($grid_sort);$col++) {
if ($grid_sort[$col]['text']) echo $grid_sort[$col]['text'] . "\n";
}
echo '</div>' . "\n";
}
require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
} else {// (PRODUCT_LISTING_LAYOUT_STYLE == 'rows')
require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php');
}
// Redoc Note: If you are seeing duplicate sort heading buttons, check admin > configuration > product listing > review sort order of all columns in your list - there can be NO conflicts!
// eof Column Layout Grid
?>
This bugfix has been be added to the next release of Twitch Column Grid Layout for Product Listing I'll have it submitted shortly... :)
Little things...
includes/templates/YOUR_TEMPLATE/CSS/stylesheet.css
make this:
.prod-list-wrap{text-align:center;padding:.8em .6em;clear:both;height:40px;}
look more like this:
.prod-list-wrap{text-align:center;padding:.8em .6em;clear:both;height:5em;}
Now prev/next page and displaying 1 of ... will have more room, less chance for overlap
Has any one tried this plugin with ZenCart 1.5.6?
Yes, I just installed it on 1.5.6a and it works. A couple of points to consider. Although the steps to edit the files are pretty clear there are a lot of manual replacing/editing. I suggest making backups of each file before editing.
Second, the layout is not easy either. I'm looking for a clean grid of products for a 'Gallery' page and after installing the plugin I have the grid view that I seek. But now I am digging into the templates and the CSS to get just the look and feel.
Perhaps someone in the forum can help? Here is my site. www.paintingbarn.com
If you go to the Gallery page you can see that I'm trying to display a clean page with just thumbnails for each painting/product. The New products page look is what I want for this category. No '...more info' buttons, just clean blocks with the picture and the title.
I'm assuming that I will need to create an 'if' block in the 'product_listing.php' file for this category. In that block I will direct the browser to use the 'tpl_products_new_default.php' for the layout.
Thanks in advance!
You're right about the clumsy nature of the display, considering that there are both hard coded switches that can be on or off in admin and potentially hard coded module additions to the product listing... there is work to be done with any template out of the box.
These sites consider changing the CSS, instead of the hard code to accomplish a clean product listing display using column layout grid.
Bluu Gnome Gear
https://www.bg-gear.com/store/index....=index&cPath=1
Edmonton Grocer
https://edmontongrocer.com/shop/
Sheldrake Automotive
http://sheldrakeautomotive.com/shop/...ath=3_117_6_19
German Wholesale Parts
http://germanwholesaleparts.ca/
Once the product listing is mastered you can review the new products, featured products and so on (preferred) or direct them to use the product listing page (existing features and future upgrades will need to interact correctly with a one page listing output method)
For pointers simply look at the source stylesheet.css and related files available in your web browser. You can copy the stylesheets into your own site and if the settings are similar for each display item - you will see the display cleaned up for a proper gallery :clap:
I'm using Zen Cart 1.5.6a
When I have the Buy it Now button.. works great.. but if I change it to Add to Cart with Multiples.. the Add to Cart button is not adding to the cart. It just acts like it is.
I'm going to keep looking for the error, but any one have this happen?
Thanks!
I have narrowed it down to HTTPS vs HTTP.. I think there is a syntax error here?
product_listing.php
Code:// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= '<div class="cart-add">' . 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></div>';
} else {
$lc_button = '<div class="cart-add"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a></div>';
}
Hello,
adding .centerBoxContentsProducts { padding: 1em 0; } to my stylesheet.css has no effect on the product image spacing in product listing. I am using your module on my test site salvagecrate.com and the most current version of your module from the zencart site and zencart 1.5.6c. Please help. I want to add this to my live site but the images for the products seem to be to close to the borders on the top.
I did not build the 1.56 version 3.1. Version 3.0 will run properly on 1.55f - php 5.6. It has also been tested up to 1.55f - php 7.2
I am in the process of redeveloping Column Layout Grid 3.0 with Twitch Module compliance for Twitch Base6 as it appears time to fork the module and provide further support to my clients that comes with all Twitch Modules.
Twitch Modules have followed the stable Zen Cart releases for over a decade - to illustrate:
Zen Cart 1.39h > Zen Cart 1.51 > Zen Cart 1.54 > Zen Cart 1.55f > Zen Cart 1.56c
Twitch Modules for any Zen Cart release (1.55a, 1,55b, etc) between those listed above are forward compatible with the stable release.
Looks like this for Column Layout Grid for Product Listing:
Zen Cart 1.39h > CLG - Version 2.31
Zen Cart 1.51 > CLG - Version 2.31
Zen Cart 1.54 > CLG Version 3.0 - twitchtoo - Twitch Wholesale Certified (pre-base standards)
Zen Cart 1.55f > CLG - Version 3.0 - twitchtoo - Twitch Base4 Certified
Zen Cart 1.56c > CLG Version 3.1 - jeking - February 20, 2019
fork
Zen Cart 1.56c > CLG Version ? - twitchtoo - Currently being rebuilt for Twitch Base6 Certification.
I encourage those that want to use jeking's release CLG Version 3.1 moving forward with your stock installation of Zen Cart 1.56 as Twitch Base6 is the newest Zen Cart CMS to be released June 1st to the public.
Is there anyway to have this plugin display products in a different number of columns according to screen size?
I'm using Zen Cart v1.5.6c
I want the columns to be more controllable, so that it responds to screen size.
Currently I have 4 columns shown for desktop and would want 2 or even 1 shown on mobile.
I didn't use the responsive template as framework for my current template (I used classic). Would it be possible to make it responsive like the responsive template or would I have to completely change templates?
mito0930 - yes. Using the Responsive Template is the first step.
You can see the newest Zen Cart 1.56c - Twitch Base6 for public release running Twitch Product Listing Advanced (Column Layout Grid for 1.56c) here:
https://twitchbase6.com/index.php
And a production version with images, text and the newest features here:
http://barnwoodwine.ca/index.php
I'll be releasing one final Column Layout Grid for 1.56c relative to jeking's last release with these features:https://twitchtoo.com/images/zen_for...g_adv_156c.JPG
...that looks like this when it's displaying - using the Responsive Template:
https://twitchtoo.com/images/zen_for...ayout_grid.JPG
Try both sites out on your various mobile devices and screen sizes on a desktop to see how it will adjust the display :happy:
Twitchtoo, what I'm looking for is something that automatically changes with different screen sizes. Adaptive might be a better word for it, instead of allowing it to be toggled manually. My original question was wondering if I could possibly make this adaptive as described above. I'm not too keen on reworking a brand new template when I've already worked to make one from the classic template. I've made the template as responsive as it can be between desktop, mobile and tablet with specific values. Would I be able to force the number of columns displayed according to those values?
To Clarify...
The stock template already adjusts the columns once you install column layout grid - this happens at the CSS level with a bit of php. The settings for this module allow a baseline control or starting point number of columns before the CSS takes over as the screen sizes change. I've added toggles and master switches to turn on/off display control on the customer side. By default that will maintain the admin selection as a starting point for the template CSS to continue doing what it always has done which is already adaptive/responsive from that perspective. It currently uses a simple equation to divide up the column width by the width set/available within the div it is contained.
If you want to reverse the responsive/adaptive number of columns and control each potential screen size with a static number of columns it would defeat the purpose of the already responsive behaviour but it would ensure that specific screen sizes get paired with specific column counts/sizes.
Alternately...
Leaving the responsive CSS behaviour while forcing say:
- mobile to use only rows with images
and
- desktop/tablet to only show columns with images
Yes it is possible - by simply connecting the mobile detect value to admin selected (or hard coded) toggle positions.
The only drawback is when the automation makes a static decision while the CSS is being dynamic. CSS could be added/adjusted to keep the browser from guessing at the output and overlapping elements on the wrong device.
Oh, I think I finally understand. I understand that it defeats the purpose, but I realized that displaying 3 columns on a small device makes everything squish together. If that's the case, should I toggle the column grid off and work with the original product listing module code?
With this module installed in the responsive template you can add one more line of code that looks at the Mobile Detect switch and controls which layout should be used rows or columns. The responsive CSS and hard code will do the rest automatically regarding screen scaling.
i install this and very thank full for this. i like the 3 column view and can get that with plugin,, but it shows the weight and item count on the product listing page.. I don't want that to show up on that page or at least not at the very top. I do like it shown when the customer actually clicks on the product so they know the weight and how many i have.
thank you
The following links should get you in the right area.
https://docs.zen-cart.com/user/templ...duct-info-page
https://docs.zen-cart.com/user/produ...t-descriptions
thank you for the reply
i added attachments on what i mean
now i really fill stupid.. i actually read the links you sent me. and now it works.. thank you so much
have a great day.. again thank you
ok now i have in the product listing page.. i have 3 columns but the add to cart button in above picture and i would like below picture.. and i can't seem to figure out how to do this. thank you
i added a picture so you know what i am talking about