Product feature integration

Edit on GitHub
You are browsing a previous version of the document. The latest version is 202212.0.
Attention!
The following feature integration guide expects the basic feature to be in place. The current feature integration guide only adds the **Product Concrete Search Widget** functionality.

Install Feature Core

Prerequisites

Please overview and install the necessary features before beginning the integration step.

Name Version
Spryker Core 201903.0

1) Install the required modules using Composer

Run the following command to install the required modules:

composer require spryker-feature/product: "^201903.0" --update-with-dependencies 
Verification
Make sure that the following module is installed:
ModuleExpected Directory
`ProductSearchWidget``vendor/spryker-shop/product-search-widget`

2) Add Translations

Append the glossary according to your configuration:

src/data/import/glossary.csv
quick-order.input.placeholder,Search by SKU or Name,en_US
quick-order.input.placeholder,Suche per SKU oder Name,de_DE
product_quick_add_widget.form.quantity,"# Qty",en_US
product_quick_add_widget.form.quantity,"# Anzahl",de_DE
quick-order.search.no_results,Item cannot be found,en_US
quick-order.search.no_results,Das produkt konnte nicht gefunden werden.,de_DE 

Run the following console command to import data:

console data:import glossary 
Verification
Make sure that the configured data are added to the `spy_glossary` table in the database.

3) Set up Widgets

Register the following plugins to enable widgets: |Plugin|Description|Prerequisites|Namespace| |—|—|—|—| |ProductConcreteSearchWidget|Allows customers to search for concrete products on the Cart page.|None| SprykerShop\Yves\ProductSearchWidget\Widget|ProductConcreteAddWidget|Incorporates ProductConcreteSearchWidget and allows customers to search for concrete products and quickly add them to the Cart with the desired quantity.|None|SprykerShop\Yves\ProductSearchWidget\Widget|

src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php
<?php

namespace Pyz\Yves\ShopApplication;

use SprykerShop\Yves\ProductSearchWidget\Widget\ProductConcreteAddWidget;
use SprykerShop\Yves\ProductSearchWidget\Widget\ProductConcreteSearchWidget;
use SprykerShop\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider;

class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider
{
    /**
     * @return string[]
     */
    protected function getGlobalWidgets(): array
    {
        return [
            ProductConcreteSearchWidget::class,
            ProductConcreteAddWidget::class,
        ];
    }
}

Verification
Make sure that the following widgets are registered:
ModuleTest
`ProductConcreteSearchWidget`Go to the Cart page and make sure the "Quick add to Cart" section is present, so you can search for concrete products by typing their SKU.
`ProductConcreteAddWidget` Go to the Cart page and make sure the "Quick add to Cart" section is present, so you can add the found products to the Cart with the desired Quantity.