fix cart widget not hidden despite option being checked. #1723

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

helgatheviking commented Nov 9, 2012

I checked the box to hide the cart widget if it was empty, but in my theme (which doesn't have a .widget class and instead uses .widgetcontainer) the inline js was not hiding the widget.

jQuery('.hide_cart_widget_if_empty').closest('.widget').hide();
                jQuery('body').bind('adding_to_cart', function(){
                    jQuery(this).find('.hide_cart_widget_if_empty').closest('.widget').fadeIn();
                });

I switched to something that isn't class-based so it should work with all themes

jQuery('.hide_cart_widget_if_empty').parent().hide();
                jQuery('body').bind('adding_to_cart', function(){
                    jQuery(this).find('.hide_cart_widget_if_empty').parent().fadeIn();
                });
Contributor

helgatheviking commented Nov 9, 2012

and somewhat related, when using w3c total cache the .product_list_widget list never gets the .hide_cart_widget_if_empty class

bpmedia commented Nov 9, 2012

not sure where to put the requests, but i'm missing something in orderdetails.php, it does not show the sku
i tried to update it myself with:

but i cant seem to get it work... please help!

Owner

mikejolley commented Nov 10, 2012

@bpmedia this is not a support channel.

Owner

mikejolley commented Nov 10, 2012

@helgatheviking we can't really assume that the parent will be the widget, just like in your case we cannot assume the widget will have .widget. Any other ideas? Isn't .widget standard?

Contributor

helgatheviking commented Nov 10, 2012

hmmmmm good point. I'm sure .widget is common, but I don't know if it is standard. I don't remember seeing that in the theme review docs, but I also haven't checked them in about a year.

Is there a way to add the "hide" class to the actual widget container and not to the list element?

Owner

mikejolley commented Nov 10, 2012

The default for register sidebars is:

'before_widget' => '<li id="%1$s" class="widget %2$s">',

Contributor

helgatheviking commented Nov 10, 2012

default, but not required. i can't think of another way, so that is probably the safest. i will just adjust my theme.

Owner

mikejolley commented Nov 10, 2012

Ok ta.

@mikejolley mikejolley closed this Nov 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment