basic javascript for cart