Glue API - Store feature integration
Edit on GitHubInstall feature API
Prerequisites
To start feature integration, overview and install the necessary features:
Name | Version |
---|---|
Spryker Core | 2018.12.0 |
1) Install the required modules using Composer
Run the following command to install the required modules:
composer require spryker/stores-rest-api:"^1.0.2" --update-with-dependencies
Verification
Make sure that the following module is installed:
Module | Expected directory |
---|---|
StoresRestApi |
vendor/spryker/stores-rest-api |
2) Set up Transfer objects
Run the following command:
console transfer:generate
Verification
Make sure that the following changes are present in the transfer objects:
Transfer | Type | Event | Path |
---|---|---|---|
StoresRestAttributesTransfer |
class | created | src/Generated/Shared/Transfer/StoresRestAttributesTransfer |
StoreCountryRestAttributesTransfer |
class | created | src/Generated/Shared/Transfer/StoreCountryRestAttributesTransfer |
StoreRegionRestAttributesTransfer |
class | created | src/Generated/Shared/Transfer/StoreRegionRestAttributesTransfer |
StoreLocaleRestAttributesTransfer |
class | created | src/Generated/Shared/Transfer/StoreLocaleRestAttributesTransfer |
StoreCurrencyRestAttributesTransfer |
class | created | src/Generated/Shared/Transfer/StoreCurrencyRestAttributesTransfer |
3) Set up behavior
Enable resource
Activate the following plugin:
Plugin | Specification | Prerequisites | Namespace |
---|---|---|---|
StoresResourceRoutePlugin |
Registers orders resource. | None | Spryker\Glue\StoresRestApi\Plugin |
<?php
namespace Pyz\Glue\GlueApplication;
use Spryker\Glue\GlueApplication\GlueApplicationDependencyProvider as SprykerGlueApplicationDependencyProvider;
use Spryker\Glue\StoresRestApi\Plugin\StoresResourceRoutePlugin;
class GlueApplicationDependencyProvider extends SprykerGlueApplicationDependencyProvider
{
/**
* @return \Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceRoutePluginInterface[]
*/
protected function getResourceRoutePlugins(): array
{
return [
new StoresResourceRoutePlugin(),
];
}
}
...
Verification
Make sure that following endpoint is available:`http://mysprykershop.com/stores`
Thank you!
For submitting the form