# Factorize Perks — Quickstart

Five minutes from upload to your first perked-up member. Factorize Perks adds a paid-member flag to WooCommerce: check one box on a user's profile and they get a cart discount, a flat-rate shipping credit, and stop seeing the "join us" pitch.

## Prerequisites

- WordPress 6.2+ and PHP 7.4+
- **WooCommerce active** — the discount, shipping credit, and product-page pitch all run on WooCommerce hooks; without it the plugin only defines its helper functions
- A **Flat rate** shipping method configured, if you want the shipping credit to have something to reduce
- A way to collect the membership fee yourself (in store, invoice, phone) — 1.0.0 has no billing; Stripe subscription billing is on the roadmap

## Install

1. Copy the `factorize-perks` folder into `wp-content/plugins/` (or upload the zip via **Plugins → Add New → Upload Plugin**).
2. Activate **Factorize Perks**.
3. A **Factorize** menu appears in the admin sidebar — Perks shows as a card on the **Customers** tab with the live discount and shipping credit values.

## First value in four steps

1. **Flag a member.** Go to **Users**, edit a customer, check **Paid member**, save. (The checkbox is visible to anyone with the `manage_woocommerce` capability.)
2. **See the discount.** Log in as that customer and add anything to the cart — a **Member discount (5%)** line appears as a negative fee against the subtotal.
3. **See the shipping credit.** Proceed toward checkout: the flat-rate cost drops by $10 (floored at $0) and the label switches to "Shipping — free for members (up to $10)" or "Shipping — $10 member discount applied".
4. **See the pitch.** Log out and view an auction-type product page — non-members get a one-line perks nudge linking to My Account ("Join free →" for visitors, "Ask about upgrading →" for logged-in free members).

## Configuration

Values are read through `empire_perks_config( $key )`.

| Key | Default | Effect |
| --- | --- | --- |
| `discount_pct` | `5` | Percent off the cart subtotal for paid members. Drives the fee amount and the number in the "Member discount (5%)" fee label. |
| `shipping_credit` | `10` | Dollars subtracted from each flat-rate shipping cost for paid members (floored at $0). Drives the cap in the rate math and the number in both shipping labels. |

Override any key by saving an array to the `factorize-perks_options` option (the legacy `empire-membership-perks_options` option is still read as a fallback), or by hooking the `factorize-perks_config` filter:

```php
update_option( 'factorize-perks_options', array( 'discount_pct' => 10 ) );
// or
add_filter( 'factorize-perks_config', fn( $c ) => array_merge( $c, array( 'shipping_credit' => 15 ) ) );
```

There is no settings screen in 1.0.0 — configuration is by option or filter only.

## Troubleshooting

- **Changed the config but the storefront still says 5% / $10.** The fee amount, fee label, and shipping labels all follow your config — but the product-page pitch and the profile checkbox description are fixed copy in 1.0.0 and keep reading "5%" and "$10". Update your config and expect those two strings to lag until a future release.
- **Shipping credit not applying.** The credit only touches rates whose method is **Flat rate** (`flat_rate`) — free shipping, local pickup, table rates, and carrier methods pass through untouched. Also confirm the shopper is logged in and flagged as a paid member.
- **No pitch on product pages.** The nudge renders only on products whose type is `auction` (an auction plugin such as Factorize Auction Engine provides that type) and only for users who are not paid members. Simple products and paid members never see it. It also mentions points and exclusive offers — points earning/redemption comes from a separate points plugin (the original store pairs it with Points and Rewards for WooCommerce), not from Factorize Perks.
