Creates a data feed. Currently only an availability CSV File SKU/Quantity.

2.0.2 2023-03-29 08:24 UTC

This package is auto-updated.

Last update: 2024-11-29 11:58:42 UTC


README

PHP from Travis config license

1. Install

    composer require fond-of-oryx/feed

2. Extend Availability Query Container in PYZ like below

namespace Pyz\Zed\Availability\Persistence;

use Spryker\Zed\Availability\Persistence\AvailabilityQueryContainer as SprykerAvailabilityQueryContainer;

/**
 * @method \Spryker\Zed\Availability\Persistence\AvailabilityPersistenceFactory getFactory()
 */
class AvailabilityQueryContainer extends SprykerAvailabilityQueryContainer implements AvailabilityQueryContainerInterface
{
    /**
     * @api
     *
     * @return \Orm\Zed\Availability\Persistence\Base\SpyAvailabilityQuery
     */
    public function queryAllAvailability()
    {
        return $this->getFactory()->createSpyAvailabilityQuery();
    }
}

3. Console

    vendor/bin/console transfer:generate

4. Register Controller

Symfony Routing

add in src/Pyz/Yves/Router/RouterDependencyProvider.php

    /**
     * @return \Spryker\Yves\RouterExtension\Dependency\Plugin\RouteProviderPluginInterface[]
     */
    protected function getRouteProvider(): array
    {
        return [
            ...
            new FeedRouteProviderPlugin(),
        ];
    }

5. Add basic auth password and user to config file for example in config_default.php

// ---------- Feed
$config[FeedConstants::FEED_USER] = 'foo';
$config[FeedConstants::FEED_PASSWORD] = 'bar';

6. Open https://[URL]/feed/availability