Project:Ubercart ajax cart
Version:6.x-1.0-rc9
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When you add an item to cart by default the cart expands. In some themes this can be undesired behaviour (the cart can overlap when the block is in a region above the content). Please add a configuration to change this default behaviour.

Comments

#1

Will come in next release.
-> goes to feature list.

#2

Any workaround for this? The cart goes beyond the header in my theme so I want to keep it colapsed.

#3

I also need this feature so that I can use this module.

#4

Title:Keep the cart collapsed» Keep the cart collapsed/expanded

Hey There,

Based on this thread and how my site acts, I think this module has been updated to accommodate the above requests. But now I have the opposite issue.

My problem is that now, if a user has the cart expanded and adds another item to the cart - the cart collapses. Is there a way for me to prevent that? If it is the only way... I'd be glad to go back to the state that the above posts are describing: having the cart expand anytime an item is added.

Thanks in advance!
Andrew

#5

I'm using UC Ajax Cart 2.0-alpha8 and I'm still having a similar issue... The cart, even when someone has items in it, collapses on default on page-load. I see the contents for a second and then if collapses... I took a peak at the uc_ajax_cart.js file and it seems like the 'ajax-cart-visible' cookie isn't getting set correctly so it's hiding the contents as soon as the page loads.. Has anyone found a solution to this yet??

#6

for anyone who doesn't want the cart to collapse at all in 6.x-2.0-beta2, if you go to uc_ajax_cart.js and you shave a few lines from
the function ajaxCartCheckCartToggle() on line 59, making it:

function ajaxCartCheckCartToggle()
{
jQuery('#ajaxCartUpdate #cart-block-contents-ajax').show();
}

or comment the lines out:

function ajaxCartCheckCartToggle()
{
// if ( jQuery.cookie('ajax-cart-visible') == '1' )
// {
jQuery('#ajaxCartUpdate #cart-block-contents-ajax').show();
// } else {
// jQuery('#ajaxCartUpdate #cart-block-contents-ajax').hide();
// }
}

you should have a working ajax cart that stays expanded.

The other way to do this, which keeps the if statement, but makes it illogical, is to change
hide to show at the end of the else part of the statement at line 65:

function ajaxCartCheckCartToggle()
{
if ( jQuery.cookie('ajax-cart-visible') == '1' )
{
jQuery('#ajaxCartUpdate #cart-block-contents-ajax').show();
} else {
jQuery('#ajaxCartUpdate #cart-block-contents-ajax').show();
}
}

#7

I would believe this trick could have worked to keep the cart closed as well by keeping the hide() line, but it does not work. Any easy trick to keep the cart items hidden? I want to have the cart block in the header, and it does not expand down very well....

#8

+1 for NOT expanding the cart block

I have the cart block in the header and don't want the block to display cart contents, just the number of items and total.
Copy the uc_ajax_cart_block_content.tpl.php template to your theme directory and delete the products table to keep it from displaying.

#9

Give a try with this :

edit /all/modules/uc_ajax_cart/templates/uc_ajax_cart_block_content.tpl.php

replace

<div id="cart-block-contents-ajax">

by
<div id="cart-block-contents-ajax" style="display: none;">

dave

#10

Status:active» fixed

This has been fixed in the 2.x branch.

#11

Please do not edit module templates. Add a new template in theme and make your changes there.

#12

Status:fixed» closed (fixed)

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

nobody click here