Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

WebbyIT

Pioneers
  • Posts

    59
  • Joined

  • Last visited

Everything posted by WebbyIT

  1. I declared them both (individually) but it only worked when I coded everything for $total_weight. I didn't have time to look where it came from but it's on my list as I am curious also. I just remembered seeing it somewhere and thought I'd try it since the code looked right but I couldn't get it to work.
  2. if ($total_weight > SHIPPING_MAX_WEIGHT) { $this->enabled = false; } Not sure why $shipping_weight wouldn't work but I used $total_weight and it worked. You really helped me out of a bind. My problem is that my customer doesn't want to use dimensional and so this module was cutting up individual products that weighed over 150 pounds into multiple packages which can't be done without using a cutting torch. lol Thanks again.
  3. I should have looked closer before responding. The code/module on the page sets a rate table and then assigns a title/courier to display based on the price points all in one module. I want to use the UPSXML module as is (for updating purposes in the future by whoever) for all combined order weights up to 150, and then the flat rate module for all orders weighing over 150 pounds. I need to change the code that assigns which shipping module to show for which circumstances (over 150 or under 150). I think I need to make the changes in the catalog/checkout_shipping.php code where it loads the enabled modules or in the shipping.php class file (or both) but can't figure out what to do. After writing this I just realized that this may not be the appropriate place to post this question. If it isn't please let me know. Thanks again for your help on this.
  4. Thanks, I looked at that site from a previous post you made while I was searching for ways to handle it but did not see this page. It looks like it should solve my problems. I really appreciate your help and quick response.
  5. I've been searching for a way to do 2 things; 1) make the UPSXML shipping module option(s) not show up for orders weighing over 150 pounds. 2) make the flat rate shipping option show for orders that are over 150 pounds in it's place Any help is really appreciated.
  6. This will fix the Admin/Categories.php product listing mentioned above for those that have QPBPP and MSRP contribs installed. All credit goes to those that blazed the trail, I just took what was done by them and applied it to the Admin site. Besides the savings calculations being applied to the MSRP price instead of the catalog price, there are a few other fixes mixed in with the code below, primarily to fix the QPBPP table so it shows the right price across the board when an item is on special. To add the savings discounts off of the MSRP price instead of the catalog price in the QPBPP tables on Admin Site product listings, do the following; In admin/categories.php find -- // BOF QPBPP $pf->loadProduct((int)$HTTP_GET_VARS['pID'], $pInfo->products_price, $pInfo->products_tax_class_id, (int)$pInfo->products_qty_blocks, $price_breaks_array); echo $pf->getPriceString(); // EOF QPBPP Add -- $pInfo->products_msrp, to it; // BOF QPBPP $pf->loadProduct((int)$HTTP_GET_VARS['pID'], $pInfo->products_price, $pInfo->products_msrp, $pInfo->products_tax_class_id, (int)$pInfo->products_qty_blocks, $price_breaks_array); echo $pf->getPriceString(); // EOF QPBPP In admin/includes/classes/priceformatter.php find -- function loadProduct($product_id, $products_price, $products_tax_class_id, $qtyBlocks, $price_breaks_array = NULL) Add $products_msrp, to it function loadProduct($product_id, $products_price, $products_msrp, $products_tax_class_id, $qtyBlocks, $price_breaks_array = NULL) find -- //Compose cachable structure $price_formatter_data = array( 'products_price' => $products_price, 'products_special_price' => $products_special_price, 'products_tax_class_id' => $products_tax_class_id, 'price_breaks' => $price_breaks_array, 'qtyBlocks' => $qtyBlocks); //Assign members $this->thePrice = $price_formatter_data['products_price']; $this->taxClass = $price_formatter_data['products_tax_class_id']; $this->qtyBlocks = $price_formatter_data['qtyBlocks']; $this->price_breaks = $price_formatter_data['price_breaks']; $this->specialPrice = $price_formatter_data['products_special_price']; $this->hasSpecialPrice = tep_not_null($this->specialPrice); change it to -- //Compose cachable structure $price_formatter_data = array( 'products_msrp' => $products_msrp, 'products_price' => $products_price, 'products_special_price' => $products_special_price, 'products_tax_class_id' => $products_tax_class_id, 'price_breaks' => $price_breaks_array, 'qtyBlocks' => $qtyBlocks); //Assign members $this->theMSRP = $price_formatter_data['products_msrp']; $this->thePrice = $price_formatter_data['products_price']; $this->taxClass = $price_formatter_data['products_tax_class_id']; $this->qtyBlocks = $price_formatter_data['qtyBlocks']; $this->discount_categories_id = $price_formatter_data['discount_categories_id']; $this->price_breaks = $price_formatter_data['price_breaks']; $this->specialPrice = $price_formatter_data['products_special_price']; $this->hasSpecialPrice = tep_not_null($this->specialPrice); find -- (this fixes the "Price Breaks for Each" values to show the special price across the board) if (true == $this->hasSpecialPrice) { foreach($this->price_breaks as $price_break) { $price_break['products_price'] = min($price_break['products_price'], $this->specialPrice); change to -- (this is a carry over from the public priceformatter as well) if (true == $this->hasSpecialPrice && is_array($this->price_breaks)) { foreach($this->price_breaks as $key => $price_break) { $this->price_breaks[$key]['products_price'] = min($price_break['products_price'], $this->specialPrice); find -- foreach($this->price_breaks as $price_break) { if($qty >= $price_break['products_qty']) { $price = $price_break['products_price']; } } change to -- if (is_array($this->price_breaks) && count($this->price_breaks) > 0) { foreach($this->price_breaks as $price_break) { if($qty >= $price_break['products_qty']) { $price = $price_break['products_price']; } } } // end if (is_array($this->price_breaks) && count($this->price_breaks) > 0) find -- function getQtyBlocks() { return $this->qtyBlocks; } add the following below it -- function get_discount_category() { return $this->discount_categories_id; } function getMSRP() { return $this->theMSRP; } find -- // Begin saving calculation $lc_text .= '<tr valign="top"><td width="120" class="infoBoxContents">Your savings</td>'; if (true == $this->hasSpecialPrice) { $lc_text .= '<td align="center" class="infoBoxContents">' . $this->getDiscountSaving($this->thePrice, $this->specialPrice) .'</td>'; } else { $lc_text .= '<td align="center" class="infoBoxContents">- </td>'; } foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="infoBoxContents">' . $this->getDiscountSaving($this->thePrice, $price_break['products_price']) change to -- // Begin saving calculation $lc_text .= '<tr valign="top"><td width="120" class="infoBoxContents">Your savings</td>'; if (true == $this->hasSpecialPrice) { $lc_text .= '<td align="center" class="infoBoxContents">' . $this->getDiscountSaving($this->theMSRP, $this->specialPrice) .'</td>'; } else { $lc_text .= '<td align="center" class="infoBoxContents">' . $this->getDiscountSaving($this->theMSRP, $this->thePrice) . '</td>'; } foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="infoBoxContents">' . $this->getDiscountSaving($this->theMSRP, $price_break['products_price']) Your done.
  7. I tried one last search to find a solution and found it here --> http://www.oscommerce.com/forums/index.php?sho...p;#entry1392970
  8. Using the PriceFormatter, I would like to show the percentage discount from the MSRP price instead of the original price for a given quantity in the respective "Your savings" boxes. I have the MSRP module installed and working on the site/product_info.php page and all I need to do (I think) is use the getDiscountSaving function with the products_msrp, $this->thePrice to show the savings for savings on a single item and products_msrp, $price_break['products_price'] for quantity discounts savings off MSRP in the PriceFormatter. The problem is that I can't figure out how to add the products_msrp from the products table to the PriceFormatter so that I can call it in the two places I want to use the getDiscountSaving function to show the total savings off the MSRP. Here is the code I think will work if I can get some help to define the msrp price in the PriceFormatter. // Begin saving calculation $lc_text .= '<tr valign="top"><td width="120" align="center" class="pricebox">Your savings</td>'; if (true == $this->hasSpecialPrice) { $lc_text .= '<td align="center" class="pricebox">' . $this->getDiscountSaving($this->thePrice, $this->specialPrice) .'</td>'; } else { [b]// figure savings off MSRP for single item order[/b] $lc_text .= '<td align="center" class="pricebox">' . $this->getDiscountSaving([b]products_msrp[/b], $this->thePrice) .'</td>'; } [b]// figure savings off MSRP for quantity discounts[/b] foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="pricebox">' . $this->getDiscountSaving([b]products_msrp[/b], $price_break['products_price']) .'</td>'; } $lc_text .= '</tr></table></td></tr></table>'; Any help with this is greatly appreciated.
  9. I am using the newest AIM module (authorizenet_cc_aim.php Feb 19, 2009) available in the contributions. Except for the one line cURL update for SSL 3.0, the AIM module is the same as the one that came with the 2.2 RC2a installation package. The site/AIM module have been up and running for 5 weeks without any problems, or so it seemed. I had a customer contact me a couple of weeks ago to tell me that he had tried multiple credit cards and attempts and every time he confirmed the order he was redirected to the checkout_payment page with the default error message "There has been an error processing your credit card - Please try again and if problems persist, please try another payment method." I did an exhaustive search and did all the troubleshooting I could think of but could not find the reason why this was happening. Last week I had another customer contact me with the same problem and when he told me the dollar amount of the order I realized that the problem was tied to large orders. To troubleshoot, I did an order for 200 of one product to get the dollar amount and quantity up on the order and it went through fine so I realized it was the number of line items on the order. The “magic” number is 30. Customers can only place orders for up to 30 different products (unlimited quantities) per order. Anytime there is over 30 line items on an order they are redirected to the payment page/default error message. It doesn’t really apply but, in the configuration settings, “Product Quantities” is set to 0 (unlimited). Nothing is transmitted to Authorize.net so the error is part of the pre-check done by the cart. I have looked in the Admin configuration settings, the code, the database tables, and the support forums and still cannot find any reason why this is happening. Does anyone know of any reason why orders with over 30 different items in them would not be able to be processed using the AIM module/Authorize.net? Thanks in advance for any help on this.
  10. I have QPBPP running flawlessly on three shops. On the most recent install, I just found out that my customer needs to change his prices frequently so I need to figure out an easy way for him to do so without having to log on to each item individually in the Admin site. I have looked in the past and just finished an exhaustive search but I did find any solutions. Does anyone have a suggestion for a user friendly means of updating multiple quantity discount prices/items at once?
  11. Thanks for this fantasic contribution. I installed it and everything works great except for the image uploader. I get an error when I click 'Browse server' on the 'Image Properties' pop up. The error window that pops up says it can't find the file "admin/includes/javascript/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php" which is understandable because the file resides here "admin/includes/javascript/FCKeditor/editor/filemanager/connectors/php/connector.php" I have looked everywhere to try and find the solution but I can't even find the path so I can correct it. Any Suggestions? Also, I would like to use this contribution to add content to some resource pages in the admin site. Is there a way to use this contribution to do this from one location or do I need to install a second instance of it and change all the files so they point to the admin site? Thanks in advance for any help you can offer.
  12. I just installed v2.2 RC2a and wanted to install Administration Access Level Accounts 2.0 along with its category manager and the Listing Products Instructions in Admin for Vendors contribution to allow vendors to have admin control over their specific products (only) while maintaining a 'master' admin account to control them all. When I went to install them the structure has changed so much that I was wondering if these contributions are adaptable or not to v2.2 rc2a by a person (me) with limited PHP knowledge. I don't have a problem figuring out where to find where the code was moved to and make the contribution changes to the code but I don’t know how to find out if the account/login function logic is comparable without physically installing and testing it. Can I use this contribution with v2.2 rc2a? Now that the admin/index.php goes directly to the admin menu page, where should I place the admin login manager page? Should I add it to the new admin account setup page? Now that admin accounts are set up by default in v2.2 rc2a, is there an easier or better way to set up admin accounts that have admin rights for a specific product category only?
  13. I may be misunderstanding what the Auto Names Builder does but I now know that SEO-G names/links cannot be created automatically if the product names are not unique, ... but I am still confused about Auto Names Builder. When does it automatically generate names? Does it add them any time you add a new unique product name to the catalog? I don't have any duplicate urls in the catalog but the product names are duplicated quite a bit. i.e. - (site.com/ford/truck), (site.com/chevy/truck), (site.com/dodge/truck) However; the urls with only the product name in them (site.com/product_name) that you get when accessng a product from a module like manufacturers or what's new would be a duplicate if it did not get an index at the end.
  14. I updated to V1.20 when it came out and then I deleted all the products in the catalog and in seo-g including reports and then repopulated the whole catalog using easy-populate and then reconfigured all the links is SEO-G. Everything worked perfectly. Today, I added some new products into an existing category(s) with the Auto Names Builder set to true but the products added had the same name as previous entries and unique names/links were not added. The products were added but when I click on the link I am taken to the wrong product from the original set-up/config because of this (not unique). When I went into the controller I found the new products all had the same name and no number added on the end to make it unique. I tried using the controller to try and make the product names unique automatically but they kept coming up with the same identical name. The only solution was to manually add a numbering scheme on the end of the names to make them unique like the controller did on the original install. Any suggestions?
  15. Thanks! My problem was that I was changing the sort order instead of the linkage. Since the default setting and your recommendation in the readme.txt are for the product only, I am confused about changing it though. It is my understanding that, as long as they are relevant, words in the URL are given extra weight by search engines. I know it is beyond the scope of this forum, but can you point me in the right direction so I can understand your reason for this recommendation?
  16. I no longer get the full "path" in the URL for the products in my catalog (site.com/category1/category2/product1.html). I get the full path for everything up to the products page (site.com/category1/category2.html), but when I click on the actual products on any of the products pages, the url only shows the domain and product (site.com/product1.html). I know this is the default URL for all listings in "new products", "all-products" and "manufacturers" pages, but is there a way to make all urls in the catalog show the full path for products?
  17. I was looking into your cache recommendations and found a typo in the readme file for the 5029 contribution link. Both links point to the 2873 contribution. Your readme file provides a list of all the specific changes for each new version making it easy to upgrade from a previous version without uninstalling/reinstalling the entire contribution. I wish there was a way to make the minor OSC version changes without starting over from scratch each time like I do with SEO-G. Thanks again for your awesome contribution. SEO-G should be used as a model for not only other contributions, but for OSC itself.
  18. Perfect!! This fixed both redirect issues. I think your theory "links that require SSL should specify so" is correct. I tested all of the secured account pages for the login and order process and all links on account.php; My Account View or change my account information. View or change entries in my address book. Change my account password. My Orders View the orders I have made. E-Mail Notifications Subscribe or unsubscribe from newsletters. View or change my product notification list. There are a couple of pages like logoff and checkout_success.php that are secure and I don't know if they need to be, which is an issue with OSC and not SEO-G, and there are some URLs that have the .php extention but it is not a problem because the ones that do this like "https://74.220.202.241/account.php?=", "https://74.220.202.241/checkout_shipping.php", and "https://74.220.202.241/checkout_success.php" should be on the exclusion list anyway. Thanks.
  19. Sorry for the confusion but I was mistaken about the different links originally created in Seo-G reports, one http and the other https, so when I tested with the changes to general.php the results were wrong because I deleted the wrong URL leaving the manually entered URL for shopping_cart.php in SEO-G reports which made the general.php changes appear to have worked for the shopping_cart.php redirect from "Checkout" button. After starting from scratch with the "stock" SEO-G files, it is the secure URLs that are not created for both the shopping_cart.php and index.php in SEO-G reports. When I apply the changes to general.php it does not add the secure URLs to reports and applying the changes to html_output.php does not add them either so I am redirected to cookie_usage.php for both cases unless I add the secure links manually for both to SEO-G reports.
  20. I changed the code in general.php and I deleted the manually created URLs for shopping_cart and index in SEO-G reports to test. The "checkout" button worked correctly and redirected to "shopping_cart" URL but the checkout_success (index.html redirect) did not so I was redirected to cookie_usge again.
  21. I insalled SEO-G on a different less modified website (same host) and got the same results and I compared the checkout pages in question against the stock pages to make sure there isn't something initiating a redirect. I get the same results as you; If there is nothing in the cart I can't pass checkout_shipping.html either secure or unsecure. In the SEO-G reports the only listing is secure (https) from checkout_shipping.php to checkout_shipping.html This change made no difference. No other mods. I manually edited OSC URL - https://shopping_cart.php with SEO-G URL https://shopping_cart.html to remove secure url (removed "s" from https) on both and it now works. I then clicked on "View Cart" to get the https URLs back in the report. I tried to do the same with the original issue, checkout_success back when the problem first showed up and it didn't work because I should have been changing the redirect file, index.html (php). I added a secure OSC (index.php) with secure SEO-G (index.html) url for the index, which is the correct redirect file I should have done before and it worked also. I don't know if a secure index.html file will cause any problems but it works at least. From the new secured index.html, when I navigate to a non-secured page like "contact us" and then back to the index.html, it is no longer the secured link. It is strange that I had to add a non-secured shopping_cart link and a secured index link to the SEO-G reports page. You would think it would be the same problem. If you need any more info to figure out what is causing this let me know.
  22. After installing V1.14 I still had the redirect issue with checkout_success so I tested additional site navigation to see if any other incorrect redirects happen and I ran across another one that might help pinpoint the problem. Clicking on the "Checkout" link also goes to the "SEO-G Redirect" option when logged in and the cart is empty. All other link redirects work correctly for "Checkout." When the master switch is set to false you are redirected correctly to shopping_cart.php. checkout_shipping.php code that gets redirected when SEO-G master set to "True". if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); }
  23. post #217 was applied previously. <?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 */ //-MS- SEO-G Added if( !isset($g_seo_flag) || $g_seo_flag !== true) { // 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); // 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. // >>> BEGIN REGISTER_GLOBALS // if (function_exists('ini_get')) { // ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.'); // } // <<< END REGISTER_GLOBALS // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.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) //rem this and redefined below for specific web host variable/SEO-G $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; $request_type = ($_SERVER['SERVER_PORT'] == '443') ? 'SSL' : 'NONSSL'; //$request_type = (getenv('SERVER_PORT') == '443') ? '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!'); // set the application parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } //-MS- SEO URLs Support Added require(DIR_WS_CLASSES . 'seo_url.php'); $g_seo_url = new seoURL; //-MS- SEO URLs Support Added EOM } //-MS- SEO-G Added EOM // 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 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'); // 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(); // 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'); } } 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'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } 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'])+1); } } 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; } } // include the who's online functions require(DIR_WS_FUNCTIONS . 'whos_online.php'); tep_update_whos_online(); // 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)); // 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); $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); $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'])) { $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); if (tep_db_num_rows($model_query)) { $model = tep_db_fetch_array($model_query); $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_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'); ?>
  24. After updating to v1.13 and trying both 443 options (one at a time) mentioned in readme.htm $request_type = ($_SERVER['SERVER_PORT'] == '443') ? 'SSL' : 'NONSSL'; //$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL'; I still get redirected to cookie_usage.php when I click "Continue" on checkout_success.html. Is there any way to check to see if the $request_type variable is correctly identified?
×
×
  • Create New...