diff --git a/docs/api/customers.rst b/docs/api/customers.rst index 0a6f0fec322..29a5d484602 100644 --- a/docs/api/customers.rst +++ b/docs/api/customers.rst @@ -53,7 +53,7 @@ If you request for a more detailed data, you will receive an object with followi +-------------------------+-------------------------------------------+ | birthday | Customers birthday | +-------------------------+-------------------------------------------+ -| groups | Array of groups customer belongs to | +| group | Customer group code | +-------------------------+-------------------------------------------+ .. note:: @@ -81,7 +81,7 @@ Definition +--------------------------+----------------+------------------------------------------------------------------------------------------------------+ | lastName | request | Customer's last name | +--------------------------+----------------+------------------------------------------------------------------------------------------------------+ -| groups | request | *(optional)* Array of groups customer belongs to | +| group | request | *(optional)* Customer group code | +--------------------------+----------------+------------------------------------------------------------------------------------------------------+ | gender | request | Customer's gender | +--------------------------+----------------+------------------------------------------------------------------------------------------------------+ @@ -139,9 +139,7 @@ Exemplary Response "firstName":"John", "lastName":"Diggle", "gender":"m", - "group":[ - - ] + "group":{} } If you try to create a customer without email or gender, you will receive a ``400 Bad Request`` error. @@ -244,9 +242,7 @@ Exemplary Response "firstName":"Levi", "lastName":"Friesen", "gender":"u", - "group":[ - - ] + "group":{} } Collection of Customers @@ -428,7 +424,7 @@ Definition +--------------------------+----------------+------------------------------------------------------------------------------+ | lastName | request | Customers last name | +--------------------------+----------------+------------------------------------------------------------------------------+ -| groups | request | *(optional)* Array of groups customer belongs to | +| group | request | *(optional)* Customer group code | +--------------------------+----------------+------------------------------------------------------------------------------+ | gender | request | Customers gender | +--------------------------+----------------+------------------------------------------------------------------------------+ @@ -534,7 +530,7 @@ Definition +--------------------------+----------------+--------------------------------------------------+ | lastName | request | *(optional)* Customers last name | +--------------------------+----------------+--------------------------------------------------+ -| groups | request | *(optional)* Array of groups customer belongs to | +| group | request | *(optional)* Customer group code | +--------------------------+----------------+--------------------------------------------------+ | gender | request | *(optional)* Customers gender | +--------------------------+----------------+--------------------------------------------------+ diff --git a/docs/customization/factory.rst b/docs/customization/factory.rst index 6a5e45fc19a..041193f2af4 100644 --- a/docs/customization/factory.rst +++ b/docs/customization/factory.rst @@ -81,7 +81,7 @@ Take its interface (``Sylius\Component\Product\Factory\ProductFactoryInterface`` public function createDisabled(): ProductInterface { /** @var ProductInterface $product */ - $product = $this->decoratedFactory->createNew(); + $product = $this->decoratedFactory->createWithVariant(); $product->setEnabled(false); @@ -104,10 +104,11 @@ as a decorating service in the ``app/Resources/config/services.yml``. **3.** You can use the new method of the factory in routing. After the ``sylius.factory.product`` has been decorated it has got the new ``createDisabled()`` method. -You can for example override ``sylius_admin_product_create_simple`` route like below: +To actually use it overwrite ``sylius_admin_product_create_simple`` route like below in ``app/config/routing/admin/product.yml``: .. code-block:: yaml + # app/config/routing/admin/product.yml sylius_admin_product_create_simple: path: /products/new/simple methods: [GET, POST] @@ -126,6 +127,23 @@ You can for example override ``sylius_admin_product_create_simple`` route like b route: name: sylius_admin_product_create_simple +Create a new yaml file located at ``app/config/routing/admin.yml``, if it does not exist yet. + +.. code-block:: yaml + + # app/config/routing/admin.yml + app_admin_product: + resource: 'admin/product.yml' +                         +Remember to import the ``app/config/routing/admin.yml`` into the ``app/config/routing.yml``. + +.. code-block:: yaml + + # app/config/routing.yml + app_admin: + resource: 'routing/admin.yml' + prefix: /admin + .. include:: /customization/plugins.rst.inc Learn more