# Tryly.ai Virtual Try-On for WooCommerce

Add virtual try-on functionality to your WooCommerce store with one-click installation.

## Description

Tryly.ai Virtual Try-On brings cutting-edge augmented reality to your WooCommerce store, allowing customers to virtually try on products before purchasing. Perfect for eyewear, accessories, and fashion retailers.

## Features

- 🚀 **One-Click Setup** - Connect your store in seconds with OAuth integration
- 🔄 **Live Dashboard Sync** - Changes appear instantly without manual updates
- 📱 **Mobile Optimized** - Works seamlessly on all devices
- 🎨 **Customizable Design** - Match your brand with custom colors and styles
- 📊 **Analytics Dashboard** - Track performance and conversions
- ⚡ **High Performance** - Lightweight script that doesn't slow down your site

## Installation

### From WordPress Admin

1. Go to **Plugins → Add New**
2. Search for "Tryly.ai"
3. Click **Install Now** then **Activate**
4. Navigate to **Tryly.ai** in your admin menu
5. Click **Connect with Tryly.ai**
6. Done! The widget appears automatically on product pages

### Manual Installation

1. Download the plugin ZIP file
2. Go to **Plugins → Add New → Upload Plugin**
3. Choose the downloaded file and click **Install Now**
4. Activate the plugin
5. Follow the connection steps above

## Requirements

- WordPress 5.0 or higher
- WooCommerce 3.0 or higher
- PHP 7.2 or higher

## Configuration

Once connected, customize your widget from the [Tryly.ai Dashboard](https://www.tryly.ai/dashboard):

- Button appearance and text
- Placement options
- Color schemes
- Badge settings
- And more!

## Developer Documentation

### Hooks and Filters

#### Load widget on custom pages:
```php
add_filter( 'tryly_load_widget', function( $load ) {
    if ( is_page( 'custom-page' ) ) {
        return true;
    }
    return $load;
} );
```

#### Modify product data sent to widget:
```php
add_filter( 'tryly_product_data', function( $data, $product ) {
    $data['customField'] = get_post_meta( $product->get_id(), 'custom_field', true );
    return $data;
}, 10, 2 );
```

### API Endpoints

The plugin communicates with the following Tryly.ai API endpoints:

- OAuth Connection: `https://www.tryly.ai/connect/wordpress`
- Widget Settings: `https://www.tryly.ai/api/widget/settings`
- Dashboard: `https://www.tryly.ai/dashboard`

## Support

- 📚 [Documentation](https://www.tryly.ai/docs)
- 💬 [Support](https://www.tryly.ai/support)
- 🐛 [Report Issues](https://github.com/tryly-ai/wordpress-plugin/issues)

## Changelog

### 1.0.0
- Initial release
- One-click OAuth connection
- Automatic widget injection
- Dashboard synchronization
- WooCommerce compatibility

## License

This plugin is licensed under the GPL v2 or later.

---

Made with ❤️ by [Tryly.ai](https://www.tryly.ai)