Jump to content
Sign in to follow this  
100asa

Page cache by Chemo

Recommended Posts

when somebody subscribes to a product, i have it set to redirect to the product page and display a success or error message, but because i use page cache people don't know whether they've had a success or error.

 

I believe page cache treats site.com/product_info.php differently than site.com/product_info.php?var=1 and differently again than site.com/product_info.php?var=2.

 

You can try something like that. Note that site.com/product_info.php?var=2 will be cached after the first page load.

 

For your application, you should have the page forward to

 

site.com/product_info.php?products_id=XX&mode_int=0
site.com/product_info.php?products_id=XX&mode_int=1
site.com/product_info.php?products_id=XX&mode_int=2

Edited by safoo

Share this post


Link to post
Share on other sites
I believe page cache treats site.com/product_info.php differently than site.com/product_info.php?var=1 and differently again than site.com/product_info.php?var=2

thing is, the mode never shows in the url, it's in the session, so i am not sure what i have to do to achieve this

Share this post


Link to post
Share on other sites
thing is, the mode never shows in the url, it's in the session, so i am not sure what i have to do to achieve this

 

Just put it in the URL.

 

i have it set to redirect to the product page and display a success or error message,

 

Doesn't the 'code' know before redirecting that it has successfully performed the add notification? If so put success=1 (or 0 for error) in the products page URL that it redirects to and then in the code for the product page, have it check for $success == 1 or $success == 0 and display the relevant message. Look at examples in my post above to see what I mean when I say add it to the URL.

 

Is this along the lines of what you are trying to do?

Edited by safoo

Share this post


Link to post
Share on other sites

i really don't want it in the url, because i have had past problems of users posting this ?value=xx on message boards and such, which causes a bit of headache.

 

because if i filter it from SE's (url with ?value), then i lose a potential backlink.

 

keeping it strictly session, i don't have to worry about that stuff.

but evenso, that wouldn't help the cause of 404's being cached, which produces a 200/ok response on second page load. :)

Share this post


Link to post
Share on other sites

Does anyone have "Your Recent History" contribution and using page_cache? The issue that I'm having is that both the shopping cart and the recent history need to be dynamic on the cache pages. Looking over the code on how the page is cache for the cart it would look like the same concept would apply for the Your Recent History box. Actually I experimented and tried this.

 

 

 

In application_top.php

 

/*--------------------------------------------------------*\

 

# Page cache contribution - by Chemo

 

# Define the pages to be cached in the $cache_pages array

 

\*--------------------------------------------------------*/

 

$cache_pages = array('index.php', 'product_info.php');

 

 

 

//$we_cache = false;

 

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true') {

 

# Start the output buffer for the shopping cart

 

//$we_cache = true;

 

if(0) {

 

ob_start();

 

require(DIR_WS_BOXES . 'shopping_cart.php');

 

$cart_cache = ob_get_clean();

 

}

 

if(1) {

 

//ob_start();

 

require(DIR_WS_MODULES . 'your_recent_history.php');

 

//$recent_history_cache = ob_get_clean();

 

}

 

//$cart_history_cache .= $cart_cache . $yrh;

 

# 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($yrh,'<%YRH%>');

 

/*$page_cache1 = new page_cache($cart_cache,'<%CART_CACHE%>');*/

 

//$yrh_cache = new page_cache($yrh);

 

//$page_cache = new page_cache($cart_history_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();

 

//$page_cache1->cache_this_page();

 

} # End if

 

} # End foreach

 

} # End if

 

 

 

I modified the page_cache.php class so I can pass the place holder of <%YRH%> or <%CART_CACHE%> , Your Recent History and Cart Cache respectively. This is working fine when I just pass one of the ob buffers to the function Ex. $page_cache = new page_cache($yrh,'<%YRH%>'); or page_cache = new page_cache($cart_cache,'<%CART_CACHE%>'); . Where I'm stuck is being able to pass both of the buffers at the same time to the function page_cache(). Some experiments that I tried was to combine the 2 buffers $cart_history_cache .= $cart_cache . $yrh and it work but it showed the shopping cart and the Your Recent History both in the shopping cart box. I also tried a few other experiments as you can see from the commented code. Could some one point me in the right direction on how to implement passing both shopping cart and Your Recent History into the page_cache() or any tips on implementation? Thank you. Marizka

Share this post


