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.

YUME|TEC has two main configuration points: the database connection and the email settings. The database connection is centralised in a single file (Connections/tienda.php) that every PHP page includes. Email is handled by PHPMailer, configured separately in registro.php (which sends a welcome email on registration) and final.php (which sends an order confirmation). Both files contain hardcoded values that you must update before the corresponding features will work in your environment.

Database connection

All database credentials live in Connections/tienda.php. Open this file and update the four variables to match your local MySQL setup:
Connections/tienda.php
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$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);
?>
VariableDefault valueDescription
$hostname_tiendalocalhostHostname or IP address of the MySQL server.
$database_tiendatiendaName of the database created during the import step.
$username_tiendarootMySQL username used to authenticate the connection.
$password_tienda(empty)MySQL password for the above user. Empty by default in XAMPP.
The file uses mysql_pconnect (persistent connect) rather than mysql_connect. On a single-user local stack this makes no practical difference, but on a shared host it means the connection is kept open between requests rather than being closed at the end of each script.
The default credentials (root with no password) are only appropriate for a local development environment such as XAMPP or WAMP. On any shared hosting account or server that is reachable from the internet, you must create a dedicated MySQL user with a strong password and grant it only the permissions needed (SELECT, INSERT, UPDATE, DELETE on the tienda database). Never expose root credentials in a deployed application.

Email configuration (PHPMailer)

Two files in the project send transactional email using PHPMailer. You need to update the sender address, company name, and SMTP host in each file independently. registro.php — sends a welcome email when a new user completes registration:
$correo_empresa = "[email protected]";
$empresa = "Tu empresa";
$mail->Host = "la direccion de tu sitio web http://www.tusitio.com/";
final.php — sends an order confirmation email after a purchase is completed:
$correo_empresa = "[email protected]";
$empresa = "YUME-TEC | ";
$mail->Host = "http://programacionphp.liriosdesaron.net/";
Replace the following values in both files:
  • $mail->Host — Set this to your actual SMTP server hostname (e.g. smtp.gmail.com or mail.yourdomain.com). The current values are placeholder URLs, not valid SMTP hostnames.
  • $correo_empresa — The From address that recipients will see. Use an address on a domain you control.
  • $empresa — The sender name that appears alongside the From address in email clients.
Depending on your mail provider you may also need to set $mail->SMTPAuth = true, $mail->Username, $mail->Password, and $mail->Port — consult the PHPMailer documentation for your SMTP provider.
For local development, outbound SMTP will fail unless you have a mail server configured. Instead of debugging SMTP locally, use a mail-catching tool such as Mailhog or Mailtrap. Both intercept all outbound email and display it in a web UI without delivering it. Alternatively, you can comment out the PHPMailer $mail->Send() calls in registro.php and final.php while you develop and test the rest of the application.

PayPal configuration

The checkout page (final.php) submits an order form to PayPal using a hardcoded merchant email:
<input type="hidden" name="business" value="[email protected]">
Replace [email protected] with your own PayPal business account email address. The form also sets the following values that you may want to review:
  • Currency — hardcoded as USD. To accept a different currency, change the currency_code hidden field value to the appropriate ISO 4217 code.
  • Language — the PayPal button and interface are set to ES (Spanish). Change the lc hidden field value to your preferred locale code if needed (e.g. EN for English).

Build docs developers (and LLMs) love