Migration Guide - Availability

Upgrading from version 3.* to version 4.*

All Availability ui was moved to AvailabilitGui module, mostly Communication or Persistence were changed. If you have overwritten any of moved classes from those layers please change base class namespace from Availability to AvailabilityGui root.

Upgrading from version 2.* to version 3.*

With Availability version 3 we reworked how availability is calculated.

Two new tables were added.

CREATE TABLE "spy_availability_abstract"
    "id_availability_abstract" INTEGER NOT NULL,
    "abstract_sku" VARCHAR(255) NOT NULL,
    "quantity" INTEGER DEFAULT 0 NOT NULL,
    PRIMARY KEY ("id_availability_abstract"),
    CONSTRAINT "spy_availability_abstract-sku" UNIQUE ("abstract_sku")

CREATE SEQUENCE "spy_availability_pk_seq";

CREATE TABLE "spy_availability"
    "id_availability" INTEGER NOT NULL,
    "fk_availability_abstract" INTEGER NOT NULL,
    "sku" VARCHAR(255) NOT NULL,
    "quantity" INTEGER NOT NULL,
    "is_never_out_of_stock" BOOLEAN DEFAULT \'f\',
    PRIMARY KEY ("id_availability"),
    CONSTRAINT "spy_availability-sku" UNIQUE ("sku")

ALTER TABLE "spy_availability" ADD CONSTRAINT "spy_availability-fk_spy_availability_abstract"
    FOREIGN KEY ("fk_availability_abstract")
    REFERENCES "spy_availability_abstract" ("id_availability_abstract");

As this involves more than availability module, to start using it some configuration needed per module basis.

Oms version >= 4 is required. Check OMS migration to version 4 step by step guide how to migrate OMS to have new availability integrated.

Cart > 2.1 and AvailabilityCartConnector > 2.0. To have cart availability pre check. You will need to add new plugin Spryker\Zed\AvailabilityCartConnector\Communication\Plugin\CheckAvailabilityPlugin into Cart project dependency provider. Pyz\Zed\Cart\CartDependencyProvider::getCartPreCheckPlugins() which is core implementation of cart availability check.

New availability collector is required. Take it from demoshop, Pyz\Zed\Collector\Business\Storage\AvailabilityCollector, this have to be added to Pyz\Zed\Collector\CollectorDependencyProvider storage plugin stack.