Installing Botoscope on your WooCommerce store

Once you’ve created your bot, follow these steps to connect your WooCommerce site to Botoscope:

πŸ›  Step 1: Edit your wp-config.php file

On your server, open the wp-config.php file of your WordPress installation and add the following lines before the line:

/* That's all, stop editing! Happy publishing. */

Use the following code (example values shown):

define('BOTOSCOPE_BOT_TOKEN', '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11');
define('BOTOSCOPE_BOT_NAME', 'myshop_bot');
define('BOTOSCOPE_PROXY_SERVER', 'https://c12-t2hx7w.s2.botoscope.com');
define('BOTOSCOPE_CLIENT_API_KEY', 'bs-4a83c23c-7410ebfa-ac4z2ba3-b42c4a3f');
define('BOTOSCOPE_CLIENT_PASS', '6Jw6rzVxfdjwBEMtxtl');
define('BOTOSCOPE_ADMIN_CHAT_ID', 1234567890);
βœ… Where to find this data?
After activating your bot in the Botoscope system, you will see all required credentials (token, username, proxy server, API key, and client pass) directly in your dashboard.
Just copy them and paste into your wp-config.php file.

πŸ”€ Database Charset Configuration (Critical for Emoji Support)

🚨 CRITICAL: To ensure proper emoji support in your WooCommerce store (required for Telegram communication), you MUST verify your database charset configuration in wp-config.php

⚠️ The Problem

Many WordPress installations still use the old utf8 charset, which does NOT support emojis. This will cause:

  • ❌ Emojis being stripped from product names/descriptions
  • ❌ Database errors when saving emoji content
  • ❌ Orders failing to create in Telegram
  • ❌ Product sync failures between WooCommerce and Telegram

βœ… The Solution

Open your wp-config.php file and locate these lines (usually near the database settings):

❌ WRONG (old format - does NOT support emojis):
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Change them to:

βœ… CORRECT (supports emojis):
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', 'utf8mb4_unicode_ci');
⚠️ Already have these lines defined?
If you see a warning like Constant DB_CHARSET already defined, these constants are already set in your wp-config.php. Simply find and update the existing values – do NOT add duplicate lines.

βœ… Important Notes:

  • Make this change BEFORE installing Botoscope for best results
  • Do NOT skip the DB_COLLATE setting – both lines are required
  • After changing, go to Botoscope β†’ System Controls and click “Reset full bot data cache”
πŸ’‘ Already installed Botoscope with wrong charset?
If you’ve already been using Botoscope with utf8 charset, you’ll need to convert your existing database tables. See the “Database Encoding Configuration” section below for conversion methods.

πŸ“¦ Step 2: Install the Botoscope plugin

  1. Log into your WordPress admin panel.
  2. Go to Plugins β†’ Add New.
  3. Upload the Botoscope plugin ZIP file.
  4. Click Install Now, then Activate.

βš™οΈ Step 3: Run initial configuration

  1. In the WordPress admin panel, go to Botoscope β†’ System Controls.
  2. Click the button β€œReset full bot data cache”.
  3. Wait a ~ minute β€” the site will be synchronized with your Telegram store

βœ… You’re done!

Your shop is now connected to the Telegram

You can now:

  • Manage your products
  • Configure payment systems
  • Control categories and pricing
  • And much more β€” based on your business needs

πŸ”§ Additional Features & Recommendations

🧩 Product Filtering

If you want to add advanced product filtering, install the
HUSKY – WooCommerce Products Filter Professional plugin:
πŸ”— https://products-filter.com/downloads

πŸ’± Currency Switching

If you want your customers to switch between currencies, install the
FOX – WooCommerce Currency Switcher Professional plugin:
πŸ”— https://currency-switcher.com/downloads

πŸ“„ PDF Invoice Download for Customers

If you want customers to be able to download PDF invoices from the order page or email, install the plugin:
πŸ”— WooCommerce PDF Invoices & Packing Slips

After installation, go to wp-admin/admin.php?page=wpo_wcpdf_options_page β†’ Advanced tab and apply the following settings:

  1. Document link access type β†’ Full
  2. Pretty document links β†’ Yes
  3. In tab Tools β†’ Generate random temporary directory

After you have installed one or all of the recommended plugins, go to the Botoscope settings, open the System Controls tab, and click the “Reset full bot data cache” button.


