(crap... I hit "submit" and it asked me to login and then didn't work... so my appologies if this is a double post)
I had this same problem... I have products that come out later in the year, but are showing up in the "new products for" this month area of the page.
I tried disabling the products and got this result:
--no they don't show on the category page (correct)
--still show in the "new products for this month" area (incorrect)
--and show in the "Upcoming Products" area (correct... I guess... though I did disable them... so even tho I like this functionality... it seems a little wrong for disabled products to be displaying anywhere, ever... plus when I click on these products, it brings me to a "Sorry, the product was not found." page.)
maybe I don't quite understand what zen cart's current definition of "disabled" means... I thought it meant "keep it in the data base, but don't display it *ever*"
I'm great with php, but new to mySQL... I found includes/modules/new_products.php and the following line (line 40 for me... in the 'else' statment):
Code:
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
p.products_date_added, p.products_price, p.products_type, p.master_categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id in (" . $list_of_products . ")";
}
I changed it to:
Code:
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
p.products_date_added, products_status, p.products_price, p.products_type, p.master_categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_status = 1
and p.products_id in (" . $list_of_products . ")";
}
it works as far as not displaying the disabled products in the "New Products for this month" area... but it's not the right answer (because my products are disabled... so when you click on them in the "Up coming products" area of a page, you go to a "Sorry, the product was not found." page.
SO IF YOU KNOW MYSQL, can you help me out with the query command above... rather than the products_status stuff I added... I like to add a
"products_date_available" and check if it's ">= today".... checking "p.product_status = 1" was easy.... but I don't know the mySQL syntax for ">= today"....
Thanks.
also, I'm still very knew to the whole open source environment... It seems to me that the logic in this file is a little off... instead of listing "products added this month"... it seems like it should display "products that are added this month and don't have any available data as well as products that are available this month (and were added months ago)" ... I don't even know where I'd begin to get the communities clearance to attempt to change this logic and then submit it, etc...
Thanks again,
~Danny
Bookmarks