diff --git a/development/components/form/types-reference/_index.md b/development/components/form/types-reference/_index.md index bd0780dc86..0d6c60e0fe 100644 --- a/development/components/form/types-reference/_index.md +++ b/development/components/form/types-reference/_index.md @@ -53,8 +53,6 @@ Developers can already use a large list of field types (see [Symfony types](http | [`TranslatableType`](translatable) | PrestaShopBundle\Form\Admin\Type | Class TranslatableType adds translatable inputs with custom inner type to forms. Language selection uses a dropdown. | | [`TranslateType`](translate-type) | PrestaShopBundle\Form\Admin\Type | This form class is responsible to create a translatable form. Language selection uses tabs. | | [`TypeaheadCustomerCollectionType`](typeahead-customer-collection-type) | PrestaShopBundle\Form\Admin\Type | This form class is responsible to select a customer. | -| [`TypeaheadProductCollectionType`](typeahead-product-collection-type) | PrestaShopBundle\Form\Admin\Type | This form class is responsible to select a product, with or without attribute field. | -| [`TypeaheadProductPackCollectionType`](typeahead-product-pack-collection-type) | PrestaShopBundle\Form\Admin\Type | This form class is responsible to select a product, with or without attribute field. | | [`UnavailableType`](unavailable-type) | PrestaShopBundle\Form\Admin\Type | This form type is useful during development phase to show part of a form that are not available yet. | | [`YesAndNoChoiceType`](yes-and-no-choice) | PrestaShopBundle\Form\Admin\Type | Symfony `ChoiceType` with `Yes` and `No` choices. | | [`ZoneChoiceType`](zone-choice-type) | PrestaShopBundle\Form\Admin\Type | Class is responsible for providing configurable zone choices with -- symbol in front of array | diff --git a/development/components/form/types-reference/img/typeahead-product-collection-type.png b/development/components/form/types-reference/img/typeahead-product-collection-type.png deleted file mode 100644 index 30c7d61e59..0000000000 Binary files a/development/components/form/types-reference/img/typeahead-product-collection-type.png and /dev/null differ diff --git a/development/components/form/types-reference/img/typeahead-product-pack-collection.png b/development/components/form/types-reference/img/typeahead-product-pack-collection.png deleted file mode 100644 index 7e282d7899..0000000000 Binary files a/development/components/form/types-reference/img/typeahead-product-pack-collection.png and /dev/null differ diff --git a/development/components/form/types-reference/typeahead-product-collection-type.md b/development/components/form/types-reference/typeahead-product-collection-type.md deleted file mode 100644 index 8f79933b28..0000000000 --- a/development/components/form/types-reference/typeahead-product-collection-type.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: TypeaheadProductCollectionType ---- - -# TypeaheadProductCollectionType - -This form class allows you to select a product, with or without an attribute field. - -- Namespace: PrestaShopBundle\Form\Admin\Type -- Reference: [TypeaheadProductCollectionType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/TypeaheadProductCollectionType.php) - -## Type options - -| Option | Type | Default value | Description | -| :----------- | :----- | :-------------------------------- | :---------------------------------------------------------------------------------------- | - -## Code example - -- [ProductInformation](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Product/ProductInformation.php#L343-L351) - -```php -$builder->add('related_products', TypeaheadProductCollectionType::class, [ - 'remote_url' => $this->context->getLegacyAdminLink('AdminProducts', true, ['ajax' => 1, 'action' => 'productsList', 'forceJson' => 1, 'disableCombination' => 1, 'exclude_packs' => 0, 'excludeVirtuals' => 0, 'limit' => 20]) . '&q=%QUERY', - 'mapping_value' => 'id', - 'mapping_name' => 'name', - 'placeholder' => $this->translator->trans('Search and add a related product', [], 'Admin.Catalog.Help'), - 'template_collection' => '%sclear', - 'required' => false, - 'label' => $this->translator->trans('Accessories', [], 'Admin.Catalog.Feature'), -]) -``` - - -## Preview example - -{{< figure src="../img/typeahead-product-collection-type.png" title="TypeaheadProductCollectionType rendered in form using textarea" >}} \ No newline at end of file diff --git a/development/components/form/types-reference/typeahead-product-pack-collection-type.md b/development/components/form/types-reference/typeahead-product-pack-collection-type.md deleted file mode 100644 index ad0255e3e8..0000000000 --- a/development/components/form/types-reference/typeahead-product-pack-collection-type.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: TypeaheadProductPackCollectionType ---- - -# TypeaheadProductPackCollectionType - -This form class allows you to select a product to be included in a pack of products. - -- Namespace: PrestaShopBundle\Form\Admin\Type -- Reference: [TypeaheadProductPackCollectionType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/TypeaheadProductPackCollectionType.php) - -## Type options - -| Option | Type | Default value | Description | -| :----------- | :----- | :-------------------------------- | :---------------------------------------------------------------------------------------- | - -## Code example - -- [ProductInformation](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Product/ProductInformation.php#L200-L213) - -```php -$builder->add('inputPackItems', TypeaheadProductPackCollectionType::class, [ - 'remote_url' => $this->context->getLegacyAdminLink('AdminProducts', true, ['ajax' => 1, 'action' => 'productsList', 'forceJson' => 1, 'excludeVirtuals' => 1, 'limit' => 20]) . '&q=%QUERY', - 'mapping_value' => 'id', - 'mapping_name' => 'name', - 'placeholder' => $this->translator->trans('Search for a product', [], 'Admin.Catalog.Help'), - 'template_collection' => ' -

%s

-
REF: %s
-
x%s
- - ', - 'required' => false, - 'label' => $this->translator->trans('Add products to your pack', [], 'Admin.Catalog.Feature'), -]) -``` - -## Preview example - -{{< figure src="../img/typeahead-product-pack-collection.png" title="TypeaheadProductPackCollectionType rendered in form using textarea" >}} \ No newline at end of file