
Originally Posted by
doggero
I installed the auction mod a few months ago and had only a few problems. I am very happy with this mod.
My question now though is I sell products at a fixed price but then also auction them, Is there a way to keep the Auction products from showing up in the "New Items" Page?
I have had a few customers get confused by the duplicate listing. I have annotated on the title of the items *AUCTION* which has seemed to help, but I would prefer to just block the auction items from showing in New items.
If this can be done I would be greatful, if someone could tell me how.
Thanks in advance!
The default way Zen handles showing new products is by the date they was placed on your site. The only way I know of to deal with it is to remove auction products from the query. Just did it and it works by editing includes\modules\pages\products_new\header_php.php
We need to know the type_id from the product type table for product_auction which is the type_handler name. Then we need to add a line to the query to not include any auction products. The code below is from 1.8.9h with the lines in red I added...
Code:
<?php
/**
* products_new header_php.php
*
* @package page
* @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: header_php.php 6912 2007-09-02 02:23:45Z drbyte $
*/
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// display order dropdown
$disp_order_default = PRODUCT_NEW_LIST_SORT_DEFAULT;
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
$products_new_array = array();
// display limits
// $display_limit = zen_get_products_new_timelimit();
$display_limit = zen_get_new_date_range();
// get auction type ID
$sql = "SELECT * FROM " . TABLE_PRODUCT_TYPES . " WHERE type_handler = 'product_auction'";
$result = $db->execute($sql);
$typeID = $result->fields['type_id'];
// end auction type ID
$products_new_query_raw = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price,
p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model,
p.products_quantity, p.products_weight, p.product_is_call,
p.product_is_always_free_shipping, p.products_qty_box_status,
p.master_categories_id
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m
ON (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd
WHERE p.products_status = 1
AND p.products_id = pd.products_id
AND p.products_type <> ' $typeID '
AND pd.language_id = :languageID " . $display_limit . $order_by;
$products_new_query_raw = $db->bindVars($products_new_query_raw, ':languageID', $_SESSION['languages_id'], 'integer');
$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);
//check to see if we are in normal mode ... not showcase, not maintenance, etc
$show_submit = zen_run_normal();
// check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed
if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $products_new_split->number_of_rows > 0) {
// check how many rows
$check_products_all = $db->Execute($products_new_split->sql_query);
$how_many = 0;
while (!$check_products_all->EOF) {
if (zen_has_product_attributes($check_products_all->fields['products_id'])) {
} else {
// needs a better check v1.3.1
if ($check_products_all->fields['products_qty_box_status'] != 0) {
if (zen_get_products_allow_add_to_cart($check_products_all->fields['products_id']) !='N') {
if ($check_products_all->fields['product_is_call'] == 0) {
if ((SHOW_PRODUCTS_SOLD_OUT_IMAGE == 1 and $check_products_all->fields['products_quantity'] > 0) or SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) {
if ($check_products_all->fields['products_type'] != 3) {
if (zen_has_product_attributes($check_products_all->fields['products_id']) < 1) {
$how_many++;
}
}
}
}
}
}
}
$check_products_all->MoveNext();
}
if ( (($how_many > 0 and $show_submit == true and $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_NEW_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 $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
}
?>
Kind of a quick way of doing it. This only affects the 'New Product' page. Hopefully that helps with your question.
Bookmarks