# Server Exports

**1. `exports('ToggleShop', function(shopId, disabled)`**

**Description**:\
This function is used to toggle the availability of a shop. By passing a `shopId` and a boolean `disabled` parameter, you can enable or disable a shop on your server.

* **Arguments**:
  * `shopId` (string): The unique identifier for the shop you want to enable or disable. Example: `'shop_1'`, `'shop_2'`.
  * `disabled` (boolean): A flag that determines whether the shop should be enabled or disabled:
    * `true` – disables the shop.
    * `false` – enables the shop.

```lua
exports['koja-shops']:ToggleShop('shop_1', true)   -- Disables shop with ID 'shop_1'
exports['koja-shops']:ToggleShop('shop_2', false)  -- Enables shop with ID 'shop_2'
```

***

**2. `exports('ToggleProduct', function(shopId, productId, disabled)`**

**Description**:\
This function is used to toggle the availability of a specific product within a shop. By passing a `shopId`, a `productId`, and a boolean `disabled` parameter, you can enable or disable specific products for sale in a shop.

* **Arguments**:
  * `shopId` (string): The unique identifier for the shop where the product is located (e.g., `'shop_1'`, `'shop_2'`).
  * `productId` (string): The unique identifier for the product you want to enable or disable (e.g., `'garden_shovel'`, `'fishing_rod'`).
  * `disabled` (boolean): A flag that determines whether the product should be enabled or disabled:
    * `true` – disables the product.
    * `false` – enables the product.

```lua
exports['koja-shops']:ToggleProduct('shop_1', 'garden_shovel', true)  -- Disables product 'garden_shovel' in 'shop_1'
exports['koja-shops']:ToggleProduct('shop_1', 'burger', false)       -- Enables product 'burger' in 'shop_1'
```

## Related pages

- [Changing Language](/new/shops/configuration/changing-language) — Explanation of the locale configuration in the script
- [Target](/new/shops/configuration/target) — Target Configuration
- [Adding a Shop](/new/shops/configuration/adding-a-shop) — How to Add New Shops
- [SQL](/new/shops/configuration/sql) — SQL file needed when automatic database creation does not work properly
- [Configuration](/new/shops/configuration) — back to the section overview
