I bought a template from Algozone for my zen cart and i'm having problems.
Yes, i know, you would expect Algozone to offer support, but to be honest they are damned near useless, saying that customising the template is done by "paid support"
Now to me, asking for standard functionality to be put back into the template is hardly customising it, merely making it as it should have been!
The problem i have is that they have messed with the includes/modules/product_listing.php file and hard coded something that stops me being able to change the number of rows/colums. If i change columns per row to 2, i still get 4, which doesn't suit my needs at all.
I looked at the override file and it is massively different from the original 1.3.9 file, so i haven't a clue what they have done to it. They also screwed all the image sizes by using the size for product info on the product listing, but i corrected this quite easily.
The product_listing.php file code is listed below.
If someone could help shed some light on this and how i can restore the proper functionality of the system i would be very grateful.
/**
* 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 $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$show_submit = zen_run_normal();
if(array_key_exists('rating', $_GET) and $_GET['azrefine'] == '1' and (int)$_GET['rating'] > 0 and (int) $_GET['rating'] < 6){
if(strstr($listing_sql, TABLE_REVIEWS) === FALSE){
$listing_sql = str_replace('where', ' LEFT JOIN ' . TABLE_REVIEWS . ' r ON (p.products_id = r.products_id) WHERE', strtolower($listing_sql));
}
$listing_sql = str_replace('where', 'where r.reviews_rating = ' . $_GET['rating'] . ' AND r.status = 1 AND ', strtolower($listing_sql));
}
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
$how_many = 0;
if ($listing_split->number_of_rows > 0) {
$row = 0;
$col = 0;
$list_box_contents = '';
$new_products = $db->Execute($listing_split->sql_query);
$extra_row = 0;
while (!$new_products->EOF) {
$cur_row = sizeof($list_box_contents) - 1;
$random_review_sidebox_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name
from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, "
. TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = r.products_id
and r.reviews_id = rd.reviews_id
and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and r.status = 1
and p.products_id = '" . (int)$new_products->fields['products_id'] . "'
limit " . MAX_RANDOM_SELECT_REVIEWS;
$random_review_sidebox_product = zen_random_select($random_review_sidebox_select);
$reviews = '';
if ($random_review_sidebox_product->RecordCount() > 0) {
$reviews = zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));
}
#Include template layout for the product box
#build variables map
$product['id'] = $new_products->fields['products_id'];
$product['name'] = zen_get_products_name($product['id']);
$product['price'] = '<span class="productPrice">'.az_change_format( zen_get_products_display_price($product['id']) ).'</span>';
$product['info_url'] = az_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['id']);
$product['image'] = az_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $product['name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT);
$product['desc'] = az_get_products_desc( $product['id'], $_SESSION['language_id'] );
$product['more_info_btn'] = zen_image_button('', AZ_BUTTON_MORE_INFO);
$product['buy_now_url'] = az_href_link(FILENAME_PRODUCT_INFO, zen_get_all_get_params(array('action')).'sort=2&action=buy_now&products_id='.$pr oduct['id']);
$product['buy_now_btn'] = zen_image_button('button_in_cart.gif', AZ_IN_CART, '', '', 2,false);
$product['review_stars'] = $reviews;
require(TMPL_DIR. 'templ_product_box.php');
$product_info_str = $az_product_html;
$list_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText f_left width25p" ',
'text' => '<div class="az_product_wrapper">'.$product_info_str.'</div>');
$col ++;
if ($col > 3) {
$col = 0;
$row += 1;
}
$new_products->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"');
}
?>


Reply With Quote