πŸ”€ Database Encoding Configuration (For Emoji Support)

⚠️ Important: If you notice that product names with emojis (like πŸ’…, 🎨, ✨) are not saving correctly or orders are not being created, you need to convert your database tables to UTF-8mb4 encoding.

🎯 Choose Your Method:

We offer three easy ways to fix the encoding. Choose the one that works best for you:

  • Method 1: One-Click Plugin (Easiest!) πŸŽ‰
  • Method 2: PHP Code (For developers) πŸ’»
  • Method 3: Direct SQL (Most control) πŸ”§

✨ Method 1: One-Click Plugin (Recommended for Beginners)

This is the easiest method – just install a plugin and click one button!

  1. In WordPress admin, go to Plugins β†’ Add New
  2. Search for “WP phpMyAdmin Extension”
  3. Install and activate the plugin: WP phpMyAdmin Extension
  4. Go to Tools β†’ phpMyAdmin in WordPress admin
  5. Click on the SQL tab
  6. Copy and paste the SQL commands from Method 3 below
  7. Click Go
βœ… Advantage: No need to leave WordPress admin panel – everything is done inside your familiar dashboard!

πŸ’» Method 2: One-Time PHP Code

If you’re comfortable editing PHP files, this method executes the conversion automatically when you load a page.

🚨 Important: Make sure to backup your database before running this code!

Option A: Via WordPress functions.php (Temporary)

  1. Go to Appearance β†’ Theme File Editor
  2. Open functions.php (right sidebar)
  3. Add this code at the very end of the file:
