## Livewire Cart Debug Checklist

Open your browser and test these steps:

### 1. Check Browser Console
Open DevTools (F12) → Console tab
- Look for any **red errors** when you click "Add to Cart"
- Look for Livewire-related errors on page load

### 2. Check Network Tab
Open DevTools (F12) → Network tab
- Click "Add to Cart" button
- Look for a request to `/livewire/update`
- If you see it: check the response (should be 200 OK)
- If you DON'T see it: Livewire isn't initializing

### 3. Verify Livewire is Loaded
In browser console, type:
```javascript
typeof Livewire
```
Should return `"object"`, not `"undefined"`

### 4. Check if Component is Wired
In browser console, type:
```javascript
document.querySelector('[wire\\:id]')
```
Should return a DOM element. If null, Livewire component isn't rendering.

### 5. Test Wire Click
Right-click the "Add to Cart" button → Inspect
- Check if button has `wire:id` attribute on a parent element
- Check if button has the `wire:click` attribute visible

### 6. Simple Test
Add this to a test page to verify basic Livewire works:
```php
<button wire:click="$refresh">Test Livewire</button>
```
If this works but add-to-cart doesn't, the issue is in the method itself.

### Common Fixes

**If Livewire is undefined:**
- Run `npm run build` again
- Clear browser cache (Ctrl+Shift+R)
- Check that @livewireScripts is in layout

**If wire:click doesn't fire:**
- Make sure you're logged in (auth check might be blocking)
- Check for JavaScript errors blocking execution
- Verify the Livewire component is the parent of the button

**If request fires but fails:**
- Check Laravel logs: `tail -f storage/logs/laravel.log`
- Check for database errors
- Verify CSRF token is present
