cdi-buy.com Posted May 24, 2004 Posted May 24, 2004 I have a problem with "New Products" showing ALL Products added since Day 1. Where/what is the query that determines what defines a "New Product" as "New"????
agiftcodotcom Posted May 24, 2004 Posted May 24, 2004 It's just the X newest products you've added. It does not change until you add more. If you want something that will give random featured items, look at the Featured Products contribution in my signature. Contributions I used : Updated 06-13-04 23:42 ---------------- Vote on My Graphis Poll
derryadrian Posted May 24, 2004 Posted May 24, 2004 :D Agreed... This page is simply browse all data by descending. Not grouping by categories. I want a New Product just by release date and grouped by category. For example : New Release with date 14/04/2004, Release 7.0 with date 14/03/2004, Release 6.9 with date 10/02/2004, and so on. Well to do this, I had alter/modify manufacturers.php onto a new script. So I can put a listbox "Product by Date Add" selector with result in splitting page. But somehow the layout still not much interesting. Just a plain list with bulleting. I working on layouting the result page. The database are added by one table named release with release_id, release_name (any text you want to add at the list box), release_date. release_info(additional info for particular release) which are a little modification and adoption concept from manufaturer table. There's still no admin section to control this product release by date. So, :D Is there anyone who want to help me finishing this? [.:2s1000s12:.] "Did I had the dream, or did the dream had me?"
cdi-buy.com Posted May 24, 2004 Author Posted May 24, 2004 It's just the X newest products you've added. It does not change until you add more. If you want something that will give random featured items, look at the Featured Products contribution in my signature. This is not true. No matter how many products I add, it shows them ALL as new products. I keep adding new all the time and they are all listed in new products AND all products. I need to somehow set a cutoff time. Example: Added 14+ days ago is no longer considered new. I already have Featured installed. PS I'm not talking about the Newest Products Infobox - I'm talking about the products_new.php page.
agiftcodotcom Posted May 24, 2004 Posted May 24, 2004 Gotcha'. I thought you were talking about the box, not the page :) Contributions I used : Updated 06-13-04 23:42 ---------------- Vote on My Graphis Poll
cdi-buy.com Posted May 24, 2004 Author Posted May 24, 2004 I thought so...I deleted that retarded box a long time ago! :lol:
TerryK Posted May 24, 2004 Posted May 24, 2004 In store admin -> My Store -> Maximum Values, what number do you have shown in the "New Products Listing" field? I believe that is what determines how many products are shown on the products_new.php page. HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
♥bruyndoncx Posted May 24, 2004 Posted May 24, 2004 The maximum values only limits the number of records to show on one page listing. The listing itself goes on forever as there is no cutoff date. You could add the following to catalog/products_new.php file in the first query listed within the where clause, to limit this to products added within the last 14days: From p.products_status = '1' order by To p.products_status = '1' and p.products_date_added > ( curdate( ) -14 ) order by KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
cdi-buy.com Posted May 24, 2004 Author Posted May 24, 2004 awesome! btw - "order by" isnt in the code so I just left that out and it works great. thanks a bunch!
♥bruyndoncx Posted May 24, 2004 Posted May 24, 2004 To have truely the most recent first, you should have order by p.products_date_added desc at the end of the sql code otherwise, likely the ones with the smallest product ids will show first, so the ones that are 14days old KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
jjanguda Posted May 24, 2004 Posted May 24, 2004 p.products_status = '1' and p.products_date_added > ( curdate( ) -14 ) order by This code will arrange the product by descending products_dat_added?
♥bruyndoncx Posted May 24, 2004 Posted May 24, 2004 p.products_status = '1' and p.products_date_added > ( curdate(? )? -14 ) order by This code will arrange the product by descending products_dat_added? ... and p.products_date_added > ( curdate( ) -14 ) order by p.products_date_added desc This code will show products added during the last 14 days with the most recently added first KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
Guest Posted May 27, 2004 Posted May 27, 2004 where would i place the ... and p.products_date_added > ( curdate( ) -14 ) order by p.products_date_added desc exactly? i've tried putting in in several places in my listing_sql query in products_new.php but i can't seem to get it to work.. i'm probably putting it in the wrong place.. please help a newbie to php! here's my products_new.php file: <?php /* $Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="../all.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <table align="left" width="805" height="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"> <!-- body //--> <img src="../gfx/x.gif" width="1" height="3"><br> <table border="0" width="100%" cellspacing="3" cellpadding="0" align="left"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <td width="5"><img src="../gfx/x.gif" width="5" height="1"></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> <?php // create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_ARTIST' => PRODUCT_LIST_ARTIST, 'PRODUCT_LIST_TITLE' => PRODUCT_LIST_TITLE, 'PRODUCT_LIST_FORMAT' => PRODUCT_LIST_FORMAT, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($column, $value) = each($define_list)) { if ($value) $column_list[] = $column; } $select_column_list = ''; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_NAME') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) { continue; } } $listing_sql = "select p.products_id, pd.products_name, p.products_artist, p.products_title, p.products_format, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id $where order by p.products_artist, p.products_title"; include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL); ?> </td> </tr> </table></td> </tr> <?php if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td> <td align="left" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table></td> <?php } ?> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> </td> <td align="right" width="1" valign="top" background="../gfx/line.gif"><img src="../gfx/x.gif" width="1" height="1"></td> </tr></table> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.