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

1.0.0 2021-05-03 14:41 UTC

This package is auto-updated.

Last update: 2021-12-02 14:49:51 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