boost + uc_ajax_cart steps

persianninja's picture
Offline
Joined: 06/10/2011
Juice: 38
boost + uc_ajax_cart steps

I got it working i think. Here are my steps:
################

First installed uc_ajax_cart module (used recomended drupal 6 version)
Then somewhere in the ubercart Store Configuration is a link to the UC Ajax Cart settings:
as recommended on project page, I:

1. Enable 'Ajax Support for anonymous users'
2. Disable 'Ajaxify cart page'
3. Select 'Ajaxify only products that have the specified CSS class' in 'Apply Ajax Cart functionality to specified products', and use a nonexistent CSS class like i just used: nonExistantCssClass

I would follow that exactly or the ajaxy stuff can do some goofy things as I found out. The last 2 options I didn't follow intially as i thought those options would be cool to have. Seem like need to do it so the POST to drupal handles everything vs an ajax function which may not know how to handle everything is what I'm thinking?

################
(Think I installed Global Redirect cause Boost recommends it as it will result in less duplicate content for Search Engines to find and Pathauto to create nice SEO names automatically... These are the filenames you'll find in your cached directory like content/_about_us.html instead of stuff like node/_12.html )
Then installed Boost module (used recomended drupal 6 version) for caching. PS I left my drupal caching set to Normal as well, and js/css caching enabled (not sure if Boost overrides all that anyway).
Boost settings are in Performance in another tab there...
Turn on caching in Boost settings tab:
'Boost - Static page cache:': Enabled,

and
'Cache every page except the listed pages.:' and these pages in textarea on each line:

uc_ajax_cart
uc_ajax_cart/*
cart
cart/*
checkout
checkout/*

I copied over .htaccess Boost rules in that other tab to my .htacess file.

################
Go into Blocks area and remove standard ubercart Cart from sidebar and put in the uc_ajax_cart one (called something like Ajax Cart) in that sidebar.
################
Go into Boost settings and click that clear button at bottom just to start from scratch in case accidentally cached stuff earlier (as i did from testing so much). There is another set of buttons to clear cached stuff in the middle. might not hurt to clear those. (Note sometimes it doesn't clear out every single file and 1 or 2 etc are left)
################
Go in a different browser and don't log in and start surfing your site...
/home/your-username/your-drupal-site.com/cache/yoursitename.com/normal/content or node etc should start filling up with cached content
################
(Maybe turn on the option in Boost settings for cron to prefetch and cache all your pages.)
################

OR if above too complicated take simple approach:
Just create a Block that always has a link listed to your cart (whether its empty or not, and never shows items in your cart in the sidebar... seems ghetto)
or keep the ubercart 2.0 cart and don't turn on the option to 'hide' it in the Block settings (it should do same thing and always show a direct link to your cart for anonymous users (logged in users like when your logged in as Admin will see item's in the cart since cache isn't used )). Basically both of these do the same thing for anonymous users, but isnt really good solution since most people buying stuff are anonymous and would be cool to show them cart items in the sidebar.

Boost Module and Shopping Cart Block By: zhangty (42 replies) Tue, 03/16/2010 - 05:33