Your module is PAINFULLY awesome, and works fantastically on my UC2 website.

I am working on setting up a mobile theme for my site, and I was curious whether I can restrict the Ajax cart functionality only to the mobile site. In other words, I would like my desktop users to use the normal cart, and the mobile users to use the Ajax cart. Is that possible?



stewart.adam’s picture

Assigned:Unassigned» stewart.adam
Issue tags:+6.x-2.2 blocker

I think this is a great idea! Context could handle nicely, as you could define conditions (i.e. "is on the mobile sub-domain") for displaying the regular cart block and then otherwise display the AJAX cart block. The only tricky part is that you would need to find a module that would let you define the set of conditions in Context... The easiest way I can think of is a sub-domain or a special path for mobile users (e.g. domain.com/m/path) but there may be a module that detects the user-agent and integrates with Context as well.

There is a small problem with uc_ajax_cart, which is that we add the JavaScript to "AJAX-ify" the add to cart links and buttons on every page via hook_init(). I'm going to see if we can change this to the block's callback instead so that the JavaScript would only get added when the block is on the page. If that works, then this should be very easy to setup! I will keep you updated.

hockey2112’s picture

Awesome, thanks!

stewart.adam’s picture

Status:Active» Fixed

I've committed this feature to git and it should appear in the next dev release within 24h. You can try it out by enabling "Enable ajax cart functionality only when block is enabled" in the AJAX cart settings.

Automatically closed -- issue fixed for 2 weeks with no activity.