## Using the Cost of Goods Manager

This guide walks you through everything you can do with the Cost of Goods Manager, from basic cost entry to advanced filtering and bulk operations.

### Accessing the Cost Manager

1. Log into your WordPress admin dashboard
2. In the sidebar, navigate to Alpha Insights
3. Click Cost of Goods Manager

The Cost Manager will load, displaying your products in an easy-to-navigate table.

### Understanding the Interface

#### Statistics Cards (Top Section)

At the top, you'll see six statistics cards that provide an overview of your catalog:

- Total Products: Number of products currently visible (changes based on filters)
- With Cost Set: Products that have custom costs entered
- Without Cost: Products using default calculated costs
- Avg Margin: Your average profit margin percentage
- Stock Value (RRP): Total inventory value at retail prices
- Stock Value (Cost): Total inventory value at your cost

These update automatically as you filter products or make changes.

#### Header Buttons

In the top-right corner of the page header, you'll find two helper buttons:

- Stats: Opens a detailed statistics panel with breakdowns and insights
- Help: Opens comprehensive help documentation and calculation explanations

#### Toolbar (Controls)

Below the statistics, you'll find the toolbar with:

- Per Page selector: Choose how many products to display (25, 50, 100, or 200)
- Pagination info: Shows current page and total items
- Action buttons: Migrate From, Import CSV, and Export CSV

#### Filter Panel

The filter panel lets you narrow down which products are displayed:

- Search Products: Find by name or SKU
- Category: Filter by product category
- Supplier: Filter by supplier (if using supplier taxonomy)
- Stock Status: Show in stock, out of stock, or backorder products
- Product Type: Filter by simple, variable, or variation products
- Cost Status: Show all products, only those with costs, or only those missing costs

#### Product Table

The main table displays all your products with these columns:

- Checkbox: Select products for bulk actions
- Product: Name and thumbnail image
- RRP: Regular retail price
- Cost: Editable cost field
- Margin %: Calculated profit margin
- Profit: Per-unit profit amount
- Stock: Current stock quantity
- Actions: Quick links to edit or view product

### Adding and Updating Costs

#### Updating a Single Product Cost

1. Find the product in the table (use search or filters if needed)
2. Click in the Cost field for that product
3. The field becomes editable and shows the current cost
4. Type the new cost value (e.g., 25.50)
5. The field and row will be highlighted to show unsaved changes
6. The Margin % and Profit columns update automatically in real-time
7. Press Enter to save all changes immediately, OR continue editing other products and click the floating Save All Changes button when done

Tips:

- Use Tab to move to the next product's cost field without clicking
- If a product has no custom cost set, you'll see a placeholder showing the default calculated cost
- To remove a custom cost and revert to default, clear the field completely and press Enter
- You can edit multiple products before saving - a floating Save All Changes button appears when you have unsaved changes
- Press Escape while editing to cancel and revert to the original value

#### Understanding the Cost Field

The cost input field has some intelligent features:

Placeholder Text: If a product has no custom cost, you'll see gray text showing the default cost. This is not saved - it's just what the system calculates. Click the field to enter a custom cost.

Custom Cost: Once you enter a value, it's saved as a custom cost and displayed in black text. This overrides any default calculation.

Zero Cost: You can explicitly set a cost to $0 for digital products or free items. Type "0" and press Enter.

Empty to Clear: If you delete all text from the field and press Enter, it removes the custom cost and the product reverts to using the default calculation.

#### Keyboard Shortcuts for Speed

Use these keyboard shortcuts to update costs quickly:

- Tab: Move to next cost field
- Shift + Tab: Move to previous cost field
- Enter: Save current field and move to next
- Escape: Cancel editing and revert to original value

This lets you update dozens of products in minutes without ever touching your mouse!

### Using Filters

#### Search by Name or SKU

1. Click in the Search Products field
2. Type any part of the product name or SKU
3. Results filter automatically as you type
4. Press Enter or click elsewhere to apply the filter

Example: Searching "shirt" will show all products with "shirt" in their name.

#### Filter by Category

1. Click the Category dropdown
2. Select a category from the list
3. Table updates to show only products in that category

Use case: Your supplier increased prices for all clothing items - filter by "Clothing" category to update just those products.

#### Filter by Stock Status

1. Click the Stock Status dropdown
2. Choose: In Stock, Out of Stock, or On Backorder

Use case: Focus on in-stock products first since they're actively selling, or find out-of-stock items that might have incorrect costs.

#### Filter by Cost Status

This is one of the most useful filters:

1. Click the Cost Status dropdown
2. Select "Missing Cost" to see only products without custom costs
3. Or select "Has Cost" to see products you've already set up

Use case: When doing initial setup, filter by "Missing Cost" to see what still needs to be entered. Work through the list, adding costs until it's empty!

#### Combining Multiple Filters

You can use multiple filters simultaneously to get very specific results:

Example 1: Show only Electronics category products that are in stock and missing costs

- Category: Electronics
- Stock Status: In Stock
- Cost Status: Missing Cost

Example 2: Find all variable products from a specific supplier

- Supplier: Select supplier name
- Product Type: Variable

#### Clearing Filters

To reset all filters and see all products:

- Click the Clear button in the filter panel, OR
- Manually change each filter back to "All"

### Sorting Products

Click any column header to sort by that column:

#### Sort by Name (Default)

Click Product column header to sort alphabetically (A-Z or Z-A)

#### Sort by Price

Click RRP to sort products from lowest to highest price (or reverse). Useful for finding your premium or budget products.

