Documentation

ShopBite Plugin Configuration

After installing the ShopBite Plugin, you need to configure it to activate the gastronomy-specific functions and adapt them to your requirements.

Basic Configuration

1. Activate Plugin

  1. Open Shopware Administration
  2. Navigate to Extensions > My Extensions
  3. Find ShopBite Plugin
  4. Click Activate

2. Basic Settings

Navigate to ShopBite > Settings in the administration:

General Settings

  • Activate Plugin: Main switch for all ShopBite functions
  • Enable API Access: Allows the storefront to access ShopBite APIs
  • Debug Mode: Enables detailed logging (for development only)
  • Sales Channel Selection: Select the sales channels for which ShopBite should be active

Storefront Settings

  • Storefront URL: The URL of your ShopBite Storefront (e.g., https://Your-Storefront.de)
  • API Access Key: The key for storefront API communication
  • CORS Origin: The allowed domains for CORS (e.g., https://Your-Storefront.de)
  • API Timeout: Maximum wait time for API requests (default: 30 seconds)

Business Hours Management

1. Set Up Business Hours

  1. Navigate to ShopBite > Business Hours
  2. Click Add New Business Hours
  3. Configure the following fields:

Business Hours Fields

FieldDescriptionExample
Sales ChannelSelect sales channel"My Restaurant"
Day of WeekDay of the week (0=Sunday, 1=Monday, etc.)1 (Monday)
Opening TimeOpening time in HH:MM format11:00
Closing TimeClosing time in HH:MM format22:00
ClosedMark day as closed

Example Configuration

Monday: 11:00 - 22:00
Tuesday: 11:00 - 22:00
Wednesday: Closed
Thursday: 11:00 - 23:00
Friday: 11:00 - 00:00
Saturday: 12:00 - 00:00
Sunday: 12:00 - 22:00

2. Special Opening Hours

For special occasions or seasonal changes:

  1. Navigate to ShopBite > Business Hours > Special Opening Hours
  2. Click Add New Special Opening Hours
  3. Configure the following fields:

Special Opening Hours Fields

FieldDescriptionExample
Sales ChannelSelect sales channel"My Restaurant"
DateDate of special opening24.12.2024
Opening TimeSpecial opening time10:00
Closing TimeSpecial closing time14:00
DescriptionOptional description"Christmas Eve - shortened hours"

3. API Query

Business hours can be retrieved via the Store API:

# API Endpoint
GET /store-api/shopbite/business-hour

# Example Response
{
  "data": [
    {
      "dayOfWeek": 1,
      "openingTime": "11:00",
      "closingTime": "22:00",
      "salesChannelId": "019a36f224b0704fb6835914050392f4"
    },
    {
      "dayOfWeek": 2,
      "openingTime": "11:00",
      "closingTime": "22:00",
      "salesChannelId": "019a36f224b0704fb6835914050392f4"
    }
  ]
}

Holiday Management

1. Set Up Holidays

  1. Navigate to ShopBite > Holidays
  2. Click Add New Holiday
  3. Configure the following fields:

Holiday Fields

FieldDescriptionExample
NameName of the holiday"Christmas"
Start DateBeginning of closure24.12.2024 18:00
End DateEnd of closure26.12.2024 23:59
Sales ChannelSelect sales channel"My Restaurant"
Recur AnnuallyRepeat holiday annually
DescriptionOptional description"Christmas holidays"

Example Holidays

New Year's Day: 01.01.2024 00:00 - 01.01.2024 23:59
Good Friday: 29.03.2024 00:00 - 29.03.2024 23:59
Easter Monday: 01.04.2024 00:00 - 01.04.2024 23:59
Labor Day: 01.05.2024 00:00 - 01.05.2024 23:59
Christmas: 24.12.2024 18:00 - 26.12.2024 23:59

2. Recurring Holidays

For annually recurring holidays:

  1. Enable Recur Annually
  2. Select Month and Day
  3. Enter Name (e.g., "Christmas")
  4. Define Period (e.g., 24.12. - 26.12.)

3. API Query

Holidays can be retrieved via the Store API:

# API Endpoint
GET /store-api/shopbite/holiday

# Example Response
{
  "data": [
    {
      "id": "019a36f224b0704fb6835914050392f4",
      "start": "2024-12-24T18:00:00+01:00",
      "end": "2024-12-26T23:59:00+01:00",
      "salesChannelId": "019a36f224b0704fb6835914050392f4",
      "name": "Christmas",
      "description": "Christmas holidays"
    }
  ]
}

Checkout Extensions

1. Order Types

ShopBite supports different order types:

  • Pickup: Customers pick up the order themselves
  • Delivery: Order is delivered
  • On Site: Order for immediate consumption on site

Configure the available order types under ShopBite > Checkout > Order Types

2. Time Windows for Orders

Set how far in advance orders can be placed:

  • Minimum Lead Time: 15 minutes (default)
  • Maximum Lead Time: 7 days (default)
  • Time Window Interval: 15 minutes (default)

3. Receipt Print Types

The plugin supports different receipt print types for products:

  1. Configure Custom Fields:
    • Navigate to Settings > Custom Fields
    • Select ShopBite Product Set
    • Configure Receipt Print Type for products
  2. Print Types:
    • Standard: Normal receipt print
    • Kitchen: Kitchen receipt for preparation
    • Bar: Bar receipt for drinks
    • No Print: No receipt print required

4. Delivery Time Factors

Configure delivery time factors for products:

  • Standard Delivery Time: 30 minutes (configurable)
  • Product-Specific Factors: Multiplier for standard time
  • Example: Pizza (factor 2) = 60 minutes delivery time

API Configuration

1. Set Up API Access

  1. Navigate to Settings > System > Integrations
  2. Click Add Integration
  3. Configure the following settings:

API Integration Settings

FieldValueDescription
NameShopBite StorefrontName of the integration
DescriptionAPI access for ShopBiteDescription
Permissionsorder:read, order:write, product:readRequired API permissions
Access TypeAdmin IntegrationFull API access

2. Set Up Webhooks

For real-time updates:

  1. Navigate to Settings > System > Webhooks
  2. Click Add Webhook
  3. Configure the following webhooks:
EventURLDescription
order.state.changedhttps://Your-Storefront.de/api/webhooks/order-statusOrder status changes
order.createdhttps://Your-Storefront.de/api/webhooks/order-createdNew orders
product.changedhttps://Your-Storefront.de/api/webhooks/product-changedProduct changes

3. CORS Configuration

Configure CORS for the storefront:

# In .env or configuration
SHOPWARE_CORS_ALLOW_ORIGIN="https://Your-Storefront.de"
SHOPWARE_CORS_ALLOW_METHODS="GET, POST, PUT, DELETE, OPTIONS"
SHOPWARE_CORS_ALLOW_HEADERS="Authorization, Content-Type, sw-access-key"

Advanced Settings

1. Performance Optimization

  • Cache TTL: 3600 seconds (default)
  • API Rate Limiting: 100 requests per minute (default)
  • Database Index Optimization: Enabled (recommended)

2. Logging

  • Log Level: Info (default), Debug (for development)
  • Log Rotation: Daily (default)
  • Maximum Log Size: 100MB (default)

3. Database Optimization

-- Indexes for ShopBite tables
ALTER TABLE `shopbite_business_hour` ADD INDEX `idx_sales_channel` (`sales_channel_id`);
ALTER TABLE `shopbite_holiday` ADD INDEX `idx_sales_channel` (`sales_channel_id`);

-- Optimization for frequent queries
ALTER TABLE `shopbite_business_hour` ADD INDEX `idx_day_of_week` (`day_of_week`);
ALTER TABLE `shopbite_holiday` ADD INDEX `idx_date_range` (`start`, `end`);

Troubleshooting

Common Issues

Problem: API Connection Failed

Symptoms:

  • "Connection refused" error
  • API endpoints not reachable

Solutions:

# Check API credentials
bin/console integration:list

# Check CORS settings
bin/console config:get Shopware.Core.SystemConfig.corsAllowOrigin

# Check firewall settings
sudo ufw status

Problem: Business Hours Not Displayed

Symptoms:

  • API returns empty results
  • Business hours not visible

Solutions:

# Clear cache
bin/console cache:clear

# Check database
mysql -u shopware -p shopware -e "SELECT * FROM shopbite_business_hour;"

# Check Sales Channel ID
bin/console sales-channel:list

Problem: Holidays Not Considered

Symptoms:

  • Orders possible on holidays
  • Holidays not visible in API

Solutions:

# Check holiday data
mysql -u shopware -p shopware -e "SELECT * FROM shopbite_holiday;"

# Check time format
bin/console database:check-timezone

# Test API query
curl -X GET "https://Your-Domain.de/store-api/shopbite/holiday" -H "Authorization: Bearer YourToken"

Problem: Checkout Extensions Not Working

Symptoms:

  • Receipt print types ignored
  • Delivery time calculation incorrect

Solutions:

# Check custom fields
bin/console custom-field:set:list

# Clear plugin cache
bin/console plugin:refresh ShopBite

# Check checkout processor
bin/console debug:container --tag=shopware.checkout.cart.processor

Next Steps