Link to post
Share on other sites
i really don't want it in the url, because i have had past problems of users posting this ?value=xx on message boards and such, which causes a bit of headache.

 

because if i filter it from SE's (url with ?value), then i lose a potential backlink.

 

keeping it strictly session, i don't have to worry about that stuff.

but evenso, that wouldn't help the cause of 404's being cached, which produces a 200/ok response on second page load. :)

 

Makes sense....

 

Then what you can do is look in application_top where page_cache has an if statement I believe to see if the customer is logged in or not. Add your check with regards to the session variable and don't load page cache if that session variable exists. Then just unregister the variable after the code is executed to make sure page cache gets enabled again when you no longer plan to use that variable.

Share this post


Link to post
Share on other sites

Hello,

 

Has anyone had the problem of a trailing ?<osCsid> in his URLs, when enabling page cache i mean. cache directory is empty too...

Did enyone else get a <%CART_CACHE%> instead of the normal shopping_cart box ?

My URLs look like: http://www.example.com/catalog/accesorii-f...ml?%3CosCsid%3E :((

 

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE ==

'true' && class_exists('page_cache') ) {

echo "<%CART_CACHE%>";

} else {

require(DIR_WS_BOXES . 'shopping_cart.php');

}

 

unfortunately really echoes that in the page...

 

Anyone ? :(

Edited by thesefirah

Share this post


Link to post
Share on other sites
Hello,

 

Has anyone had the problem of a trailing ?<osCsid> in his URLs, when enabling page cache i mean. cache directory is empty too...

Did enyone else get a <%CART_CACHE%> instead of the normal shopping_cart box ?

My URLs look like: http://www.example.com/catalog/accesorii-f...ml?%3CosCsid%3E :((

 

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE ==

'true' && class_exists('page_cache') ) {

echo "<%CART_CACHE%>";

} else {

require(DIR_WS_BOXES . 'shopping_cart.php');

}

 

unfortunately really echoes that in the page...

 

Anyone ? :(

 

this happens when your page process is out of synch with your page cache class.

In other words, your page logic thinks this page is being cached wheras page cache has a different opinion.


Treasurer MFC

Share this post


Link to post
Share on other sites
Thanx for your reply. I know that the contribution has nothing to do with ssl or "should" nothing to do with that.

But I made a test with SSL on/off in combination with PageCache on/off. The result was that only the the "on/on" creates the login-problem on the page.

 

Without the SSL-Proxy the contribution works without problems and very fast!!! :)

Thats because I said "The SSL causes the problem"!

 

and

 

?%3CosCsid%3E

 

My problem causes the same url like thesefirah's! I thought it is the proxy, but it is the login.php. All my SSL-URLs have the Session behind the URL. When I am on the shopping cart page and want to jump to the checkout_shipping (logged off) the login looks like this: https://www.url.com/login.php?%3CosCsid%3E

Then after a view clicks back to the catalog the user will be logged off automatically.

 

When I changed the URL after the cart and before the tep_redirect and added manually the SID ---> the problem is solved!

 