#### Sort by Cost

Click Cost to see which products cost you the most or least to acquire.

#### Sort by Margin %

Click Margin % to identify:

- Lowest margin products: Might need repricing or cost reduction
- Highest margin products: Your most profitable offerings

#### Sort by Profit

Click Profit to see per-unit profit. This shows which single sale generates the most profit dollars, not percentage.

#### Sort by Stock

Click Stock to see which products you have most/least inventory of.

Sorting Tip: Click the column header once for ascending order (low to high), click again for descending (high to low).

### Exporting Costs to CSV

#### Why Export?

- Create backups of your cost data
- Analyze costs in Excel or Google Sheets
- Share with accountants or bookkeepers
- Document cost changes over time

#### How to Export

1. Apply any filters you want (or leave them all to export everything)
2. Click Export CSV button in the toolbar
3. Your browser downloads a file named "cost-of-goods-YYYY-MM-DD.csv"
4. Open in Excel, Google Sheets, or any spreadsheet program

The exported CSV includes:

- Product ID, Name, SKU, Type
- RRP (retail price)
- Custom Cost (if set) and Default Cost (calculated)
- Margin % and Profit calculations
- Stock quantity

Pro tip: Use filters before exporting to create category-specific or supplier-specific cost reports.

### Importing Costs from CSV

#### When to Import

- Setting up costs for the first time from a supplier spreadsheet
- Bulk updating costs after receiving new pricing
- Migrating costs from another system
- Restoring costs from a backup

#### CSV Format Required

Your CSV file must have these columns:

1. Product Identifier: Either Product ID or SKU
2. Cost: The cost value to set

Example CSV:

    SKU,Cost T-SHIRT-S,12.50 T-SHIRT-M,12.50 T-SHIRT-L,13.00 HAT-01,8.00

#### Import Process

1. Prepare your CSV file (or use the export as a template)
2. Click Import CSV button
3. A modal opens with import options
4. Choose identifier type:Product ID or SKU
5. Click Choose File and select your CSV
6. Review the preview (shows first few rows)
7. Click Import to process
8. Wait for confirmation (shows how many products updated)

Important Notes:

- Import processes one row at a time - large files may take a minute
- Products not found (wrong ID/SKU) will be skipped
- Existing costs are overwritten with CSV values
- Empty cost values will clear the custom cost

### Migrating from Another COGS Plugin

If you previously used a different Cost of Goods plugin, Alpha Insights can automatically copy those costs.

#### Supported Plugins

- WooCommerce Cost of Goods (SkyVerge)
- WooCommerce 10.0+ Native COGS
- ATUM Inventory Management
- Cost of Goods for WooCommerce (Algoritmika)
- YITH Cost of Goods
- Generic purchase price fields

#### Migration Steps

1. Click Migrate From button in the toolbar
2. Select the source plugin from the dropdown
3. Click Check for Data
4. - How many products have costs in the old plugin
   - Sample products that will be migrated
5. - Overwrite existing: Check this to replace any costs you've already set in Alpha Insights
   - Leave unchecked to only migrate products without costs in Alpha Insights
6. Click Start Migration
7. Wait for process to complete
8. Review confirmation showing how many products were migrated

What Happens:

- Alpha Insights copies cost values from the old plugin's meta field
- Costs are saved to Alpha Insights' cost field
- Your original plugin's data remains unchanged (safe to keep as backup)
- Order profit data is recalculated with the new costs

### Using the Statistics Panel

Click the Stats button to open a detailed statistics panel showing:

- Breakdown of products by status
- Average, minimum, and maximum margins
- Total stock value comparisons
- Cost coverage percentage

This gives you a high-level view of your catalog health and cost management progress.

### Tips for Efficient Cost Management

#### Start with High-Priority Products

1. Filter by Cost Status: Missing Cost
2. Sort by Stock(descending) to see best-sellers first
3. Add costs for your top 20-50 sellers before worrying about slow-movers

#### Use Keyboard for Speed

Once you start entering costs:

1. Click the first product's cost field
2. Type the cost and press Tab (moves to next product)
3. Type cost, Tab, type cost, Tab - you can update dozens per minute!

#### Work Category by Category

1. Filter by one category at a time
2. Update all products in that category
3. Move to the next category
4. Track progress by watching "Without Cost" stat decrease

#### Export Before Major Changes

Before bulk updates or imports:

1. Export your current costs as a backup
2. Make the changes
3. If anything goes wrong, you can re-import the backup

#### Regular Audits

Schedule monthly reviews:

1. Sort by Margin % to find low-margin products
2. Check if costs have changed from suppliers
3. Update any products with outdated costs
4. Look for outliers that might have data entry errors

### Troubleshooting

#### "Cost field won't save"

Causes:

- Invalid characters in cost (use only numbers and decimal point)
- Browser cache issue

Solution:

- Ensure you're typing only numbers (12.50, not $12.50)
- Refresh the page and try again
- Check browser console for errors (press F12)

#### "Statistics aren't updating"

Solution:

- Stats update after each save - wait a moment
- Click the Stats button to manually refresh
- Refresh the entire page if needed

#### "Products not showing"

Causes:

- Filters are applied
- Search term has no matches

Solution:

- Click Clear button to reset all filters
- Check the pagination - you might be on a later page

#### "Import failed"

Causes:

- CSV format incorrect
- Product IDs or SKUs don't match
- File encoding issues

Solution:

- Export a sample CSV from Alpha Insights to see correct format
- Verify SKUs/IDs match your actual products
- Save CSV as UTF-8 encoding