# Template1 - Single Product Layout

This template provides a complete single product layout with variable product support.

## Files Structure

- **template1Markup.php** - Main template markup and HTML structure
- **template1-frontend.js** - Frontend JavaScript functionality including:
  - Quantity selector controls (+/- buttons)
  - Variable product AJAX handling
  - Form validation and submission
  - Success/error notifications
- **template1-ajax-handler.php** - Backend AJAX handler for variable products
- **template1Style.php** - CSS styles for the template
- **template1-settings.php** - Template configuration and settings

## Variable Product Functionality

The template includes complete variable product support:

1. **Quantity Controls**: +/- buttons with validation
2. **AJAX Add to Cart**: No page reload when adding products
3. **Proper Quantity Handling**: Respects WooCommerce quantity merging
4. **Success Notifications**: Shows feedback after adding to cart
5. **Error Handling**: Graceful error management

## AJAX Handler

The `template1-ajax-handler.php` file contains:
- Security nonce verification
- WooCommerce cart initialization
- Quantity validation and processing
- Cart fragment updates
- Error handling and logging

## Integration

The template is automatically loaded when Template1 is selected as the active single product layout. All functionality is self-contained within this template folder.