mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-20 15:50:21 +00:00
falta precio completo del item del carrito y devolver que ya existe el presupuesto en el carro
This commit is contained in:
@ -274,13 +274,16 @@ export default class PresupuestoWizard {
|
||||
$('.add-cart-btn').on('click', async () => {
|
||||
const success = await this.#guardarPresupuesto();
|
||||
if (success) {
|
||||
await $.ajax({
|
||||
const res = await $.ajax({
|
||||
url: `/cart/add/${this.opts.presupuestoId}`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
// Si el backend devuelve { redirect: "/cart" }
|
||||
if (res?.redirect) {
|
||||
window.location.assign(res.redirect); // o replace()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -843,7 +846,7 @@ export default class PresupuestoWizard {
|
||||
const errors = xhr.responseJSON;
|
||||
if (errors && typeof errors === 'object') {
|
||||
this.interior_alert.find('#form-errors-alert-list').append(`<li>${errors.message}</li>`);
|
||||
|
||||
|
||||
}
|
||||
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
||||
});
|
||||
|
||||
@ -53,14 +53,15 @@
|
||||
<form th:action="@{|/cart/${item.cartItemId}/remove|}" method="post" class="d-inline">
|
||||
<input type="hidden" name="_method" value="delete" />
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<button type="submit" class="btn btn-sm btn-link text-body p-1 px-2">
|
||||
<a href="#" class="d-block text-body p-1 px-2"
|
||||
onclick="this.closest('form').submit(); return false;">
|
||||
<i class="ri-delete-bin-fill text-muted align-bottom me-1"></i> Eliminar
|
||||
</button>
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user