Home › Forums › WoodMart support forum › Autoscroll down on open cart widget
Autoscroll down on open cart widget
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by
Elise Noromit.
-
AuthorPosts
-
December 1, 2020 at 10:33 am #246441
azariaParticipantHello,
I have a webshop where customers usually makes big carts with so much items. I have configured the “Display Widget” action after add to cart, and when the cart have many items (like 50 for example) and the customer adds to cart a new item, he needs to scroll so much to find the last item added,
Do you know if there is any Custom JS code snippet to autoscroll down on cart widget open?
Many thanks in advance,
December 1, 2020 at 2:24 pm #246545
Elise NoromitMemberHello,
Thank you very much for choosing our theme and for contacting us.
This is the way the Woocommerce widget works and our theme does not influence that. You can disable the shopping cart as a sidebar and redirect the customer just to the shopping cart page. Unfortunately, we do not have any solution for that.
Best Regards
December 2, 2020 at 10:33 am #246909
azariaParticipantI’ve seen in your functions.js that when you add to cart it triggers the click of the “.cart-widget-opener a” element. You can’t add any action to this .cart-widget-opener a to scroll .shopping-cart-widget-body?
I tested this and doesn’t works:
jQuery(‘.cart-widget-opener’).on(‘click’, ‘a’, function(){
$(‘html,body’).animate({scrollTop: shopping-cart-widget-body.offset().bottom});
});Thanks in advance,
December 3, 2020 at 9:38 am #247239
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Global:
.widget_shopping_cart .product_list_widget { display: flex; flex-direction: column-reverse; } .widget_shopping_cart .product_list_widget>li:last-child { border-bottom: 1px solid rgba(129,129,129,.2); } .widget_shopping_cart .product_list_widget>li:first-child { border-bottom: none; }
New products would go to the top.
Best Regards
December 3, 2020 at 10:51 am #247269
azariaParticipantIt’s better solution that I proposed, reverse the order of the items by css instead of auto-scroll.
Many thanks!
December 3, 2020 at 3:07 pm #247409
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
February 3, 2021 at 12:48 pm #263548
azariaParticipantOn mini cart the CSS works well, but to have coherence, I need to reverse too the normal cart order of the items by CSS. Do you know how to do it? Thanks in advance.
February 3, 2021 at 2:10 pm #263593
Elise NoromitMemberHello,
HTML structure does not allow solving it by custom CSS. Such modification requires complicated Woocommerce code customization which is not covered by our support.
A shopping cart is created in the table and such CSS would work.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register