Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RMH

Archived
  • Posts

    8
  • Joined

  • Last visited

Everything posted by RMH

  1. I have now tried everyting in this post, but items on Happy Hour does not display the correct price (The price is only correct in the box). In the product list it only display regular price or specials price. If somebody has got this modul to work, I would be very thankfull for any suggestions on how to make it work :-)
  2. I have updated to the last version of the Future products contribution, but I still can't make it work with Enable/Disable categories. I would be very gratefull if somebody could help me edit the file below :) : <?php /* $Id: featured.php,v 1.7 2008/08/22 22:30:20 aa0001 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License Featured Products V1.1 Displays a list of featured products, selected from admin For use as an Infobox instead of the "New Products" Infobox */ ?> <!-- featured_products //--> <?php if( defined('FEATURED_PRODUCTS_DISPLAY') AND FEATURED_PRODUCTS_DISPLAY == 'true' ) { $featured_products_category_id = $new_products_category_id; $cat_name_query = tep_db_query('SELECT `categories_name` FROM ' . TABLE_CATEGORIES_DESCRIPTION . " WHERE `categories_id` = '" . $featured_products_category_id . "' limit 1"); $cat_name_fetch = tep_db_fetch_array($cat_name_query); $cat_name = $cat_name_fetch['categories_name']; $info_box_contents = array(); list($usec, $sec) = explode(' ', microtime()); srand( (float) $sec + ((float) $usec * 100000) ); $mtm= rand(); if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); // Phocea Optimize featured query // Ben: Option to only show featured products on sale $query = 'SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name '; if ( defined('FEATURED_PRODUCTS_SPECIALS_ONLY') AND FEATURED_PRODUCTS_SPECIALS_ONLY == 'true' ) { $query .= 'FROM ' . TABLE_SPECIALS . ' s LEFT JOIN ' . TABLE_PRODUCTS . ' p ON s.products_id = p.products_id '; } else { $query .= 'FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id '; } $query .= 'LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' LEFT JOIN " . TABLE_FEATURED . " f ON p.products_id = f.products_id WHERE p.products_status = '1' AND f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; $featured_products_query = tep_db_query( $query ); } else { $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name)); $subcategories_array = array(); tep_get_subcategories($subcategories_array, $featured_products_category_id); $featured_products_category_id_list = tep_array_values_to_string($subcategories_array); if ($featured_products_category_id_list == '') { $featured_products_category_id_list .= $featured_products_category_id; } else { $featured_products_category_id_list .= ',' . $featured_products_category_id; } if ( defined('FEATURED_PRODUCTS_SUB_CATEGORIES') AND FEATURED_PRODUCTS_SUB_CATEGORIES == 'true' ) { // current catID as starting value $cats[] = $new_products_category_id; // put cat-IDs of all cats nested in current branch into $cats array, // go through all subbranches for($i=0; $i<count($cats); $i++) { $categorie_query = tep_db_query('SELECT `categories_id` FROM ' . TABLE_CATEGORIES . " WHERE parent_id = '" . (int)$cats[$i] . "'"); while ($categorie = tep_db_fetch_array($categorie_query)) { $cats[] = $categorie['categories_id']; } // sort out doubles $cats = array_unique($cats); } $catIdSql = implode(', ', $cats); } else { $catIdSql = $featured_products_category_id_list; } // Phocea Optimize featured query $query = 'SELECT distinct p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_PRODUCTS_TO_CATEGORIES . ' p2c using(products_id) LEFT JOIN ' . TABLE_CATEGORIES . ' c USING (categories_id) LEFT JOIN ' . TABLE_FEATURED . ' f ON p.products_id = f.products_id LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' where c.categories_id IN(" . $catIdSql . ") AND p.products_status = '1' AND f.status = '1' "; if ( defined('FEATURED_PRODUCTS_SPECIALS_ONLY') AND FEATURED_PRODUCTS_SPECIALS_ONLY == 'true' ) { $query .= " AND s.status = '1' "; } $query .= 'ORDER BY rand(' . $mtm . ') DESC LIMIT ' . MAX_DISPLAY_FEATURED_PRODUCTS; $featured_products_query = tep_db_query( $query ); } $row = 0; $col = 0; $num = 0; while ($featured_products = tep_db_fetch_array($featured_products_query)) { $num ++; if ($num == 1) { new infoBoxHeading($info_box_contents, false, false); } // If on special show regular and sale price if (tep_not_null($featured_products['specials_new_products_price'])) { $products_price = '<s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br>'; $products_price .= '<span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])); } $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $products_price); $col ++; if ($col > 2) { $col = 0; $row ++; } } if($num) { new contentBox($info_box_contents); } } else { // If it's disabled, then include the original New Products box // include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module } ?><!-- featured_products_eof //-->
  3. OK, but I'm using the Enable & Disable Categories module v.1.6.6 (http://addons.oscommerce.com/info/326). It's working like it shall on the normal featured products, but I can't get it to work on the featured products contribution that enables futured products to be displayed on the main page instead of new products. (See my last post)
  4. Thank you for a very good contribution. I've got it up and running, but I have installed a contribution to show the featured products on the main page, and it will still show products in hidden categories. Could somebody help me modifying this file (catalog/includes/modules/featured.php) so that it will work with enable/disable categories?: <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License Featured Products V1.1 Displays a list of featured products, selected from admin For use as an Infobox instead of the "New Products" Infobox */ ?> <!-- featured_products //--> <?php if(FEATURED_PRODUCTS_DISPLAY == 'true') { $featured_products_category_id = $new_products_category_id; $cat_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $featured_products_category_id . "' limit 1"); $cat_name_fetch = tep_db_fetch_array($cat_name_query); $cat_name = $cat_name_fetch['categories_name']; $info_box_contents = array(); if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); list($usec, $sec) = explode(' ', microtime()); srand( (float) $sec + ((float) $usec * 100000) ); $mtm= rand(); $featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } else { $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name)); $subcategories_array = array(); tep_get_subcategories($subcategories_array, $featured_products_category_id); $featured_products_category_id_list = tep_array_values_to_string($subcategories_array); if ($featured_products_category_id_list == '') { $featured_products_category_id_list .= $featured_products_category_id; } else { $featured_products_category_id_list .= ',' . $featured_products_category_id; } $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } $row = 0; $col = 0; $num = 0; while ($featured_products = tep_db_fetch_array($featured_products_query)) { $num ++; if ($num == 1) { new infoBoxHeading($info_box_contents, false, false); } $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']); if($featured_products['specstat']) { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>'); } else { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']))); } $col ++; if ($col > 2) { $col = 0; $row ++; } } if($num) { new contentBox($info_box_contents); } } else // If it's disabled, then include the original New Products box { // include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module } ?><!-- featured_products_eof //-->
  5. OK, so I guess that you have no plans on making a version for the MS2? ;) I don't know if I'm willing to make all the changes needed for the upgrade to RC2A yet, as my shop have quite some modules added. Maybe I'll take a closer look at it later to see if it's possible to make it work with MS2. Just have to get the error message to show when the box is not ticked and I must make some adjustments to get the Cardia payment module work.
  6. I have installed it on the 2.2 MS2. I got the check box to work (but no message when the box is not ticked in the order confirmation, it just refreshes), but then the Cardia (Visa/Mastercard) payment module was bypassed. :( So I got back to just using the create account part of the contribution. Has anybody got this working on MS2? I must anyway thank Larsson for making this module available for the public :)
  7. I'm having the same problem with 2.2a, when a customer is trying to confirm an order the page only refreshes with or without the chack box ticked. The module works perfectly when a customer shall register a new account but not when he tries to confirm the order.
×
×
  • Create New...