Nuestras asesorías
Mostrando 6 resultados
declaración anual
de sueldos y salarios","tituloPlano":"Presentamos tu declaración anual de sueldos y salarios","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/calculadora.svg","imagen":"/img/asesoria-declaracion-anual.jpg","precio":997},{"id":2,"slug":"asesoria-express","titulo":"Asesoría
Express","tituloPlano":"Asesoría Express","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/mesa.svg","imagen":"/img/asesoria-express.jpg","precio":497},{"id":3,"slug":"asesoria-sueldos-salarios","titulo":"Asesoría, sueldos
y salarios","tituloPlano":"Asesoría, sueldos y salarios","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/dinero.svg","imagen":"/img/asesoria-sueldos-salarios.jpg","precio":597},{"id":4,"slug":"asesoria-nenis-freelancers","titulo":"Asesoría para
nenis y freelancers","tituloPlano":"Asesoría para nenis y freelancers","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/social.svg","imagen":"/img/asesoria-nenis-freelancers.jpg","precio":697},{"id":5,"slug":"asesoria-presencial","titulo":"Asesoría presencial
Quintana Roo","tituloPlano":"Asesoría presencial Quintana Roo","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/q-roo.svg","imagen":"/img/asesoria-presencial.jpg","precio":1397},{"id":6,"slug":"asesoria-1-a-1","titulo":"Asesoría 1 a 1
empezando tu negocio
(online básica)","tituloPlano":"Asesoría 1 a 1 empezando tu negocio (online básica)","descripcion":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.","icono":"/icons/mesa-2.svg","imagen":"/img/asesoria-1-a-1.jpg","precio":1197}];
function initOrdenamientoAsesorias() {
const select = document.getElementById("orden");
const grid = document.getElementById("asesoria-grid");
if (!select || !grid) return;
const original = Array.from(grid.children);
select.addEventListener("change", () => {
const valor = select.value;
let cards = Array.from(grid.children);
if (valor === "asc") {
cards.sort((a, b) => a.dataset.precio - b.dataset.precio);
} else if (valor === "desc") {
cards.sort((a, b) => b.dataset.precio - a.dataset.precio);
} else {
cards = [...original];
}
cards.forEach((card) => grid.appendChild(card));
});
}
async function setAgregarCarrito() {
const botones = document.querySelectorAll(".btn-add-cart");
if (!botones.length) return;
const {
agregarProducto,
renderCarritoResumen,
actualizarBadgeCarrito,
} = await import("/scripts/carrito.js");
// Creamos un objeto para mapear los productos
const mapaProductos = Object.fromEntries(
asesorias.map((a) => [
a.id.toString(),
{
id: a.id,
titulo: a.tituloPlano,
imagen: a.imagen,
precio: a.precio,
},
]),
);
botones.forEach((btn) => {
const id = btn.dataset.id;
if (!id || !mapaProductos[id]) return;
// Evita duplicación de listeners
const nuevoBtn = btn.cloneNode(true);
btn.replaceWith(nuevoBtn);
nuevoBtn.addEventListener("click", () => {
const base = mapaProductos[id];
const producto = { ...base, cantidad: 1 };
agregarProducto(producto);
renderCarritoResumen();
actualizarBadgeCarrito();
});
});
}
function limpiarEventos(btn) {
const nuevoBtn = btn.cloneNode(true);
btn.parentNode.replaceChild(nuevoBtn, btn);
return nuevoBtn;
}
async function setupAgregarCarrito() {
let btn = document.getElementById("btn-agregar-carrito");
const input = document.getElementById("cantidad");
if (!btn || !input) return;
btn = limpiarEventos(btn);
const {
agregarProducto,
renderCarritoResumen,
actualizarBadgeCarrito,
} = await import("/scripts/carrito.js");
btn.addEventListener("click", () => {
const cantidad = parseInt(input.value) || 1;
const producto = {
id,
titulo: tituloPlano,
imagen,
precio,
cantidad,
};
agregarProducto(producto);
renderCarritoResumen();
actualizarBadgeCarrito();
});
}
if (document.readyState !== "loading") {
initOrdenamientoAsesorias();
setAgregarCarrito();
setupAgregarCarrito();
} else {
document.addEventListener("DOMContentLoaded", () => {
initOrdenamientoAsesorias();
setAgregarCarrito();
setupAgregarCarrito();
});
}
document.addEventListener("astro:after-swap", () => {
initOrdenamientoAsesorias();
setAgregarCarrito();
setupAgregarCarrito();
});
Mostrando 6 resultados