:'( :'( :'(

Share this post


Link to post
Share on other sites

I've the same problem.

When guest come into my website, he have unique ID; add a product to cart, and when he try to complete shopping, go to login page. Problem: the cart is empy, and ID is only <osCsid>

The complete url is: http://www.100asa.it/login.php?<osCsid>


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

I've tryed many more times, with different configuration (session recreate->off, force cookie->off...) but the problem remain.

At this moment I've turn off this contribution :(


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

I'm just upgrade to the latest versione of contribution!

I'm testing... I hope all is ok

Edited by 100asa

Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

To upgrade page cache Chemo contribution 1.5:

STEP 6 - Edit includes/functions/html_output.php
Find this code in tep_href_link():

global $request_type, $session_started;

And REPLACE it with this code:

global $request_type, $session_started, $SID;

Find this code in tep_href_link():

if (isset($_sid)) {
  $link .= $separator . $_sid;
  }

And REPLACE it with this code:

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {
  $link .= $separator . '<osCsid>';
  } elseif (isset($_sid)) {
  $link .= $separator . $_sid;
  }

 

 

 

to upgrade seo url Chemo contribution to latest (still in includes/functions/html_output.php) :

////
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;

$seo = ( defined('SEO_URLS') ? SEO_URLS : false );
$seo_rewrite_type = ( defined('SEO_URLS_TYPE') ? SEO_URLS_TYPE : false );
$seo_pages = array('index.php', 'product_info.php');
if ( !in_array($page, $seo_pages) ) $seo = false;

if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

if ($page == '/') $page = '';

if ($connection == 'NONSSL') {
  $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
  $seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
  $seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
} elseif ($connection == 'SSL') {
  if (ENABLE_SSL == true) {
	$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
	$seo_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
	$seo_rewrite_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
  } else {
	$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
	$seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
	$seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
  }
} else {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
}

if (tep_not_null($parameters)) {
  $link .= $page . '?' . tep_output_string($parameters);	  
  $separator = '&';

	# Start exploding the parameters to extract the values
	# Also, we could use parse_str($parameters) and would probably be more clean
	if ($seo == 'true'){
		$p = explode('&', $parameters);
		krsort($p);
		$params = array();

		if ( $seo_rewrite_type == 'Rewrite' ){
			foreach ($p as $index => $valuepair) {
				$p2 = explode('=', $valuepair);					
				switch ($p2[0]){				
				case 'products_id':
					$rewrite_product = true;					 
					if ( defined('PRODUCT_NAME_'.$p2[1]) ){
						$rewrite_page_product = short_name(constant('PRODUCT_NAME_'.$p2[1])) . '-p-' . $p2[1] . '.html';
					} else { $seo = false; }
					break;		

				case 'cPath': 
					$rewrite_category = true;
					if ( defined('CATEGORY_NAME_'.$p2[1]) ){
						$rewrite_page_category = short_name(constant('CATEGORY_NAME_'.$p2[1])) . '-c-' . $p2[1] . '.html';
					} else { $seo = false; }
					break;
// manufacturer addition by WebPixie
				case 'manufacturers_id': 
					$rewrite_manufacturer = true;
					if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){
						$rewrite_page_manufacturer = short_name(constant('MANUFACTURER_NAME_'.$p2[1])) . '-m-' . $p2[1] . '.html';
					} else { $seo = false; }
					break;
// end manufacturer addition by WebPixie
				default:
					$params[$p2[0]] = $p2[1]; 
					break;
				} # switch
			} # end foreach
			$params_stripped = implode_assoc($params);
			switch (true){
				case ( $rewrite_product && $rewrite_category ):
				case ( $rewrite_product ):
					$rewrite_page = $rewrite_page_product;
					$rewrite_category = false;
					break;
				case ( $rewrite_category ):
					$rewrite_page = $rewrite_page_category;
					break;
// manufacturer addition by WebPixie
				case ( $rewrite_manufacturer ):
					$rewrite_page = $rewrite_page_manufacturer;
					break;
// end manufacturer addition by WebPixie
				default:
					$seo = false;
					break;
			} #end switch true	
			$seo_rewrite_link .= $rewrite_page . ( tep_not_null($params_stripped) ? '?'.tep_output_string($params_stripped) : '' );   
			$separator = ( tep_not_null($params_stripped) ? '&' : '?' );
		} else {
			foreach ($p as $index => $valuepair) {
				$p2 = explode('=', $valuepair);					
				switch ($p2[0]){				
				case 'products_id':					 
					if ( defined('PRODUCT_NAME_'.$p2[1]) ){
						$params['pName'] = constant('PRODUCT_NAME_'.$p2[1]);
					} else { $seo = false; }
					break;		

				case 'cPath': 
					if ( defined('CATEGORY_NAME_'.$p2[1]) ){
						$params['cName'] = constant('CATEGORY_NAME_'.$p2[1]);
					} else { $seo = false; }
					break;
// manufacturer addition by WebPixie
				case 'manufacturers_id': 
					if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){
						$params['mName'] = constant('MANUFACTURER_NAME_'.$p2[1]);
					} else { $seo = false; }
					break;			
// end manufacturer addition by WebPixie		
				default:
					$params[$p2[0]] = $p2[1]; 
					break;
				} # switch
			} # end foreach			
			$params_stripped = implode_assoc($params);	
			$seo_link .= $page . '?'.tep_output_string($params_stripped);   
			$separator = '&';
		} # end if/else
	} # end if $seo
} else {
  $link .= $page;
  $separator = '?';
  $seo = false;
} # end if(tep_not_null($parameters)

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
  if (tep_not_null($SID)) {
	$_sid = $SID;
  } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
	if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
	  $_sid = tep_session_name() . '=' . tep_session_id();
	}
  }
}

