Fredrik.r Posted April 9, 2006 Share Posted April 9, 2006 Hi Dennis, I'm running Wishlist together with QTPro so it's not a standard case, but it works with some modifications in application_top.php I would like Wishlist to work with SPPC. As default the wrong prices are put in the wishlist (default retail prices even for wholesale customers with lower prices). Anyone using both of them? Quote Link to comment Share on other sites More sharing options...
Fredrik.r Posted April 9, 2006 Share Posted April 9, 2006 Another solution may be to deactivate the "Add to wishlist" and my wishlist button in the menu if someone are are assigned to another price group than default. Or should I ask about this in the SPPC thread? Quote Link to comment Share on other sites More sharing options...
dblake Posted April 10, 2006 Author Share Posted April 10, 2006 A solution/work around has been implemented by Janz in the sppc thread i believe. All it should be is a re-write/change to the price query to display and add the right price to the cart. Someone a few pages back got it working with SPPC so I know its been done ;) -Dennis Quote Link to comment Share on other sites More sharing options...
Fredrik.r Posted April 10, 2006 Share Posted April 10, 2006 (edited) Thank you Dennis! I'll have a look. Sometimes when searching this huge forum I really can't find the answers.. :/ Edited April 10, 2006 by Fredrik.r Quote Link to comment Share on other sites More sharing options...
Graveyard666 Posted April 21, 2006 Share Posted April 21, 2006 I just installed this contrib and all works well except one thing. I searched the thread but couldn't find a resolution.. if I pick a SOLD OUT item to add to my wishlist then I can't delete it from wishlist.php the delete button is there but the checkbox is missing I was thinking maybe making some php code on my product_info.php page so it only shows the "add to wishlist" button when items are anything but sold out but thought i'd check here first for a solution on wishlist.php Quote Link to comment Share on other sites More sharing options...
tammy507 Posted April 25, 2006 Share Posted April 25, 2006 I need to get paid for that knowledge holy smoke :P -Dennis hmmm, I offered to Pay and had no takers! Tammy Quote Link to comment Share on other sites More sharing options...
scrappycz Posted April 28, 2006 Share Posted April 28, 2006 I just installed this contrib and all works well except one thing. I searched the thread but couldn't find a resolution.. if I pick a SOLD OUT item to add to my wishlist then I can't delete it from wishlist.php the delete button is there but the checkbox is missing I was thinking maybe making some php code on my product_info.php page so it only shows the "add to wishlist" button when items are anything but sold out but thought i'd check here first for a solution on wishlist.php Hi, I am not very good in php coding, but I found this section in wishlist.php /******************************************************************* * PREVENT THE ITEM FROM BEING ADDED TO CART IF NO LONGER AVAILABLE * *******************************************************************/ if($products['products_status'] != 0) { echo tep_draw_checkbox_field('add_wishprod[]',$wishlist_id); } ?> and changed this line: if($products['products_status'] != 0) { to this: if($products['products_status'] >= 0) { Quote Link to comment Share on other sites More sharing options...
dblake Posted April 28, 2006 Author Share Posted April 28, 2006 What that line checks for is if a product has a status value of 0, it means that product is "inactive", or w/e osc uses. So that product isn't available, and if you notice if a product is inactive most times it doesn't show in your store at all. There is a setting i believe that if your stock goes to 0, to automatically change to inactive or not, not sure about this. Anyway back on point, by changing that line to >= 0, it means that you can still select an inactive product. So your "fix" wont work. Also but filtering your wishlist button to only add products that are not sold out won't work. Scenerio: Customer adds product in stock to wishlist, next day the product is sold out, product is still on customers wishlist. Check for some setting to prevent the products from going to inactive status with a stock count of 0. -Dennis Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 6, 2006 Share Posted May 6, 2006 Hello I installed this contribution, but whenever I select the "Add to Wishlist" button, it adds and takes me to the cart, and the wishlist is never updated? Anyone know what might be happening? Quote Link to comment Share on other sites More sharing options...
swtnhpy Posted May 10, 2006 Share Posted May 10, 2006 Anyone have any idea whether you can use this with STS and what is the call for it as a box. I have tried everything $wishlistbox $wishlist $wishbox....it is not working at all. Wishlist works perfectly but I can't add it on my STS site. Any ideas? Quote Link to comment Share on other sites More sharing options...
swtnhpy Posted May 10, 2006 Share Posted May 10, 2006 (edited) BTW..I already added the code to the sts_display_output.php for the box. The words $wishlistbox aren't showing up anymore but yet it is not populating either. Edited May 10, 2006 by swtnhpy Quote Link to comment Share on other sites More sharing options...
Fredrik.r Posted May 10, 2006 Share Posted May 10, 2006 (edited) Hi Jen! Follow these steps and you can include your wishlist box. You can name it anything you want but I choosed wishlistbox in the example below. In sts_display_output.php Below "Create custom boxes" (around row 228); $template['wishlistbox'] = strip_unwanted_tags($sts_block['wishlistbox'], 'wishlistbox'); Below Display HTML -> "Print column right stuff" (around row 313); echo $sts_block['wishlistbox']; In column_right.php or column_left.php (doesnt matter) if($wishList->count_wishlist() != '0') { require(DIR_WS_BOXES . 'wishlist.php'); }00 // STS: ADD $sts_block_name = 'wishlistbox'; require(STS_RESTART_CAPTURE); // STS: EOADD In your template $wishlistbox Edited May 10, 2006 by Fredrik.r Quote Link to comment Share on other sites More sharing options...
Fredrik.r Posted May 10, 2006 Share Posted May 10, 2006 I could not remove the "\0\0" in ny example above. It is not supposed to be there. Quote Link to comment Share on other sites More sharing options...
swtnhpy Posted May 10, 2006 Share Posted May 10, 2006 Ok....I added the code in the column_left as it says above. If there is nothing in the wishlist, that box is totally empty. No header, nothing to even let customers know there is a wishlist there. So if you remove the line in column left that says if($wishList->count_wishlist() != '0') You will have a wishlist box. Thanks :) Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 10, 2006 Share Posted May 10, 2006 Whenever I click on 'Add to Wishlist', it adds to cart and never adds the wishlist, anyone know what might be happening? Quote Link to comment Share on other sites More sharing options...
bbraven Posted May 12, 2006 Share Posted May 12, 2006 I'm having some problems with Wishlist 3.5d... When someone logs in or clicks "Add to Wishlist" they get the following error on a blank page, and can only get out of it by clicking the back button: 1146 - Table 'mydatabase_db2.TABLE_WISHLIST' doesn't exist insert into TABLE_WISHLIST (customers_id, products_id) values ('7', '185{5}11') [TEP STOP] The wishlist box will show up after someone clicks the back button after having clicked the "Add to Wishlist" button. BUT at the top of the product description, it will then show "PRODUCT_ADDED_TO_WISHLIST" I'm assuming it should show some other text there. It's wierd, it performs the actions, but it keeps giving errors saying the TABLE_WISHLIST doesn't exist. Like when you delete something from the wishlist: 1146 - Table 'mydatabase_db2.TABLE_WISHLIST' doesn't exist delete from TABLE_WISHLIST where products_id = '185{5}11' and customers_id = '7' [TEP STOP] But when you hit the back button, the item WAS deleted. Quote Unique handcrafted jewelry, accessories, toys, home decor, digital art and much more. Link to comment Share on other sites More sharing options...
bbraven Posted May 12, 2006 Share Posted May 12, 2006 Figured it out. For some reason the database_tables file wasn't overwriting, and it was making the error. Quote Unique handcrafted jewelry, accessories, toys, home decor, digital art and much more. Link to comment Share on other sites More sharing options...
aodfan Posted May 14, 2006 Share Posted May 14, 2006 Whenever I click on 'Add to Wishlist', it adds to cart and never adds the wishlist, anyone know what might be happening? Anyone? Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 14, 2006 Share Posted May 14, 2006 I have went through the whole reinstall process and can not figure this out, the only thing I can think of if somehow a contribution is affecting it, the only contribution that I can think of that may be affecting it is "Column Controller." If you guys need me to post whatever code you need, I will. Thanks Quote Link to comment Share on other sites More sharing options...
dblake Posted May 15, 2006 Author Share Posted May 15, 2006 Whenever I click on 'Add to Wishlist', it adds to cart and never adds the wishlist, anyone know what might be happening? Make sure the add to wishlist code in applicaton top, is before the add to cart actions. This is important or it will add to cart like the problem you are expierencing. I even added a note in the install instructions about this. -Dennis Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 15, 2006 Share Posted May 15, 2006 Make sure the add to wishlist code in applicaton top, is before the add to cart actions. This is important or it will add to cart like the problem you are expierencing. I even added a note in the install instructions about this. -Dennis Hey Dennis, Thanks for your reply, but it seems that the application top seems to where it needs to be, I tried even removing the Down for Maintainence portion to see if that was conflicting with it. Here is my application top.php though: <?php /* $Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ // start the timer for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); // set the level of error reporting error_reporting(E_ALL & ~E_NOTICE); //// Performance assessment code // Bobby Easland, 28 November 2005 $debug = array('TOTAL_PARSE_TIME' => 0, 'TOTAL_MYSQL_TIME' => 0, 'TOTAL_QUERIES' => 0); // check if register_globals is enabled. // since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized. if (function_exists('ini_get')) { ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!'); } // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.php'); define('FILENAME_COLUMN_CONTROLLER', 'column_controller.php'); // include server parameters require('includes/configure.php'); if (strlen(DB_SERVER) < 1) { if (is_dir('install')) { header('Location: install/index.php'); } } // define the project version define('PROJECT_VERSION', 'osCommerce 2.2-MS2'); // set the type of request (secure or not) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; // set php_self in the local scope if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; if ($request_type == 'NONSSL') { define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); } else { define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG); } // include the list of project filenames require(DIR_WS_INCLUDES . 'filenames.php'); // include the list of project database tables require(DIR_WS_INCLUDES . 'database_tables.php'); // customization for the design layout define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125) // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); //how wide should the columns be in pixels $column_left_query = tep_db_query("select configuration_value as left_width from configuration where configuration_key = 'BOX_WIDTH_LEFT'"); $column_left = tep_db_fetch_array($column_left_query); define('BOX_WIDTH_LEFT_IS', $column_left['left_width']); $column_right_query = tep_db_query("select configuration_value as right_width from configuration where configuration_key= 'BOX_WIDTH_RIGHT'"); $column_right = tep_db_fetch_array($column_right_query); define('BOX_WIDTH_RIGHT_IS', $column_right['right_width']); // set application wide parameters // Configuration Cache modification start require ('includes/configuration_cache_read.php'); // Configuration Cache modification end // if gzip_compression is enabled, start to buffer the output if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) { if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) { if (PHP_VERSION >= '4.0.4') { ob_start('ob_gzhandler'); } else { include(DIR_WS_FUNCTIONS . 'gzip_compression.php'); ob_start(); ob_implicit_flush(); } } else { ini_set('zlib.output_compression_level', GZIP_LEVEL); } } // set the HTTP GET parameters manually if search_engine_friendly_urls is enabled if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { if (strlen(getenv('PATH_INFO')) > 1) { $GET_array = array(); $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF); $vars = explode('/', substr(getenv('PATH_INFO'), 1)); for ($i=0, $n=sizeof($vars); $i<$n; $i++) { if (strpos($vars[$i], '[]')) { $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1]; } else { $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1]; } $i++; } if (sizeof($GET_array) > 0) { while (list($key, $value) = each($GET_array)) { $HTTP_GET_VARS[$key] = $value; } } } } // define general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); // set the cookie domain $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN); $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH); // include cache functions if enabled if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php'); // include shopping cart class require(DIR_WS_CLASSES . 'shopping_cart.php'); // include wishlist class require(DIR_WS_CLASSES . 'wishlist.php'); // include navigation history class require(DIR_WS_CLASSES . 'navigation_history.php'); // some code to solve compatibility issues require(DIR_WS_FUNCTIONS . 'compatibility.php'); // check if sessions are supported, otherwise use the php3 compatible session class if (!function_exists('session_start')) { define('PHP_SESSION_NAME', 'osCsid'); define('PHP_SESSION_PATH', $cookie_path); define('PHP_SESSION_DOMAIN', $cookie_domain); define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY); include(DIR_WS_CLASSES . 'sessions.php'); } // define how the session functions will be used require(DIR_WS_FUNCTIONS . 'sessions.php'); // set the session name and save path tep_session_name('osCsid'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } // set the session ID if it exists if (isset($HTTP_POST_VARS[tep_session_name()])) { tep_session_id($HTTP_POST_VARS[tep_session_name()]); } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) { tep_session_id($HTTP_GET_VARS[tep_session_name()]); } // start the session $session_started = false; if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain); if (isset($HTTP_COOKIE_VARS['cookie_test'])) { tep_session_start(); $session_started = true; } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = strtolower(getenv('HTTP_USER_AGENT')); $spider_flag = false; if (tep_not_null($user_agent)) { $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); for ($i=0, $n=sizeof($spiders); $i<$n; $i++) { if (tep_not_null($spiders[$i])) { if (is_integer(strpos($user_agent, trim($spiders[$i])))) { $spider_flag = true; break; } } } } if ($spider_flag == false) { tep_session_start(); $session_started = true; } } else { tep_session_start(); $session_started = true; } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { $ssl_session_id = getenv('SSL_SESSION_ID'); if (!tep_session_is_registered('SSL_SESSION_ID')) { $SESSION_SSL_ID = $ssl_session_id; tep_session_register('SESSION_SSL_ID'); } if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } } // verify the browser user agent if the feature is enabled if (SESSION_CHECK_USER_AGENT == 'True') { $http_user_agent = getenv('HTTP_USER_AGENT'); if (!tep_session_is_registered('SESSION_USER_AGENT')) { $SESSION_USER_AGENT = $http_user_agent; tep_session_register('SESSION_USER_AGENT'); } if ($SESSION_USER_AGENT != $http_user_agent) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // verify the IP address if the feature is enabled if (SESSION_CHECK_IP_ADDRESS == 'True') { $ip_address = tep_get_ip_address(); if (!tep_session_is_registered('SESSION_IP_ADDRESS')) { $SESSION_IP_ADDRESS = $ip_address; tep_session_register('SESSION_IP_ADDRESS'); } if ($SESSION_IP_ADDRESS != $ip_address) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // create the shopping cart & fix the cart if necesary if (tep_session_is_registered('cart') && is_object($cart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new shoppingCart; $cart->unserialize($broken_cart); } } else { tep_session_register('cart'); $cart = new shoppingCart; } // include currencies class and create an instance require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); // include the mail classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // set the language if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { if (!tep_session_is_registered('language')) { tep_session_register('language'); tep_session_register('languages_id'); } include(DIR_WS_CLASSES . 'language.php'); $lng = new language(); if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) { $lng->set_language($HTTP_GET_VARS['language']); } else { $lng->get_browser_language(); } $language = $lng->language['directory']; $languages_id = $lng->language['id']; } // include the language translations require(DIR_WS_LANGUAGES . $language . '.php'); // Ultimate SEO URLs v2.1 if (SEO_ENABLED == 'true') { include_once(DIR_WS_CLASSES . 'seo.class.php'); if ( !is_object($seo_urls) ){ $seo_urls = new SEO_URL($languages_id); } } // currency if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) { if (!tep_session_is_registered('currency')) tep_session_register('currency'); if (isset($HTTP_GET_VARS['currency'])) { if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } else { $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } } // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); // BOF: Down for Maintenance except for admin ip if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){ if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); } } // do not let people get to down for maintenance page if not turned on if (DOWN_FOR_MAINTENANCE=='false' and strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } // EOF: WebMakers.com Added: Down for Maintenance // wishlist data if(!tep_session_is_registered('wishList')) { tep_session_register('wishList'); $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if(isset($HTTP_POST_VARS['wishlist_x'])) { if(isset($HTTP_POST_VARS['products_id'])) { if(isset($HTTP_POST_VARS['id'])) { $attributes_id = $HTTP_POST_VARS['id']; tep_session_register('attributes_id'); } $wishlist_id = $HTTP_POST_VARS['products_id']; tep_session_register('wishlist_id'); } tep_redirect(tep_href_link(FILENAME_WISHLIST)); } // Shopping cart actions if (isset($HTTP_GET_VARS['action'])) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } if ($HTTP_GET_VARS['action'] == 'update_product') { $parameters = array('action', 'pid'); $goto = basename($PHP_SELF); } switch ($HTTP_GET_VARS['action']) { // customer wants to update the product quantity in their shopping cart case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) { if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) { $cart->remove($HTTP_POST_VARS['products_id'][$i]); } else { if (PHP_VERSION < 4) { // if PHP3, make correction for lack of multidimensional array. reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (is_array($value)) { while (list($key2, $value2) = each($value)) { if (ereg ("(.*)\]\[(.*)", $key2, $var)) { $id2[$var[1]][$var[2]] = $value2; } } } } $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : ''; } else { $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : ''; } $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id']) && ($HTTP_POST_VARS['products_id']==(int)$HTTP_POST_VARS['products_id'])) { //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); //++++ QT Pro: End Changed Code } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+$list_quantity); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; case 'notify' : if (tep_session_is_registered('customer_id')) { if (isset($HTTP_GET_VARS['products_id'])) { $notify = $HTTP_GET_VARS['products_id']; } elseif (isset($HTTP_GET_VARS['notify'])) { $notify = $HTTP_GET_VARS['notify']; } elseif (isset($HTTP_POST_VARS['notify'])) { $notify = $HTTP_POST_VARS['notify']; } else { tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] < 1) { tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())"); } } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); } else { $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; case 'clear_cart' : $cart->reset(true); break; } } //rmh referral start // set the referral id if (!tep_session_is_registered('referral_id') || isset($HTTP_GET_VARS['ref'])) { if (!tep_session_is_registered('referral_id') && !tep_session_is_registered('customer_id')) { tep_session_register('referral_id'); } if (isset($HTTP_GET_VARS['ref']) && tep_not_null($HTTP_GET_VARS['ref'])) { $referral_id = $HTTP_GET_VARS['ref']; } else { $referral_id = ''; } } //rmh referral end // include the password crypto functions require(DIR_WS_FUNCTIONS . 'password_funcs.php'); // include validation functions (right now only email address) require(DIR_WS_FUNCTIONS . 'validations.php'); // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // infobox require(DIR_WS_CLASSES . 'boxes.php'); // auto activate and expire banners require(DIR_WS_FUNCTIONS . 'banner.php'); tep_activate_banners(); tep_expire_banners(); // auto expire special products require(DIR_WS_FUNCTIONS . 'specials.php'); tep_expire_specials(); // calculate category path if (isset($HTTP_GET_VARS['cPath'])) { $cPath = $HTTP_GET_VARS['cPath']; } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) { $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); } else { $cPath = ''; } if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $current_category_id = 0; } // include the breadcrumb class and start the breadcrumb trail require(DIR_WS_CLASSES . 'breadcrumb.php'); $breadcrumb = new breadcrumb; $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); $breadcrumb->add(HEADER_TITLE_FORUM, 'http://alteredmotorsports.com/forums'); // add category names or the manufacturer name to the breadcrumb trail if (isset($cPath_array)) { for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); define('CURRENT_CATEGORY_NAME', $categories['categories_name']); $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); define('CURRENT_MANUFACTURER_NAME', $manufacturers['manufacturers_name']); $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'])); } } // add the products model to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { $sql = "SELECT p.products_model, pd.products_name FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '".(int)$languages_id."' LIMIT 1"; $product_query = tep_db_query($sql); if (tep_db_num_rows($product_query)) { $product = tep_db_fetch_array($product_query); define('CURRENT_PRODUCT_NAME', $product['products_name']); $breadcrumb->add($product['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])); // include the articles functions require(DIR_WS_FUNCTIONS . 'articles.php'); require(DIR_WS_FUNCTIONS . 'article_header_tags.php'); // calculate topic path if (isset($HTTP_GET_VARS['tPath'])) { $tPath = $HTTP_GET_VARS['tPath']; } elseif (isset($HTTP_GET_VARS['articles_id']) && !isset($HTTP_GET_VARS['authors_id'])) { $tPath = tep_get_article_path($HTTP_GET_VARS['articles_id']); } else { $tPath = ''; } if (tep_not_null($tPath)) { $tPath_array = tep_parse_topic_path($tPath); $tPath = implode('_', $tPath_array); $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)]; } else { $current_topic_id = 0; } // add topic names or the author name to the breadcrumb trail if (isset($tPath_array)) { for ($i=0, $n=sizeof($tPath_array); $i<$n; $i++) { $topics_query = tep_db_query("select topics_name from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . (int)$tPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($topics_query) > 0) { $topics = tep_db_fetch_array($topics_query); $breadcrumb->add($topics['topics_name'], tep_href_link(FILENAME_ARTICLES, 'tPath=' . implode('_', array_slice($tPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($HTTP_GET_VARS['authors_id'])) { $authors_query = tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'"); if (tep_db_num_rows($authors_query)) { $authors = tep_db_fetch_array($authors_query); $breadcrumb->add('Articles by ' . $authors['authors_name'], tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $HTTP_GET_VARS['authors_id'])); } } // add the articles name to the breadcrumb trail if (isset($HTTP_GET_VARS['articles_id'])) { $article_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'"); if (tep_db_num_rows($article_query)) { $article = tep_db_fetch_array($article_query); if (isset($HTTP_GET_VARS['authors_id'])) { $breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'authors_id=' . $HTTP_GET_VARS['authors_id'] . '&articles_id=' . $HTTP_GET_VARS['articles_id'])); } else { $breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'tPath=' . $tPath . '&articles_id=' . $HTTP_GET_VARS['articles_id'])); } } } } } // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; // set which precautions should be checked define('WARN_INSTALL_EXISTENCE', 'true'); define('WARN_CONFIG_WRITEABLE', 'true'); define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true'); define('WARN_SESSION_AUTO_START', 'true'); define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'); /*--------------------------------------------------------*\ # Page cache contribution - by Chemo # Define the pages to be cached in the $cache_pages array \*--------------------------------------------------------*/ $cache_pages = array('index.php', 'product_info.php'); if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true') { # Start the output buffer for the shopping cart ob_start(); require(DIR_WS_BOXES . 'shopping_cart.php'); $cart_cache = ob_get_clean(); # End the output buffer for cart and save as $cart_cache string # Loop through the $cache_pages array and start caching if found foreach ($cache_pages as $index => $page){ if ( strpos($_SERVER['PHP_SELF'], $page) ){ include_once(DIR_WS_CLASSES . 'page_cache.php'); $page_cache = new page_cache($cart_cache); # The cache timelife is set globally # in the admin control panel settings # Example below overrides the setting to 60 minutes # Leave blank to use default setting # $page_cache->cache_this_page(60); $page_cache->cache_this_page(); } # End if } # End foreach } # End if //Do the superstats business require(DIR_WS_CLASSES . 'supertracker.php'); $tracker = new supertracker; $tracker->update(); // set the pollbooth parameters (can be modified through the administration tool) $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from phesis_poll_config'); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // set the pollbooth parameters (can be modified through the administration tool) // BOF: WebMakers.com Added: Header Tags Controller v2.5.2 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // EOF: WebMakers.com Added: Header Tags Controller v2.5.2 // faqsdesk define('DIR_WS_RSS', DIR_WS_INCLUDES . 'modules/faqdesk/rss/'); ?> Quote Link to comment Share on other sites More sharing options...
dblake Posted May 15, 2006 Author Share Posted May 15, 2006 (edited) Looks fine, paste your product_info.php Edited May 15, 2006 by dblake Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 15, 2006 Share Posted May 15, 2006 here is product_info.php, thanks: <?php /* $Id: product_info.php,v 1.98 2003/09/02 18:52:33 project3000 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_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v2.5.2 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v2.5.2 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH_LEFT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT_IS; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { if (!tep_session_is_registered('recently_viewed')) { tep_session_register('recently_viewed'); $recently_viewed = $HTTP_GET_VARS['products_id'] . ';'; //$recently_viewed = ""; } $check_not_duplicate = $HTTP_GET_VARS['products_id']; $temp_recent = $recently_viewed; if (!ereg($check_not_duplicate, $temp_recent ) ) $recently_viewed = $HTTP_GET_VARS['products_id'] . ';' . $recently_viewed; // BOF MaxiDVD: Modified For Ultimate Images Pack! $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_availability_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); // EOF MaxiDVD: Modified For Ultimate Images Pack! $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } //DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED if(tep_session_is_registered('wishlist_id')){ ?> <tr> <td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td> </tr> <?php tep_session_unregister('wishlist_id'); } $products_availability = $product_info['products_availability_id']; $products_availability_info_query = tep_db_query("select e.products_availability_name from " . TABLE_PRODUCTS_AVAILABILITY . " e where e.products_availability_id = '" . (int)$products_availability . "' and e.language_id = '" . (int)$languages_id . "'"); $products_availability_info = tep_db_fetch_array($products_availability_info_query); $products_availability_name = $products_availability_info['products_availability_name']; ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php // BOF: WebMakers.com Added: Show Category and Image if (SHOW_CATEGORIES=='1') { ?> <tr><td colspan="2"><table align="right"> <tr> <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td> </tr> <tr> <td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td> </tr> </table></td></tr> <?php } // EOF: WebMakers.com Added: Show Category and Image ?> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> <?php if (tep_not_null($products_availability_info['products_availability_name'])) { ?> <tr> <td class="main" align="right" valign="top"></td> <td class="main" align="right" valign="top"><b><?php echo TEXT_AVAILABILITY; ?></b>: <?php echo $products_availability_name; ?></td> </tr> <?php } ?> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { //++++ QT Pro: Begin Changed code ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"> <?php //++++ QT Pro: End Changed Code ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //--> <?php if ($product_info['products_image_med']!='') { $new_image = $product_info['products_image_med']; $image_width = MEDIUM_IMAGE_WIDTH; $image_height = MEDIUM_IMAGE_HEIGHT; } else { $new_image = $product_info['products_image']; $image_width = SMALL_IMAGE_WIDTH; $image_height = SMALL_IMAGE_HEIGHT;}?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . 'ℑ=0') . '\\\')">' . tep_image(DIR_WS_IMAGES . $new_image, addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button_nocss('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '">' . tep_image(DIR_WS_IMAGES . $new_image . 'ℑ=0', addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?> </noscript> <!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //--> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php //++++ QT Pro: Begin Changed code if (tep_not_null($product_info['products_image'])) { ?> </td> </tr> </table> <?php //++++ QT Pro: End Changed Code $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { //++++ QT Pro: Begin Changed code $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php'); $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN; $pad = new $class($products_id); echo $pad->draw(); //++++ QT Pro: End Changed Code } ?> </td> </tr> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); // BOF: WebMakers.com Added: Attributes Copy and Sort if ( PRODUCTS_OPTIONS_SORT_BY_PRICE !='1' ) { $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.products_options_sort_order, pov.products_options_values_name"); } else { $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.products_options_sort_order, pa.options_values_price"); } // EOF: WebMakers.com Added: Attributes Copy and Sort while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php } ?> <?php // BOF MaxiDVD: Modified For Ultimate Images Pack! if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); } // BOF MaxiDVD: Modified For Ultimate Images Pack! ; ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where approved = 1 and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td> <td class="main" align="right"><?php echo '<b>Quantity:</b> <input type="text" name="quantity" value="1" maxlength="5" size="3">' . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php //added for cross -sell if ( (USE_CACHE == 'true') && !SID) { echo tep_cache_also_purchased(3600); include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); } else { include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); } ?> Quote Link to comment Share on other sites More sharing options...
dblake Posted May 15, 2006 Author Share Posted May 15, 2006 Seems to be correct. You have a lot of modifications though. Not sure if something could be interfering or not. You have a url I can use to test this? Quote Link to comment Share on other sites More sharing options...
aodfan Posted May 16, 2006 Share Posted May 16, 2006 Seems to be correct. You have a lot of modifications though. Not sure if something could be interfering or not. You have a url I can use to test this? You have a PM. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.