Custom Login Bar
- Ryan Shafer
- Mar 16
- 1 min read
Sometimes the default elements will be responsive regardless of your settings, so it can look odd on larger screens. Or maybe the default elements design settings are too limiting and you are not able to design a version you like. Well if either of those are the case for you, then this lesson is for you!
VIDEO IS FOR CHANNEL MEMBERS ONLY. JOIN HERE.
$w.onReady(function () {
//RUN CART FUNCTION
hideCartIcon();
});
// CART INDICATOR FUNCTION
import {cart} from 'wix-stores';
function hideCartIcon(id) {
cart.getCurrentCart().then(initialCart => showIcon(initialCart));
cart.onChange(changedCart => showIcon(changedCart));
function showIcon(aCart) {
let count = aCart.lineItems.length;
if (count) $w('#cartHasItems').show();
else $w('#cartHasItems').hide();
}
}
Enjoy!