# El Ganso Magento Hyvä — proyecto completo

Repo del **proyecto Magento 2 completo** para la migración a Hyvä de El Ganso. Reemplaza al setup anterior (`ELGANSO/TheComunity`) que era ScandiPWA.

## Estructura

```
hyva-elganso/
├── app/
│   ├── code/Yeboyebo/               ← módulos custom (8 módulos Yeboyebo_*Hyva)
│   │   ├── HyvaCheckoutStripeFix/
│   │   ├── HyvaCsp/
│   │   ├── HyvaSearch/
│   │   ├── MrwPuntosRecogidaHyva/
│   │   ├── RewardPointsHyva/
│   │   ├── StorePickupHyva/
│   │   ├── TarjetasMonederoHyva/
│   │   └── ValesHyva/
│   └── design/frontend/Yeboyebo/hyva_elganso/   ← theme
│       ├── Magento_Catalog/                     ← overrides templates Catálogo
│       ├── Magento_Theme/                       ← header + footer + home
│       ├── Yeboyebo_Stores/                     ← Store Locator (Leaflet)
│       ├── Hyva_Checkout/                       ← checkout overrides
│       ├── web/tailwind/                        ← Tailwind source
│       ├── i18n/es_ES.csv                       ← traducciones
│       ├── composer.json                        ← declara theme
│       ├── theme.xml
│       └── registration.php
├── bin/magento                       ← Magento CLI
├── pub/                              ← index.php, get.php, .htaccess, etc.
├── composer.json                     ← deps del proyecto Magento (Amasty, Magefan, etc.)
├── composer.lock
├── auth.json.sample                  ← copy → auth.json + fill tokens
├── nginx.conf.sample                 ← vhost template Magento
└── .gitignore                        ← excluye vendor/, var/, generated/, env.php, pub/static/, pub/media/
```

## Setup (developer local)

```bash
git clone git@github.com:ander3024/hyva-elganso.git
cd hyva-elganso

# Auth para composer privates
cp auth.json.sample auth.json
# Editar auth.json con tokens reales (Magento + Amasty + MageMe + Hyvä Themes + GitHub PAT)

composer install --no-dev --prefer-dist --ignore-platform-req=php

# Configurar BD (MySQL)
bin/magento setup:install \
    --base-url=https://hyva.local/ \
    --db-host=127.0.0.1 \
    --db-name=elganso_hyva \
    --db-user=elganso_hyva \
    --db-password=xxx \
    --admin-firstname=Admin --admin-lastname=Admin \
    --admin-email=admin@elganso.com \
    --admin-user=admin --admin-password='AdminPass123!' \
    --language=es_ES --currency=EUR --timezone=Europe/Madrid

# Theme
bin/magento config:set design/theme/theme_id 9   # Yeboyebo/hyva_elganso
bin/magento module:enable --all

# Static deploy
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy es_ES en_US \
    -t Yeboyebo/hyva_elganso -t Magento/luma -t Magento/blank \
    -f --no-html-minify

# Tailwind build
cd app/design/frontend/Yeboyebo/hyva_elganso/web/tailwind
npm install
npm run build
```

## Servidor de referencia (Madrid EC2)

- **URL**: https://hyva.elganso.com/ (basic auth `test / !test123!`)
- **CloudPanel UI**: https://hyva.elganso.com:8443/
- **Code Deploy panel**: https://code-hyva.elganso.com/ (deploys automatizados desde este repo)
- Setup detallado en [`SETUP_INSTALL_INDEPENDIENTE.md`](./SETUP_INSTALL_INDEPENDIENTE.md)

## Design tokens (devlab:studio)

| Token | Valor | Uso |
|---|---|---|
| `--c-primary` | `#041D40` | Navy corporativo (texto, header, footer, marker map) |
| Tipografía display | `ABCDiatypeEditSemi-Mono` | Headings, botones |
| Tipografía body | `Neue Montreal`, Helvetica fallback | Body, descripciones |
| `--rounded` | 0 | Botones cuadrados (no border-radius) |

## Stack tecnológico

- **Magento**: 2.4.8 (Community)
- **PHP**: 8.3
- **Hyvä Theme**: 1.4.x (vía `vendor/hyva-themes/`)
- **Tailwind CSS**: 4.x con tokens custom
- **Alpine.js**: 3.x (vía Hyvä)
- **Magewire**: 1.13.3 (vía Hyvä Checkout)

## Workflow

1. Branch nuevo desde `main`
2. Cambios en `app/design/frontend/Yeboyebo/hyva_elganso/` o `app/code/Yeboyebo/`
3. Build Tailwind local (`npm run build`)
4. Commit + push
5. PR a `main`
6. Merge → trigger deploy automático vía panel https://code-hyva.elganso.com/

## Contacto

Andrés Fernández — `andres@careucom.com`
