The YUME|TEC checkout is a two-page flow. First,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.
resumenc_compra.php presents a read-only summary of the cart alongside a short form where the customer confirms their display name and supplies an email address. When they submit that form, final.php takes over: it builds and sends an HTML order-confirmation email via PHPMailer, then constructs a PayPal _xclick payment form and auto-submits it with JavaScript so the customer lands on the PayPal payment page without having to click anything.
Order summary page (resumenc_compra.php)
resumenc_compra.php enforces authentication before showing any order data. If $_SESSION['usuario'] is not set, the visitor is immediately redirected to the registration/login page:
$_SESSION['carrito'] into $compras and renders every non-NULL entry in a read-only table — customers cannot alter quantities on this page. Above the product list, two form fields collect the information needed to send the confirmation email:
- Nombre — pre-filled with
$_SESSION['usuario'](the logged-in nickname), but editable. - E-Mail — an empty required field the customer must complete.
<form> that posts both fields to final.php. The cart itself does not need to be re-transmitted because final.php reads the same session.
final.php
final.php performs three actions in sequence when the order summary form is submitted:
Build the order email body
The script iterates over
$_SESSION['carrito'], skipping NULL entries, and assembles an HTML email string listing each product with its unit price, quantity, and line total. The grand total is appended at the end.Send confirmation emails via PHPMailer
A
PHPMailer instance is configured with the store’s outgoing mail host and sender address. The email is addressed to the customer (using the address they entered on the summary page) and CC’d to the store’s internal inbox at [email protected].Order email format
final.php constructs the email body by looping over the cart array and building one line per product:
$mail->Body = $pedido using PHPMailer’s HTML body. A plain-text fallback is provided in $mail->AltBody. The email is sent to:
- Customer — the address entered in the summary form, addressed as
"Compra a nombre {$nombre}". - Store copy —
[email protected], addressed as"Copia de Pedido".
Customizing PayPal
The following hidden fields inside the PayPal form infinal.php should be updated before going live:
| Field | Current default value | What to change it to |
|---|---|---|
business | [email protected] | Your PayPal merchant account email address |
item_name | YUME-TEC | Your store or product name shown on PayPal |
item_number | FM | Your internal order or SKU reference code |
no_shipping | 0 | Set to 1 to hide shipping address on PayPal |
no_note | 1 | Set to 0 to allow buyer notes on PayPal |
currency_code | USD | Your preferred ISO 4217 currency code |
lc | ES | The two-letter locale for the PayPal UI |
bn | PP-BuyNowBF | PayPal button source identifier |
amount field is always injected dynamically from $total and must not be hardcoded.