# Add New Sofa, AR Height, and Live Chat Guide

## 1. Paano mag-add ng panibagong sofa

Current version uses file-based products. Edit this file:

```text
data/products.php
```

Copy one existing product array and paste it before the closing `];`. Change these important fields:

```php
array(
    'id' => 'new-sofa-id',
    'name' => 'New Sofa Name',
    'tagline' => 'Short selling line here.',
    'collection' => 'Modular',
    'room' => 'Living room',
    'price' => 45900,
    'compare_at' => 52900,
    'rating' => 4.8,
    'reviews' => 0,
    'stock_status' => 'Made to order',
    'seats' => '3 seats',
    'dimensions' => '220cm W x 95cm D x 85cm H',
    'dimensions_cm' => array('width' => 220, 'depth' => 95, 'height' => 85),
    'material' => 'Fabric, kiln-dried frame',
    'color' => 'Cream',
    'lead_time' => '7-10 days',
    'warranty' => '1-year warranty',
    'image' => 'assets/images/new-sofa.png',
    'model' => 'assets/models/new-sofa.glb',
    'ar_floor_offset_cm' => 0,
    'badges' => array('New', 'AR-ready'),
    'features' => array(
        'Feature 1',
        'Feature 2',
        'Feature 3',
    ),
    'swatches' => array(
        array('label' => 'Cream', 'hex' => '#eee7dc'),
        array('label' => 'Gray', 'hex' => '#777777'),
    ),
),
```

Then upload:

```text
assets/images/new-sofa.png
assets/models/new-sofa.glb
```

Optional but recommended: also create a WebP image with the same filename:

```text
assets/images/new-sofa.webp
```

## 2. Paano itaas o ibaba ang sofa sa AR

Mas maganda na huwag bigyan ng raise/lower control ang buyer. Kapag fixed true-size AR, dapat accurate agad ang floor placement. Kung may manual height control ang buyer, puwedeng hindi na tugma sa real measurement.

Correct fix: ayusin ang 3D model file.

Rules for GLB model:

- Unit must be meters.
- glTF/model-viewer uses Y-up coordinates.
- X = sofa width.
- Y = sofa height.
- Z = sofa depth.
- Bottom of sofa must touch Y = 0 floor line.
- Apply transforms before export.
- Export as `.glb`.

### If lumulutang ang sofa

Lower the GLB model. Example: floating by 5cm:

```bash
python tools/adjust_glb_height.py assets/models/new-sofa.glb assets/models/new-sofa-fixed.glb -5
```

Then update `data/products.php`:

```php
'model' => 'assets/models/new-sofa-fixed.glb',
'ar_floor_offset_cm' => -5,
```

### If nakalubog sa floor ang sofa

Raise the GLB model. Example: sinking by 3cm:

```bash
python tools/adjust_glb_height.py assets/models/new-sofa.glb assets/models/new-sofa-fixed.glb 3
```

Then update `data/products.php`:

```php
'model' => 'assets/models/new-sofa-fixed.glb',
'ar_floor_offset_cm' => 3,
```

Important: after replacing a model, test on actual phone using HTTPS.

## 3. Live chat setup

Live chat widget is ready but disabled by default. Edit:

```text
data/settings.php
```

Example Messenger setup:

```php
'chat' => array(
    'enabled' => true,
    'title' => 'Need help choosing a sofa?',
    'subtitle' => 'Ask about size, fabric, delivery, or AR room fit.',
    'messenger_url' => 'https://m.me/YOUR_FACEBOOK_PAGE',
    'whatsapp_number' => '',
    'email' => '',
    'phone' => '',
    'show_inquiry_link' => true,
),
```

Example WhatsApp setup:

```php
'whatsapp_number' => '639171234567',
```

Use country code format and no plus sign for WhatsApp.

## 4. Better future upgrade

For a real store admin workflow, the next major upgrade should be:

- MySQL products table
- Admin login
- Add/Edit/Delete product form
- Image upload
- GLB/USDZ model upload
- Order dashboard
- Live chat integration with Messenger/Tawk.to/Crisp or a custom chat system
