metallissimus wrote:I understand the technical reasons behind this and of course an ADD button doesn't make any sense. That was some kind of reflex to mention add/remove as one feature.
I like answering your questions, because these things took time to figure out myself, which is the reason I can answer in detail. While I was working on the cart-popup, these logical/technical dilemmas appeared, ultimately forcing me to keep it simple and perhaps limited.
metallissimus wrote:But I would argue that without a REMOVE button, the cart popup loses a lot of its purpose. I'd say the main use case for the cart popup is reviewing one's selection. I think the expected behaviour would be that it's possible to alter that selection in the same place.
Yes, it would make sense. It's very clumsy to to dynamically update the popup if you are removing items though ... First of all, the POPUP and all it's slides are created when first item is clicked. If we are to remove items, technically we need to close and re-open the popup with updated slides ... Also, as noted in my previous post, if user clicks REMOVE, we need to navigate to NEXT item in popup, or close the popup if there is only one item ... Technically very clumsy, and perhaps not even intuitive if the popup navigates by itself after clicking "remove".
I could definitely consider looking into this, but I'm not 100% convinced.
metallissimus wrote:The user doesn't differentiate between the gallery popup and the cart popup, this is a purely technical difference and not visible to the user.
I'm not sure. When the user clicks an item in cart, they should expect to be able to navigate all items (and only items) in the cart. If they click an item in the page, they should expect to be able to navigate all items in current page gallery, and ONLY items in page gallery. They may not consciously think about it like this, but this is definitely how it has to work.
metallissimus wrote:Actually I can remove items from the cart in the cart itself, why not in the popup?
The reason for this would be that the cart needs "remove" buttons, and it basically works naturally when the cart-popup is closed. Closing the cart-popup (if open) when removing items from the cart, was just a necessary precaution because the popup slides are basically no longer valid after an item is removed ... The cart-popup is after all a "bonus feature" of the cart, and not strictly required for the cart to operate (like other carts). Definitely not optimal, but it was the best solution.
metallissimus wrote:If the popup is open and I remove the current image, it just closes – the same solution could work with a REMOVE button in the popup (although I would strongly prefer your idea of showing the next image).
If we do this, it means the popup will CLOSE as soon as anyone clicks a REMOVE button in the popup, even if there are other items in the popup and other items in the cart. This seems counter-intuitive, and does not seem like a worthwhile solution.
metallissimus wrote:(although I would strongly prefer your idea of showing the next image).
For me, this would be the only functional solution. I must admit, it's a technical challenge, because the popup was not built to be dynamically updated like this (remove slides, navigating to next, and updating the internal state of objects and counters without re-starting the popup) ... By default, the popup is initiated when it opens, and the cart plugin is basically using the same methods as made available to public in the
X3 popup plugin.
I will add it to my list, and see if it can be done. We both agree that this would be the best solution :star:
metallissimus wrote:Is there a way to configure the cart popup seperately? Or at least have it have an ID or different class to target it in CSS? If I see it correctly, at the moment the classes are the same as for the gallery popup.
There is no cart popup config ... Technically, there is no specific "cart popup", it's just a plain popup with slides assigned by image url's. The
gallery-popup is a different story, but we can't use that for cart, which is dynamic images often from multiple dirs.
There is a class
.x3-cart-popup set on the popup root that can be used to style the popup for the cart. For example, hide the caption:
.x3-cart-popup .pswp__caption {
display: none;
}