Jump to content
Sign in to follow this  
audioshop55

I have a bug in the add-ons Faster Page Loads, Less DB queries by CHEMO

Recommended Posts

Hello and good Sunday,

 

Following an order I noticed that the display of price and delivery method was no longer displayed in the email order confirmation

so I do a little search and discovered by passing a test command that I missed several payment modules from a centralized command and that whatever the chosen method of payment (including one that was still posted) it was not displayed on the page checkout_confirmation.php

 

In seeking how he got the problem I found was the change in the contrib Faster Page Loads the file application_top.php in the catalog that is causing it.

 

The contrib included a file to replace the query

 

// set application wide 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']);
     }

 

and replace with:

 

// set application wide parameters
// Configuration Cache modification start
 require ('includes/configuration_cache_read.php');
// Configuration Cache modification end

 

if I cancel this change I have all my payment modules that recur and that the price and choice of payment method on the page checkout_confirmation.php and in the confirmation email!

Someone will have an idea on the reason causing this malfunction please?

 

thank you

 

PS: I put my file configuration_cache_read.php because I have adapted the amendment to the application which was already changed in my application_top.php file

 

sorry for my English

 

<?php
/*
 $Id: configuration_cache_read.php,v 1.10 2004/04/06 20:56:34 daemonj Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $config_cache_file = '/path/to/my/file/config_cache.php';              // this should be to a file in a folder *outside* of your webroot with 777 permissions.

 $config_cache_read = false;
 if (isset($config_cache_file) && $config_cache_file != '') {
   if (file_exists($config_cache_file)) {
     include($config_cache_file);
     $config_cache_read = true;
   }
 }

 if ($config_cache_read == false) {
   // set the application parameters
	$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION. " where configuration_key != ''");
	$config_flag_in = array('Oui', 'Non');
	$config_flag_out = array('true', 'false');
	while ($configuration = tep_db_fetch_array($configuration_query)) {
	  $configuration['cfgValue'] = str_replace($config_flag_in, $config_flag_out, $configuration['cfgValue']);
	  define($configuration['cfgKey'], $configuration['cfgValue']);
	}
 }

?>

Share this post


Link to post
Share on other sites

My guess would be that your read is all right, but your write is incorrect. In particular, are you correctly handling:

                $config_flag_in = array('Oui', 'Non');
               $config_flag_out = array('true', 'false');
                 $configuration['cfgValue'] = str_replace($config_flag_in, $config_flag_out, $configuration['cfgValue']);

when writing to the cached configuration file?


Always back up before making changes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×