Minicart to show amount remaining until free shipping

On this test site:
http://v3.dianejameshome.com/

I've setup the minicart straight from the docs. It shows the cart total.

Is there a way to access the minicart through js?

Rather than show the cart total, I need to show the order amount remaining until the customer hits our free shipping limit of $350.

So if you have $100 in your cart, the message should read "add $250 to you cart to get free shipping"

Thanks
Comments
  • fc_adamfc_adam FoxyCart Team
    @carvertech,

    You can set up any sort of custom minicart functionality you'd like - for sure! The current cart is always available in the cart JSON object available whenever you include loader.js, and the current total price of the items in the cart is available as FC.json.total_item_price.

    The other thing you'll need to do is update that message whenever the cart is altered. You can do that by hooking into our events like this:
    <script>
    var FC = FC || {};
    FC.onLoad = function () {
    FC.client.on('ready.done', updateMinicart);
    FC.client.on('cart-submit.done', updateMinicart);
    FC.client.on('render.done', updateMinicart);
    };
    function updateMinicart() {
    // Update your custom minicart information
    }
    </script>
  • perfect - thanks!
Sign In or Register to comment.