Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi,

 

excuse my english..

 

i'd like to know how to make new product box like best sellers box

 

i have begin to do this :

 

adding in mysql this :

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('What new', 'MIN_DISPLAY_BOXNEWPRODUCTS', '1', 'Minimum number of new products to display', '2', '17', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('What new', 'MAX_DISPLAY_BOXNEWPRODUCTS', '10', 'Maximum number of new products to display', '3', '17', now());

 

and replacing whats_new.php by :

 

<?php
/*
 $Id: whats_new.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/



 if (isset($current_category_id) && ($current_category_id > 0)) {
   $whats_new_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BOXNEWPRODUCTS);
 } else {
   $whats_new_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BOXNEWPRODUCTS);
 }


 if (tep_db_num_rows($whats_new_query) >= MIN_DISPLAY_BOXNEWPRODUCTS) {
?>
<!-- whats_new //-->
         <tr>
           <td>
<?php

   $whats_new['products_name'] = tep_get_products_name($whats_new['products_id']);
   $whats_new['specials_new_products_price'] = tep_get_products_special_price($whats_new['products_id']);

   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);


   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

   $rows = 0;
   $whatsnew_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
   while ($whats_new = tep_db_fetch_array($whats_new_query)) {
     $rows++;
     $whatsnew_list .= '<tr><td class="infoBoxContents" valign="top">- </td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']) . '">' . $whats_new['products_name'] . '</a></td></tr>';
   }
   $whatsnew_list .= '</table>';

   $info_box_contents = array();
   $info_box_contents[] = array('text' => $whatsnew_list);

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- whats_new_eof //-->
<?php
 }
?>

not working with new products but with best sellers products.

how to do it working with new products please ?

thanks for helps..

oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5

  • 1 month later...
Posted

Did you ever figure this out?

 

Im trying to do something simmilar, but more along the lines of changing the whats new/new for month box, to be a brand specific IE Ford vs GM, or Sharp vs Samsung type listing.

 

I know it SHOULD be just a sql argument, but sql was never a strong suit, that coupled with osC ... sql code I get lost very easily...

 

HELP?

A signature is something that reflects its user. - The dictionary

 

The question is not, 'to code, or not to code'

the question is, 'if we do not code, are we really alive?'

-- anonymous

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...