Skip to content

Instantly share code, notes, and snippets.

@bronius
Forked from neclimdul/gist:6370758
Last active December 21, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bronius/6371145 to your computer and use it in GitHub Desktop.
Save bronius/6371145 to your computer and use it in GitHub Desktop.
One way around Drupal 7 Ubercart 7.x-3.5 cache anonymous cart (in IE?). I found that 'cart' was always getting added to Drupal's cache_page table. Doesn't it make sense that it *not*? In fact, it broke checkout for our anonymous users. Try it out, let me know if it works for you. Thanks @neclimdul! Note: the fix is just the 'cart' -> drupal_page…
/**
* Implements hook_init().
*/
function uc_cart_init() {
global $conf;
$conf['i18n_variables'][] = 'uc_cart_breadcrumb_text';
$conf['i18n_variables'][] = 'uc_cart_help_text';
$conf['i18n_variables'][] = 'uc_continue_shopping_text';
// Don't cache any cart of checkout pages.
// Code based on CacheExclude - http://drupal.org/project/cacheexclude
// Thanks @neclimdul!
if (arg(0) == 'cart') {
drupal_page_is_cacheable(FALSE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment