Guest Posted December 6, 2005 Posted December 6, 2005 on column_right.php i use chemo's page cache seo contribution and i can't figure out how to get this to work. i do not want the shopping cart infobox to show if the customer has no items in their cart. the code for shopping cart page cache: 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'); }
♥yesudo Posted December 6, 2005 Posted December 6, 2005 Try: if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache') ) { if($cart->count_contents() > 0) { echo "<%CART_CACHE%>"; } } else { require(DIR_WS_BOXES . 'shopping_cart.php'); } Your online success is Paramount.
boxtel Posted December 7, 2005 Posted December 7, 2005 Try: if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache') ) { if($cart->count_contents() > 0) { echo "<%CART_CACHE%>"; } } else { require(DIR_WS_BOXES . 'shopping_cart.php'); } you cannot do that with page cache. the <%CART_CACHE%> marker has to be written ALWAYS when the page is being cached or others that DO have something in their cart and hit that cached page will not see their cart. If you want page cache not to show the cart if empty, you need to change that in application_top.php # Start the output buffer for the shopping cart if ($cart->count_contents() > 0) { ob_start(); require(DIR_WS_BOXES . 'shopping_cart.php'); $cart_cache = ob_get_clean(); } else { $cart_cache = ''; } # End the output buffer for cart and save as $cart_cache string that will make sure that <%CART_CACHE%> in the cached file is replaced by the shopping cart if filled and with nothing if empty, the cached file will keep the <%CART_CACHE%> marker as written by your column_left.php code. Treasurer MFC
Guest Posted December 9, 2005 Posted December 9, 2005 thank you for that, i was just about to post :D do i need to add that function, or replace something in application_top?
Guest Posted December 11, 2005 Posted December 11, 2005 the cart seems to still show with yesudo's edit on certain pages... how can i fix this? i would like it to be invisible at all times until there's a product added
♥yesudo Posted December 11, 2005 Posted December 11, 2005 Which pages? Your online success is Paramount.
boxtel Posted December 11, 2005 Posted December 11, 2005 thank you for that, i was just about to post :Ddo i need to add that function, or replace something in application_top? in application_top you have something like this : ob_start(); require(DIR_WS_BOXES . 'shopping_cart.php'); $cart_cache = ob_get_clean(); you make it: if ($cart->count_contents() > 0) { ob_start(); require(DIR_WS_BOXES . 'shopping_cart.php'); $cart_cache = ob_get_clean(); } else { $cart_cache = ''; } Treasurer MFC
Guest Posted December 11, 2005 Posted December 11, 2005 periodically i am now running into category links like this: http://www.mysite.com/category/Category.ht...oscSID>=> this is a cache problem because that's from the non-stock cache file... i changed my oscsid's to something else... i changed every instance of it throughout every .php file, so i don't think that's it. what could be causing that to output? i am not using ultimate seo url's and the cache is no longer being written :(
Recommended Posts
Archived
This topic is now archived and is closed to further replies.