if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
  while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
  while (strstr($seo_link, '&&')) $seo_link = str_replace('&&', '&', $seo_link);

  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);
  $seo_link = str_replace('?', '/', $seo_link);
  $seo_link = str_replace('&', '/', $seo_link);
  $seo_link = str_replace('=', '/', $seo_link);
  $seo_rewrite_link = str_replace('?', '/', $seo_rewrite_link);
  $seo_rewrite_link = str_replace('&', '/', $seo_rewrite_link);
  $seo_rewrite_link = str_replace('=', '/', $seo_rewrite_link);

  $separator = '?';
}

if (isset($_sid)) {
	$link .= $separator . $_sid;
	  $seo_link .= $separator . $_sid;
	  $seo_rewrite_link .= $separator . $_sid;
}

if ($seo == 'true') {
	return ($seo_rewrite_type == 'Rewrite' ? $seo_rewrite_link : $seo_link);
} else {
	return $link;
}
 }

and replace with

////
// Ultimate SEO URLs v2.1
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
	global $seo_urls;
	return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
 }

 

Question:

 global $request_type, $session_started, $SID;

, I must delete, I must change, or other else?

 

when I visit page by manufacturer or category, the is session change, and cart is empty


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

That's crazy. I've posted my problem in the German forum and everyone thought I'm joking :blink:

 

Now many guys have the same problem. So... can you try to write the link to the login.php with a session_id manual instead of clicking the link to the checkout. Are you have the same bug?

Share this post


Link to post
Share on other sites

Ok?!?! :'(

 

I don't know, what this code fragment should do, but that was the problem:

 

Find this code in tep_href_link():

if (isset($_sid)) {
  $link .= $separator . $_sid;
  }

And REPLACE it with this code:

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {
  $link .= $separator . '<osCsid>';
  } elseif (isset($_sid)) {
  $link .= $separator . $_sid;
  }

 

When I don't replace this, it's working!!!!

 

WHY???? :blink:

Share this post


Link to post
Share on other sites
Ok?!?! :'(

 

I don't know, what this code fragment should do, but that was the problem:

 

Find this code in tep_href_link():

if (isset($_sid)) {
  $link .= $separator . $_sid;
  }

And REPLACE it with this code:

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {
  $link .= $separator . '<osCsid>';
  } elseif (isset($_sid)) {
  $link .= $separator . $_sid;
  }

 

When I don't replace this, it's working!!!!

 

WHY???? :blink:

 

because you are removing symptoms.

Now the session id of any particular user will be written into the cache file and shared by all others, not smart to simply cut stuff out until it "appears" to be working.


Treasurer MFC

Share this post


Link to post
Share on other sites

AND we found the problem with the cutout. Ok, when I remove the if-clause and the problem will disappear --> the if-clause does not their job!

 

We should include a test, if it's the login-page:

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {

if ( strstr($_SERVER['PHP_SELF'],'login.php') or strstr($PHP_SELF,'login.php') ) {

$link .= $separator . $_sid;

} else {

$link .= $separator . '<osCsid>';

}

} elseif (isset($_sid)) {

$link .= $separator . $_sid;

}

 

Is this better?

Edited by wolmat

Share this post


Link to post
Share on other sites
AND we found the problem with the cutout. Ok, when I remove the if-clause and the problem will disappear --> the if-clause does not their job!

 

We should include a test, if it's the login-page:

Is this better?

 

no, this is worse.


Treasurer MFC

Share this post


Link to post
Share on other sites
any ideas?

 

basically page cache works like this:

 

in application top you determine if the current page is to be cached or not.

That is done by certain condition including customer signed in, cache enabled and the pages you specified to be cached.

 

If the page is to be cached, the class first checks if it is to be served from the cache (exists and not expired)

if it is, it reads that page in the buffer, replaces all placeholders like cart and session id with the actual values and sends out the page.

 

if it is not, it starts an output buffer, let the page be created with placeholders instead of the actual values for cart and session id and at the end, closes the output buffer, writes the file, replaces all placeholders with the actual values and sends it out.

 

This only happens for those pages you have specified in the cache pages array, login.php is not and should not be part of that.

 

"Let the page be created with placeholders" is done in column_left.php for the cart box and in tep_href_link for the session id's. That is, in both files the check is made whether the current page is to be cached. If it is, they spit out placeholders instead of the actual values.

 

So if you have <osCsid> in your links then it can only mean that tep_href_link thinks that the current page is being cached and subsequently produces the placeholder but the page cache class thinks otherwise or the class fails altogether. Because only then the placeholder is not replaced by the actual value which the class normally handles.

 

personally I have altered the code a little so that I only have 1 single value in the entire script which tells me whether the page is cachable or not. This so I only have to write the condition for that once and I can never have any deviations across different files.

 

so in application top I have this code which initiates the caching and gives me a single variable $we_cache

which tells me whether we cache or not.

 

// pages to be cached

$cache_pages = array(

'index.php',

'product_info.php',

'products_type.php',

'pi.php',

'products_new.php',

'products_by.php',

'price_list.php',

'articles.php',

'article_info.php',

'2gether.php',

'offers.php',

'faq.html',

'crystal_light_centrum_sitemap.html',

'privacy.html',

'our_location.html',

'pdf_catalogue_info.html',

'services.php'

);

 

$we_cache = false;

// determine if we cache the current page

if ( !tep_session_is_registered('customer_id') // these pages would be too dynamic for caching

&& ($request_type == 'NONSSL') // no caching in SSL mode

&& ENABLE_PAGE_CACHE == 'true') { // Cache enabled

foreach ($cache_pages as $index => $page){

if ( stristr($_SERVER['PHP_SELF'], $page) ){

$we_cache = true; // current page in the array

break;

}

}

}

if ($we_cache) {

// create the actual cart box or nothing

if ($cart->count_contents() > 0) {

ob_start();

require(DIR_WS_BOXES . 'shopping_cart.php');

$cart_cache = ob_get_clean();

} else {

$cart_cache = '';

}

include_once(DIR_WS_CLASSES . 'page_cache.php');

$page_cache = new page_cache($cart_cache);

$page_cache->cache_this_page();

}

 

 

then in column_left.php I have this for the cart box inclusion:

 

$current_base = basename($PHP_SELF);

if ($current_base != 'shopping_cart.php') {

if ($we_cache) {

// produce the placeholder

echo "<%CART_CACHE%>";

} elseif ($cart->count_contents() > 0) {

// produce actual cart box if not empty

require(DIR_WS_BOXES . 'shopping_cart.php');

}

}

 

 

in tep_href_link I have this code: ($we_cache declared as global in the function ofcourse)

 

if ($we_cache) {

// we cache this page, produce placeholder at all times

$link .= $separator . '<CLCid>';

$seo_link .= $separator . '<CLCid>';

$seo_rewrite_link .= $separator . '<CLCid>';

} elseif (isset($_sid)) {

// produce session id if required

$link .= $separator . tep_output_string($_sid);

$seo_link .= $separator . tep_output_string($_sid);

$seo_rewrite_link .= $separator . tep_output_string($_sid);

}

 

 

 

for the "Your recent History" box in my footer I use this code so that it is still client specific while the rest of the page is cached.

You do not have this but just as an example.

 

// do not show during checkout

if (!stristr($PHP_SELF,'checkout')) {

if ($we_cache) {

// we cache, produce placeholder

echo '<%YRH%>';

} else {

// produce actual box

include(DIR_WS_MODULES . 'your_recent_history.php');

echo $yrh;

}

}


Treasurer MFC

Share this post


Link to post
Share on other sites
in tep_href_link I have this code: ($we_cache declared as global in the function ofcourse)

 

if ($we_cache) {

// we cache this page, produce placeholder at all times

$link .= $separator . '<CLCid>';

$seo_link .= $separator . '<CLCid>';

$seo_rewrite_link .= $separator . '<CLCid>';

} elseif (isset($_sid)) {

// produce session id if required

$link .= $separator . tep_output_string($_sid);

$seo_link .= $separator . tep_output_string($_sid);

$seo_rewrite_link .= $separator . tep_output_string($_sid);

}

 

this change is in functions/html_output? follow the Chemo instruction, this part don't be deleted?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Makes sense....

 

Then what you can do is look in application_top where page_cache has an if statement I believe to see if the customer is logged in or not. Add your check with regards to the session variable and don't load page cache if that session variable exists. Then just unregister the variable after the code is executed to make sure page cache gets enabled again when you no longer plan to use that variable.

 

 

and that would be:

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'))));

}

correct?

 

in all honesty, i do not know how i would incorperate the ?value with this... any tips?

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  

×