PHP code example of groupone / marketplace

1. Go to this page and download the library: Download groupone/marketplace library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

groupone / marketplace example snippets


// Composer autoloader registers both your plugin classes and the Mozart-prefixed dependencies
pendencies\Groupone\Marketplace\Marketplace'::run([
    'parent_menu_slug' => 'your-menu-slug',
    'page_title'       => 'Plugin Marketplace',
    'menu_title'       => 'Marketplace',
    'menu_slug'        => 'plugin-marketplace',
    'addons_menu_slug' => 'your-addons-menu-slug', // Optional: slug for your addons page
    'addons_page_title' => 'Your Add-ons',        // Optional: page title for your addons page
    'addons_menu_title' => 'Your Add-ons',        // Optional: menu title for your addons page
    'api_url'          => 'https://example.com/marketplace.json',
    'brand'            => 'your_brand_name', // Optional: brand identifier for API filtering
    'payload'          => [                  // Optional: request body data for API payload
        'locale' => 'en_US',
        'action'     => '',
    ],
    // Optional: Explicitly set assets path if auto-detection doesn't work
    'assets_path'      => __DIR__ . '/inc/Dependencies/YourPlugin/Groupone/Marketplace/',
    'mixp_props'       => [ 'is_sandbox' => false ], // Optional: custom Mixpanel properties. 'is_sandbox' => true can be used for testing.
    'mixp_distinct_id' => '',                // Optional: distinct ID for Mixpanel tracking
    'data_consent_status' => false,          // Optional: user data consent status
]);

'\YourPlugin\Dependencies\Groupone\Marketplace\Marketplace'::run([
  'assets_path' => WP_PLUGIN_DIR . '/your-plugin/inc/Dependencies/YourPlugin/assets/'
]);