Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

Conversation

helgatheviking
Copy link
Contributor

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();
                });

@helgatheviking
Copy link
Contributor Author

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

@bpmedia
Copy link

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!

@mikejolley
Copy link
Member

@bpmedia this is not a support channel.

@mikejolley
Copy link
Member

@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?

@helgatheviking
Copy link
Contributor Author

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?

@mikejolley
Copy link
Member

The default for register sidebars is:

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

@helgatheviking
Copy link
Contributor Author

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

@mikejolley
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants