-
-
Save parzibyte/a780c811e54600bc6dede3fe01988192 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include_once "encabezado.php" ?> | |
<?php | |
include_once "funciones.php"; | |
$productos = obtenerProductos(); | |
?> | |
<div class="columns"> | |
<div class="column"> | |
<h2 class="is-size-2">Tienda</h2> | |
</div> | |
</div> | |
<?php foreach ($productos as $producto) { ?> | |
<div class="columns"> | |
<div class="column is-full"> | |
<div class="card"> | |
<header class="card-header"> | |
<p class="card-header-title is-size-4"> | |
<?php echo $producto->nombre ?> | |
</p> | |
</header> | |
<div class="card-content"> | |
<div class="content"> | |
<?php echo $producto->descripcion ?> | |
</div> | |
<?php if (productoYaEstaEnCarrito($producto->id)) { ?> | |
<h1 class="is-size-3">$<?php echo number_format($producto->precio, 2) ?></h1> | |
<form action="eliminar_del_carrito.php" method="post"> | |
<input type="hidden" name="id_producto" value="<?php echo $producto->id ?>"> | |
<span class="button is-success"> | |
<i class="fa fa-check"></i> En el carrito | |
</span> | |
<button class="button is-danger"> | |
<i class="fa fa-trash-o"></i> Quitar | |
</button> | |
</form> | |
<?php } else { ?> | |
<form action="agregar_al_carrito.php" method="post"> | |
<input type="hidden" name="id_producto" value="<?php echo $producto->id ?>"> | |
<button class="button is-primary"> | |
<i class="fa fa-cart-plus"></i> Agregar al carrito | |
</button> | |
</form> | |
<?php } ?> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php } ?> | |
<?php include_once "pie.php" ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment