PHP code example of valantic-spryker-eco / firstspirit-bridge-api

1. Go to this page and download the library: Download valantic-spryker-eco/firstspirit-bridge-api 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/ */

    

valantic-spryker-eco / firstspirit-bridge-api example snippets


$firstSpiritSpaHost = 'www.frontend.de';
$config[FirstSpiritApiConstants::IS_FIRST_SPIRIT_API_DEBUG_ENABLED] = false;
$config[FirstSpiritApiConstants::PAGING_SIZE] = 10;
$config[FirstSpiritApiConstants::FIRST_SPIRIT_SPA_URL] = ($backofficePort === 80 ? 'http://' : 'https://') . $firstSpiritSpaHost;



namespace Pyz\Zed\EventDispatcher;

use Spryker\Zed\EventDispatcher\EventDispatcherDependencyProvider as SprykerEventDispatcherDependencyProvider;
use ValanticSpryker\Zed\FirstSpiritApi\Communication\Plugin\EventDispatcher\FirstSpiritApiControllerEventDispatcherPlugin;

class EventDispatcherDependencyProvider extends SprykerEventDispatcherDependencyProvider
{
    [...]

    /**
         * @return array<\Spryker\Shared\EventDispatcherExtension\Dependency\Plugin\EventDispatcherPluginInterface>
         */
        protected function getBackendApiEventDispatcherPlugins(): array
        {
            return [
                [...]
                new FirstSpiritApiControllerEventDispatcherPlugin(),
            ];
        }
}



namespace Pyz\Zed\Router;

use Spryker\Zed\Router\RouterDependencyProvider as SprykerRouterDependencyProvider;
use ValanticSpryker\Zed\FirstSpiritApi\Communication\Plugin\FirstSpiritApiRouterPlugin;

class RouterDependencyProvider extends SprykerRouterDependencyProvider
{
    [...]

    /**
     * @return array<\Spryker\Zed\RouterExtension\Dependency\Plugin\RouterPluginInterface>
     */
    protected function getBackendApiRouterPlugins(): array
    {
        return [
            [...]
            new FirstSpiritApiRouterPlugin(),
        ];
    }
}



namespace Pyz\Zed\FirstSpiritApi;

use ValanticSpryker\Zed\CategoryFirstSpiritApi\Communication\Plugin\CategoriesFirstSpiritApiResourcePlugin;
use ValanticSpryker\Zed\CmsFirstSpiritApi\Communication\Plugin\CmsFirstSpiritApiResourcePlugin;
use ValanticSpryker\Zed\FirstSpiritApi\FirstSpiritApiDependencyProvider as ValanticFirstSpiritApiDependencyProvider;
use ValanticSpryker\Zed\ProductFirstSpiritApi\Communication\Plugin\ProductsFirstSpiritApiResourcePlugin;
use ValanticSpryker\Zed\UrlResolverFirstSpiritApi\Communication\Plugin\LookUpFirstSpiritApiResourcePlugin;
use ValanticSpryker\Zed\UrlResolverFirstSpiritApi\Communication\Plugin\StoreFrontFirstSpiritApiResourcePlugin;

class FirstSpiritApiDependencyProvider extends ValanticFirstSpiritApiDependencyProvider
{
    /**
     * @return array<\ValanticSpryker\Zed\FirstSpiritApi\Communication\Plugin\FirstSpiritApiResourcePluginInterface>
     */
    protected function getApiResourcePluginCollection(): array
    {
        return [
            new CategoriesFirstSpiritApiResourcePlugin(),
            new CmsFirstSpiritApiResourcePlugin(),
            new ProductsFirstSpiritApiResourcePlugin(),
            new LookUpFirstSpiritApiResourcePlugin(),
            new StoreFrontFirstSpiritApiResourcePlugin(),
        ];
    }
}



namespace Pyz\Client\Catalog;

use Spryker\Client\Catalog\CatalogConfig as SprykerCatalogConfig;

class CatalogConfig extends SprykerCatalogConfig
{
    [...]

    /**
     * search catalog uses these values to validate product per page
     * FirstSpiritApiConstants::PAGING_SIZE should be added here as well
     *
     * @var array<int>
     */
    protected const PAGINATION_CATALOG_SEARCH_VALID_ITEMS_PER_PAGE = [10, 12, 24, 36];
}