Skip to content

Commit

Permalink
agrego sweet alert al añadir cursos al carrito
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Spj committed Oct 5, 2023
1 parent c730a55 commit b34211c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class carritoCompras{
}

agregarCurso(objCurso) {

this.alertaCursoAgregado();

// si el curso ya está en el carrito, no lo agrego
if (this.listaCarrito.find(curso => curso.ID === objCurso.ID)) {
console.log('No agregado, ID: ' + objCurso.ID +' ya está en el carrito');
Expand Down
2 changes: 2 additions & 0 deletions php/views/usuario/cursos/cursos.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
<script src="https://unpkg.com/[email protected]/dist/boxicons.js"></script>
<script src="js/main.js"></script>

<!-- Sweet Alert -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

</body>
</html>

0 comments on commit b34211c

Please sign in to comment.