Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/wreyesus/Sencillo_Carrito_de_Compras_en_PHP/llms.txt

Use this file to discover all available pages before exploring further.

This quickstart walks you from a fresh download of the YUME|TEC repository to a fully working local store where you can log in, browse computer hardware, add items to your cart, and proceed to checkout. By the end you will have Apache serving the PHP pages, a populated MySQL tienda database, and the YUME|TEC homepage loading at http://localhost/tienda/index.php.
1

Prerequisites

Before you begin, make sure the following software is installed on your machine.
  • PHP 5.6 — use XAMPP 5.6.x or a WAMP distribution that bundles PHP 5.6
  • MySQL 5.x — included with both XAMPP and WAMP
  • Apache — included with both XAMPP and WAMP; must be running before you open the store
YUME|TEC calls mysql_pconnect(), mysql_query(), mysql_fetch_array(), and related functions from the legacy mysql_* extension. This extension was removed in PHP 7.0 and does not exist in any later release. Running the project on PHP 7 or higher will immediately produce a fatal error. You must use PHP 5.6 or rewrite every mysql_* call to use mysqli or PDO before attempting to run the project on a modern runtime.
2

Copy the project files

Clone or download the repository, then copy the entire project folder into your Apache web root and rename it tienda so that the URL paths match the links hard-coded in the navigation.For XAMPP on Windows, the web root is htdocs\:
C:\xampp\htdocs\tienda\
For WAMP on Windows, the web root is www\:
C:\wamp\www\tienda\
On Linux/macOS with XAMPP, the web root is:
/opt/lampp/htdocs/tienda/
After copying, the folder should contain index.php, carrito.php, the BD/ and Connections/ subdirectories, and all other project files directly inside tienda/.
3

Import the database

The project ships with a complete database dump at BD/bd.sql that creates the four tables and inserts all seed data (product listings, categories, and sample user accounts). Follow these steps to import it.
  1. Start MySQL and Apache from your XAMPP or WAMP control panel.
  2. Open phpMyAdmin in your browser at http://localhost/phpmyadmin.
  3. Create a new database named tienda using the latin1 character set — the dump was exported with that encoding and the product descriptions rely on it.
  4. Select the tienda database, go to the Import tab, choose BD/bd.sql, and click Go.
You can also create the database from a MySQL client before importing:
CREATE DATABASE tienda CHARACTER SET latin1;
USE tienda;
-- then import BD/bd.sql
After the import completes you should see four tables: categorias, productos, compra, and usuario. The productos table will contain 31 rows covering processors, motherboards, and RAM modules.
4

Configure the connection

Open Connections/tienda.php in your editor. This is the only file you need to change for a standard local setup. It contains the four variables that wire PHP to your MySQL instance:
Connections/tienda.php
$hostname_tienda = "localhost";
$database_tienda = "tienda";
$username_tienda = "root";
$password_tienda = "";
$tienda = mysql_pconnect($hostname_tienda, $username_tienda, $password_tienda)
    or trigger_error(mysql_error(), E_USER_ERROR);
The defaults (root with an empty password connecting to localhost) match a fresh XAMPP or WAMP installation, so you typically do not need to edit this file at all for local development. If your MySQL root account has a password, or if you created a dedicated database user, update $username_tienda and $password_tienda accordingly.
Note: Never deploy these credentials to a public server. The root account with no password is appropriate only for a localhost development environment.
5

Open the store

With Apache and MySQL running and the files in place, navigate to the store in your browser:
http://localhost/tienda/index.php
You will see the YUME|TEC homepage: a dark-themed page with the store banner, a horizontal navigation bar (Inicio · Nosotros · Productos · Contacto · Carrito), and a slide-down panel at the top of the page. Clicking Entrar in the top panel reveals the members login form where you can enter a username and password. If the page loads without any PHP errors or white-screen output, your environment is configured correctly.

Test the Full Flow

Once the store is running, walk through the complete purchase journey to confirm every subsystem is working.
  • Register a new account — go to http://localhost/tienda/nuevo_usuario.php and fill in the registration form; on success the new row appears in the usuario table
  • Browse processors — navigate to http://localhost/tienda/cat_procesadores.php to see all 10+ CPU listings pulled live from the productos table
  • Add an item to the cart — click any product’s “Agregar al carrito” button; the item is stored in $_SESSION['carrito']
  • View the cart — go to http://localhost/tienda/carrito.php to review your selected items, quantities, and the running subtotal
  • Proceed to checkout — follow the cart through resumenc_compra.php and final.php to see the PayPal handoff form
Skip registration entirely during initial testing by using the pre-seeded developer account from BD/bd.sql. Log in with username ryuzaki and password hola — this account (user ID 1, belonging to Saúl Guardado) is inserted by the SQL dump and has full access to every page in the store.

Build docs developers (and LLMs) love