Announcement

Collapse
No announcement yet.

Make the Mini Basket Scroll to the bottom to show most recently added product

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Make the Mini Basket Scroll to the bottom to show most recently added product

    Hi,

    I'd like to have the mini basket to show the most recent item added to the cart when the add to cart button is clicked and the basket drops down. I suppose it would be okay for that to also be true any time the mini basket is clicked as well but I'm not as worried about that.

    I was thinking that if it would auto scroll to the bottom of the basket would be nice. That way the order of the basket contents stays consistent with the actual cart (BASK page).

    If that's not possible, is it possible to change the order of the mini basket contents to show the most recent? COuld this also be implemented on the BASK page to keep it consistent?

    Thanks.

    -Nick
    Nick Harkins
    www.loveisarose.com
    *Web Developer
    *Miva
    *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

    #2
    Hi Nick,

    For scrolling the mini-basket when you click the link, you could add this to your 'scripts.js' file:
    Code:
    $('#js-mini-basket, #js-mobile-basket-button, #js-mobile-footer-basket').on('click', function () {
        $('.mini-basket-table-wrap').scrollTop($('.mini-basket-table-wrap')[0].scrollHeight);
    });
    For doing it when you click add to cart, you could add this in the 'scripts.js' file by finding:
    Code:
    miniBasket.html(responseMiniBasket.contents()).addClass('open');
    and replacing with:
    Code:
    miniBasket.html(responseMiniBasket.contents()).addClass('open');
    $('.mini-basket-table-wrap').scrollTop($('.mini-basket-table-wrap')[0].scrollHeight);
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Works Perfectly.

      Thanks again Matt.
      Nick Harkins
      www.loveisarose.com
      *Web Developer
      *Miva
      *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

      Comment

      Working...
      X