// TEMPORARY: Convert database to UTF8MB4
// DELETE THIS CODE AFTER RUNNING ONCE!
add_action('admin_init', function() {
    if (!get_option('botoscope_db_converted_utf8mb4')) {
        global $wpdb;
        
        $prefix = $wpdb->prefix;
        
        // WooCommerce tables
        $tables = [
            'woocommerce_order_items',
            'woocommerce_order_itemmeta',
            'woocommerce_payment_tokens',
            'woocommerce_payment_tokenmeta',
            'woocommerce_sessions',
            'woocommerce_shipping_zones',
            'woocommerce_shipping_zone_locations',
            'woocommerce_shipping_zone_methods',
            'woocommerce_tax_rates',
            'woocommerce_tax_rate_locations',
        ];
        
        // Botoscope tables
        $botoscope_tables = [
            'botoscope_advertising',
            'botoscope_booking_reservations',
            'botoscope_booking_slots',
            'botoscope_booking_slots_targeted',
            'botoscope_broadcast',
            'botoscope_controls',
            'botoscope_elogios',
            'botoscope_extensions',
            'botoscope_interface_translations',
            'botoscope_marketing_campaigns',
            'botoscope_marketing_campaigns_products',
            'botoscope_marketing_campaigns_products_excluded',
            'botoscope_marketing_campaigns_terms',
            'botoscope_marketing_strategies',
            'botoscope_marketing_strategies_formulas',
        ];
        
        $all_tables = array_merge($tables, $botoscope_tables);
        
        foreach ($all_tables as $table) {
            $full_table = $prefix . $table;
            $wpdb->query("ALTER TABLE {$full_table} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
        }
        
        update_option('botoscope_db_converted_utf8mb4', time());
        
        echo ''; } });

βœ… Database successfully converted to UTF8MB4! You can now delete the code from functions.php

  1. Click Update File
  2. Go to any page in WordPress admin (like Dashboard)
  3. You’ll see a success message when conversion is complete
  4. IMPORTANT: Go back to functions.php and DELETE the code you just added

Option B: Via Standalone PHP File

  1. Create a new file called convert-db.php in your WordPress root directory
  2. Paste this code into the file:
<?php
// Load WordPress
require_once('wp-load.php');

if (!current_user_can('manage_options')) {
    die('Access denied');
}

global $wpdb;
$prefix = $wpdb->prefix;

echo '<h1>Converting Database to UTF8MB4...</h1>';

// WooCommerce tables
$tables = [
    'woocommerce_order_items',
    'woocommerce_order_itemmeta',
    'woocommerce_payment_tokens',
    'woocommerce_payment_tokenmeta',
    'woocommerce_sessions',
    'woocommerce_shipping_zones',
    'woocommerce_shipping_zone_locations',
    'woocommerce_shipping_zone_methods',
    'woocommerce_tax_rates',
    'woocommerce_tax_rate_locations',
];

// Botoscope tables
$botoscope_tables = [
    'botoscope_advertising',
    'botoscope_booking_reservations',
    'botoscope_booking_slots',
    'botoscope_booking_slots_targeted',
    'botoscope_broadcast',
    'botoscope_controls',
    'botoscope_elogios',
    'botoscope_extensions',
    'botoscope_interface_translations',
    'botoscope_marketing_campaigns',
    'botoscope_marketing_campaigns_products',
    'botoscope_marketing_campaigns_products_excluded',
    'botoscope_marketing_campaigns_terms',
    'botoscope_marketing_strategies',
    'botoscope_marketing_strategies_formulas',
];

$all_tables = array_merge($tables, $botoscope_tables);

foreach ($all_tables as $table) {
    $full_table = $prefix . $table;
    
    echo "Converting {$full_table}... ";
    
    $result = $wpdb->query("ALTER TABLE {$full_table} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
    
    if ($result !== false) {
        echo '<span style="color: green;">βœ… Success</span><br>';
    } else {
        echo '<span style="color: red;">❌ Failed: ' . $wpdb->last_error . '</span><br>';
    }
}

echo '<h2 style="color: green;">βœ… Conversion Complete!</h2>';
echo '<p><strong>IMPORTANT:</strong> Delete this file (convert-db.php) from your server now!</p>';
?>
  1. Upload the file to your WordPress root directory (where wp-config.php is located)
  2. Open your browser and go to: https://yoursite.com/convert-db.php
  3. Wait for the conversion to complete
  4. IMPORTANT: Delete the convert-db.php file from your server!
βœ… Advantage: You can see the conversion progress in real-time and spot any errors immediately.

πŸ”§ Method 3: Direct SQL in phpMyAdmin

This is the most direct method if you’re comfortable using phpMyAdmin.

πŸ“‹ Step-by-step instructions:

  1. Log into your hosting control panel (cPanel, Plesk, etc.)
  2. Open phpMyAdmin
  3. Select your WordPress database from the left sidebar
  4. Click on the SQL tab at the top
  5. Copy and paste the SQL commands below
  6. Click Go to execute

πŸ’‘ Note about table prefix: The commands below use wp_ as the table prefix. If your WordPress installation uses a different prefix (like wpdb_ or wp123_), you need to replace wp_ with your actual prefix in all commands below.

To find your prefix, look at the table names in phpMyAdmin – they all start with the same prefix.

-- Convert WooCommerce tables
ALTER TABLE wp_woocommerce_order_items CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_order_itemmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_payment_tokens CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_payment_tokenmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_sessions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_shipping_zones CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_shipping_zone_locations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_shipping_zone_methods CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_tax_rates CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_woocommerce_tax_rate_locations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert Botoscope tables
ALTER TABLE wp_botoscope_advertising CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_booking_reservations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_booking_slots CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_booking_slots_targeted CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_broadcast CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_controls CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_elogios CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_extensions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_interface_translations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_campaigns CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_campaigns_products CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_campaigns_products_excluded CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_campaigns_terms CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_strategies CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_botoscope_marketing_strategies_formulas CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert core WordPress tables (optional but recommended)
ALTER TABLE wp_posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_postmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_comments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_commentmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_terms CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_term_taxonomy CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_term_relationships CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_termmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_usermeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_options CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wp_links CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
βœ… Advantage: Most direct and reliable method. Works on any hosting provider that provides phpMyAdmin access.

βœ… After Conversion (All Methods):

  1. Go to Botoscope β†’ System Controls in your WordPress admin
  2. Click “Reset full bot data cache”
  3. Test creating an order with emoji in product name – it should work now! ✨
βœ… Good to know: This conversion is safe and will not affect your existing data. It only changes how the database stores text characters, allowing it to support emojis and special characters from all languages.
🚨 If you get an error: Some very old hosting providers may not support UTF-8mb4 encoding. In this case, Botoscope will automatically work in compatibility mode – emojis will be removed from product names, but everything else will function normally.
⚠️ Note: If you get an error “Table doesn’t exist”, just skip that command and continue with the next one. This happens when certain Botoscope modules are not installed on your site.
0
Awesome! 
Error!