minicart icon indicating copy to clipboard operation
minicart copied to clipboard

Unable to Remove Item when "minicart-showing" class is not on body

Open legenderrys opened this issue 10 years ago • 3 comments

@jeffharrell Im building minicartjs themes and would like to place the cart in a sidebar or checkout page.

The "remove item" button only works when an Item is added to cart which will add a "minicart-showing" class to the body allowing for the "remove item" function to be executed.

How can I allow the "remove item" function if the cart is always visible? and I also need to disable closing the cart based on click event outside the cart. On mobile, it seems to close inadvertently at times.

Here is a plunker example. http://plnkr.co/edit/DMmUOTapAWWMH5UWQSVL?p=preview

legenderrys avatar Aug 13 '14 13:08 legenderrys

You can force the cart to be shown after it's been rendered. You can also use the config object to set the cart's parent element.

http://plnkr.co/edit/YMHImV7WtCm0hcTe3YG3?p=preview

rpowis avatar Sep 10 '14 18:09 rpowis

@rpowis not understanding your solution. your plunker version doesn't remove an item when cart is populated.

Try emptying the cart. adding an item, then clicking anywhere outside the cart. and then try pressing the "x" button. Im using Chrome on mac

legenderrys avatar Sep 10 '14 18:09 legenderrys

oh i see what you mean. my plunker solves page refreshes but not paypal.minicart.view.hide() being triggered

rpowis avatar Sep 10 '14 20:09 rpowis