# Shortcodes & Action Hooks

Bizzwishlist provides several shortcodes and action hooks that let you place wishlist elements anywhere on your site. This is a complete reference for all available shortcodes and hooks.

## Shortcodes

### [bizzwishlist]

Displays the **full wishlist page** with a product table, actions, and sharing options.

**Usage:**
```
[bizzwishlist]
```

**Features:**
- Product image, name, price, and stock status
- Checkbox selection for bulk actions
- Per-item "Add to Cart" and "Remove" buttons
- "Add Selected to Cart" and "Add All to Cart" bulk actions
- Share button (when sharing is enabled)

**Best for:** A dedicated wishlist page.

---

### [bizzwishlist_mini]

Displays the **mini wishlist widget** — a compact, collapsible view of the wishlist.

**Usage:**
```
[bizzwishlist_mini]
```

**Features:**
- Heart icon with count badge
- Expandable product list with thumbnails
- Link to full wishlist page
- Lightweight AJAX-loaded content

**Best for:** Sidebars, widget areas, headers, or any area where a compact view is preferred.

---

### [bizzwishlist_button]

Displays the **"Add to Wishlist" button** for a product.

**Usage:**
```
[bizzwishlist_button]
```

When used inside a WooCommerce product loop or on a single product page, it automatically detects the current product.

**With a specific product ID:**
```
[bizzwishlist_button product_id="123"]
```

**Attributes:**

| Attribute | Required | Description |
|-----------|----------|-------------|
| `product_id` | No | The WooCommerce product ID. If omitted, uses the current product in the loop. |

**Best for:** Custom page layouts, page builders, or anywhere you want to manually place the wishlist button.

---

## Action Hooks

Action hooks allow developers to display wishlist elements directly in PHP theme templates.

### bizzwishlist_button

Display the wishlist button in your theme templates.

```php
<?php
// Display for the current product (inside a WooCommerce loop)
do_action( 'bizzwishlist_button' );

// Display for a specific product ID
do_action( 'bizzwishlist_button', 123 );
?>
```

### bizzwishlist_button_show

Alternative hook with the same behavior as `bizzwishlist_button`.

```php
<?php
do_action( 'bizzwishlist_button_show', 123 );
?>
```

## Examples

### Add Wishlist Button to a Custom Location

If you want the button in a specific location in your theme, set the button position to **"None"** in settings, then use the action hook in your template:

```php
<!-- In your theme's single-product template -->
<div class="my-custom-section">
    <h3>Save for Later</h3>
    <?php do_action( 'bizzwishlist_button' ); ?>
</div>
```

### Add Mini Wishlist to the Header

Place the mini wishlist shortcode in your theme's header widget area or directly in the header template:

```php
<!-- In your theme's header.php -->
<div class="header-wishlist">
    <?php echo do_shortcode( '[bizzwishlist_mini]' ); ?>
</div>
```

### Display Wishlist Button for Specific Products on a Custom Page

```
Check out our favorites:

[bizzwishlist_button product_id="42"]
[bizzwishlist_button product_id="99"]
[bizzwishlist_button product_id="156"]
```
