diff --git a/src/Resources/translations/messages.cs.yml b/src/Resources/translations/messages.cs.yml
index a055354b..6ad54fb2 100755
--- a/src/Resources/translations/messages.cs.yml
+++ b/src/Resources/translations/messages.cs.yml
@@ -16,6 +16,8 @@ bitbag_sylius_cms_plugin:
products_carousel: Produkty v karuselu
products_carousel_by_taxon: Produkty v karuselu podle taxonu
taxons_list: Seznam taxonů
+ products_grid: Produkty v mřížce
+ products_grid_by_taxon: Produkty v mřížce podle taxonu
heading_type: Typ nadpisu
taxon: Taxon
cms:
diff --git a/src/Resources/translations/messages.cs_CZ.yml b/src/Resources/translations/messages.cs_CZ.yml
index a055354b..6ad54fb2 100755
--- a/src/Resources/translations/messages.cs_CZ.yml
+++ b/src/Resources/translations/messages.cs_CZ.yml
@@ -16,6 +16,8 @@ bitbag_sylius_cms_plugin:
products_carousel: Produkty v karuselu
products_carousel_by_taxon: Produkty v karuselu podle taxonu
taxons_list: Seznam taxonů
+ products_grid: Produkty v mřížce
+ products_grid_by_taxon: Produkty v mřížce podle taxonu
heading_type: Typ nadpisu
taxon: Taxon
cms:
diff --git a/src/Resources/translations/messages.de.yml b/src/Resources/translations/messages.de.yml
index f1288dad..18cb3c28 100755
--- a/src/Resources/translations/messages.de.yml
+++ b/src/Resources/translations/messages.de.yml
@@ -66,5 +66,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Produkte im Karussell
products_carousel_by_taxon: Produkte im Karussell nach Taxon
taxons_list: Taxon-Liste
+ products_grid: Produkte im Raster
+ products_grid_by_taxon: Produkte im Raster nach Taxon
heading_type: Überschrift-Typ
taxon: Taxon
diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml
index 6fe4d115..d8daf5cf 100755
--- a/src/Resources/translations/messages.en.yml
+++ b/src/Resources/translations/messages.en.yml
@@ -70,6 +70,8 @@ bitbag_sylius_cms_plugin:
products_carousel: Products carousel
products_carousel_by_taxon: Products carousel by Taxon
taxons_list: Taxons list
+ products_grid: Products grid
+ products_grid_by_taxon: Products grid by Taxon
heading_type: Heading type
taxon: Taxon
seo: SEO
diff --git a/src/Resources/translations/messages.es.yml b/src/Resources/translations/messages.es.yml
index 49c98b21..b93bfcac 100755
--- a/src/Resources/translations/messages.es.yml
+++ b/src/Resources/translations/messages.es.yml
@@ -45,5 +45,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Productos en carrusel
products_carousel_by_taxon: Productos en carrusel por taxón
taxons_list: Lista de taxones
+ products_grid: Productos en cuadrícula
+ products_grid_by_taxon: Productos en cuadrícula por taxón
heading_type: Tipo de encabezado
taxon: Taxón
diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml
index e785e607..04ece97e 100755
--- a/src/Resources/translations/messages.fr.yml
+++ b/src/Resources/translations/messages.fr.yml
@@ -63,5 +63,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Produits en carrousel
products_carousel_by_taxon: Produits en carrousel par taxon
taxons_list: Liste de taxons
+ products_grid: Produits en grille
+ products_grid_by_taxon: Produits en grille par taxon
heading_type: Type d'en-tête
taxon: Taxon
diff --git a/src/Resources/translations/messages.hr.yml b/src/Resources/translations/messages.hr.yml
index 9ee30842..9296a322 100755
--- a/src/Resources/translations/messages.hr.yml
+++ b/src/Resources/translations/messages.hr.yml
@@ -45,5 +45,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Proizvodi u karijeslu
products_carousel_by_taxon: Proizvodi u karijeslu po taksonu
taxons_list: Lista taksona
+ products_grid: Proizvodi u mreži
+ products_grid_by_taxon: Proizvodi u mreži po taksonu
heading_type: Tip naslova
taxon: Takson
diff --git a/src/Resources/translations/messages.lt.yml b/src/Resources/translations/messages.lt.yml
index c3da8446..6799bf34 100644
--- a/src/Resources/translations/messages.lt.yml
+++ b/src/Resources/translations/messages.lt.yml
@@ -62,5 +62,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Produktų karuselė
products_carousel_by_taxon: Produktų karuselė pagal taksoną
taxons_list: Taksonų sąrašas
+ products_grid: Produktų tinklelis
+ products_grid_by_taxon: Produktų tinklelis pagal taksoną
heading_type: Antraštės tipas
taxon: Taksonas
diff --git a/src/Resources/translations/messages.nl.yml b/src/Resources/translations/messages.nl.yml
index 349242b8..4b23f947 100755
--- a/src/Resources/translations/messages.nl.yml
+++ b/src/Resources/translations/messages.nl.yml
@@ -44,5 +44,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Producten in carrousel
products_carousel_by_taxon: Producten in carrousel per taxon
taxons_list: Taxon lijst
+ products_grid: Producten grid
+ products_grid_by_taxon: Producten grid per taxon
heading_type: Kop type
taxon: Taxon
diff --git a/src/Resources/translations/messages.pl.yml b/src/Resources/translations/messages.pl.yml
index 9a0e3410..67a9d2ef 100755
--- a/src/Resources/translations/messages.pl.yml
+++ b/src/Resources/translations/messages.pl.yml
@@ -49,5 +49,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Karuzela produktów
products_carousel_by_taxon: Karuzela produktów według taksonomii
taxons_list: Lista taksonomii
+ products_grid: Siatka produktów
+ products_grid_by_taxon: Siatka produktów według taksonomii
heading_type: Typ nagłówka
taxon: Taksonomia
diff --git a/src/Resources/translations/messages.ru.yml b/src/Resources/translations/messages.ru.yml
index d16b832c..6de939b4 100755
--- a/src/Resources/translations/messages.ru.yml
+++ b/src/Resources/translations/messages.ru.yml
@@ -62,5 +62,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Продукты в карусели
products_carousel_by_taxon: Продукты в карусели по таксону
taxons_list: Список таксонов
+ products_grid: Продукты в сетке
+ products_grid_by_taxon: Продукты в сетке по таксону
heading_type: Тип заголовка
taxon: Таксон
diff --git a/src/Resources/translations/messages.sk.yml b/src/Resources/translations/messages.sk.yml
index 3d0b5db5..3e8fd822 100644
--- a/src/Resources/translations/messages.sk.yml
+++ b/src/Resources/translations/messages.sk.yml
@@ -63,5 +63,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Produkty v karuseli
products_carousel_by_taxon: Produkty v karuseli podľa taxónu
taxons_list: Zoznam taxónov
+ products_grid: Produkty v mriežke
+ products_grid_by_taxon: Produkty v mriežke podľa taxónu
heading_type: Typ nadpisu
taxon: Taxón
diff --git a/src/Resources/translations/messages.uk.yml b/src/Resources/translations/messages.uk.yml
index fdea329b..dba77b1e 100755
--- a/src/Resources/translations/messages.uk.yml
+++ b/src/Resources/translations/messages.uk.yml
@@ -62,5 +62,7 @@ bitbag_sylius_cms_plugin:
products_carousel: Продукти в каруселі
products_carousel_by_taxon: Продукти в каруселі за таксоном
taxons_list: Список таксонів
+ products_grid: Продукти в сітці
+ products_grid_by_taxon: Продукти в сітці за таксоном
heading_type: Тип заголовка
taxon: Таксон
diff --git a/src/Resources/views/Shop/ContentElement/_products_grid.html.twig b/src/Resources/views/Shop/ContentElement/_products_grid.html.twig
new file mode 100644
index 00000000..c48272e8
--- /dev/null
+++ b/src/Resources/views/Shop/ContentElement/_products_grid.html.twig
@@ -0,0 +1,3 @@
+
+ {% include '@SyliusShop/Product/_horizontalList.html.twig' %}
+
diff --git a/tests/Behat/Behaviour/ContainsContentElementTrait.php b/tests/Behat/Behaviour/ContainsContentElementTrait.php
index db6e686e..0d3c0485 100644
--- a/tests/Behat/Behaviour/ContainsContentElementTrait.php
+++ b/tests/Behat/Behaviour/ContainsContentElementTrait.php
@@ -23,6 +23,8 @@ public function containsContentElement(string $contentElement): bool
'Multiple media',
'Products carousel',
'Products carousel by Taxon',
+ 'Products grid',
+ 'Products grid by Taxon',
'Taxons list' => true,
default => false,
};
diff --git a/tests/Behat/Context/Ui/Admin/BlockContext.php b/tests/Behat/Context/Ui/Admin/BlockContext.php
index 6d250cd3..607c2e30 100755
--- a/tests/Behat/Context/Ui/Admin/BlockContext.php
+++ b/tests/Behat/Context/Ui/Admin/BlockContext.php
@@ -203,6 +203,22 @@ public function iAddAProductsCarouselByTaxonContentElementWithTaxon(string $taxo
$this->resolveCurrentPage()->addProductsCarouselByTaxonContentElementWithTaxon($taxon);
}
+ /**
+ * @When I add a products grid content element with :firstProductName and :secondProductName products
+ */
+ public function iAddAProductsGridContentElementWithProducts(string ...$productsNames): void
+ {
+ $this->resolveCurrentPage()->addProductsGridContentElementWithProducts($productsNames);
+ }
+
+ /**
+ * @When I add a products grid by taxon content element with :taxon taxonomy
+ */
+ public function iAddAProductsGridByTaxonContentElementWithTaxon(string $taxon): void
+ {
+ $this->resolveCurrentPage()->addProductsGridByTaxonContentElementWithTaxon($taxon);
+ }
+
/**
* @When I add a taxons list content element with :firstTaxon and :secondTaxon taxonomy
*/
diff --git a/tests/Behat/Context/Ui/Admin/PageContext.php b/tests/Behat/Context/Ui/Admin/PageContext.php
index b5f3d488..fd1af330 100755
--- a/tests/Behat/Context/Ui/Admin/PageContext.php
+++ b/tests/Behat/Context/Ui/Admin/PageContext.php
@@ -249,6 +249,22 @@ public function iAddAProductsCarouselByTaxonContentElementWithTaxon(string $taxo
$this->resolveCurrentPage()->addProductsCarouselByTaxonContentElementWithTaxon($taxon);
}
+ /**
+ * @When I add a products grid content element with :firstProductName and :secondProductName products
+ */
+ public function iAddAProductsGridContentElementWithProducts(string ...$productsNames): void
+ {
+ $this->resolveCurrentPage()->addProductsGridContentElementWithProducts($productsNames);
+ }
+
+ /**
+ * @When I add a products grid by taxon content element with :taxon taxonomy
+ */
+ public function iAddAProductsGridByTaxonContentElementWithTaxon(string $taxon): void
+ {
+ $this->resolveCurrentPage()->addProductsGridByTaxonContentElementWithTaxon($taxon);
+ }
+
/**
* @When I add a taxons list content element with :firstTaxon and :secondTaxon taxonomy
*/
diff --git a/tests/Behat/Helpers/ContentElementHelper.php b/tests/Behat/Helpers/ContentElementHelper.php
index c2915b9d..3f0ca2ef 100644
--- a/tests/Behat/Helpers/ContentElementHelper.php
+++ b/tests/Behat/Helpers/ContentElementHelper.php
@@ -21,6 +21,8 @@ public static function getDefinedElementThatShouldAppearAfterSelectContentElemen
'Heading' => 'content_elements_heading',
'Products carousel' => 'content_elements_products_carousel',
'Products carousel by Taxon' => 'content_elements_products_carousel_by_taxon',
+ 'Products grid' => 'content_elements_products_grid',
+ 'Products grid by Taxon' => 'content_elements_products_grid_by_taxon',
'Taxons list' => 'content_elements_taxons_list',
default => throw new \InvalidArgumentException(sprintf('Content element with name "%s" does not exist.', $contentElement)),
};
@@ -40,6 +42,13 @@ public static function getExampleConfigurationByContentElement(string $contentEl
],
]],
'Products carousel by Taxon' => ['products_carousel_by_taxon' => 'MENU_CATEGORY'],
+ 'Products grid' => ['products_grid' => [
+ 'products' => [
+ 'Everyday_white_basic_T_Shirt',
+ 'Loose_white_designer_T_Shirt',
+ ],
+ ]],
+ 'Products grid by Taxon' => ['products_grid_by_taxon' => 'MENU_CATEGORY'],
'Taxons list' => ['taxons_list' => [
'taxons' => [
'MENU_CATEGORY',
diff --git a/tests/Behat/Page/Admin/Block/CreatePage.php b/tests/Behat/Page/Admin/Block/CreatePage.php
index 7af9cc02..98a9031b 100755
--- a/tests/Behat/Page/Admin/Block/CreatePage.php
+++ b/tests/Behat/Page/Admin/Block/CreatePage.php
@@ -197,6 +197,44 @@ public function addProductsCarouselByTaxonContentElementWithTaxon(string $taxon)
$item->click();
}
+ public function addProductsGridContentElementWithProducts(array $productsNames): void
+ {
+ $dropdown = $this->getElement('content_elements_products_grid');
+ $dropdown->click();
+
+ foreach ($productsNames as $productName) {
+ $dropdown->waitFor(5, function () use ($productName): bool {
+ return $this->hasElement('content_elements_products_grid_item', [
+ '%item%' => $productName,
+ ]);
+ });
+
+ $item = $this->getElement('content_elements_products_grid_item', [
+ '%item%' => $productName,
+ ]);
+
+ $item->click();
+ }
+ }
+
+ public function addProductsGridByTaxonContentElementWithTaxon(string $taxon): void
+ {
+ $dropdown = $this->getElement('content_elements_products_grid_by_taxon');
+ $dropdown->click();
+
+ $dropdown->waitFor(5, function () use ($taxon): bool {
+ return $this->hasElement('content_elements_products_grid_by_taxon_item', [
+ '%item%' => $taxon,
+ ]);
+ });
+
+ $item = $this->getElement('content_elements_products_grid_by_taxon_item', [
+ '%item%' => $taxon,
+ ]);
+
+ $item->click();
+ }
+
public function addTaxonsListContentElementWithTaxons(array $taxons): void
{
$dropdown = $this->getElement('content_elements_taxons_list');
@@ -235,6 +273,10 @@ protected function getDefinedElements(): array
'content_elements_products_carousel_item' => '.field > label:contains("Products") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
'content_elements_products_carousel_by_taxon' => '.field > label:contains("Taxon") ~ .sylius-autocomplete',
'content_elements_products_carousel_by_taxon_item' => '.field > label:contains("Taxon") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
+ 'content_elements_products_grid' => '.field > label:contains("Products") ~ .sylius-autocomplete',
+ 'content_elements_products_grid_item' => '.field > label:contains("Products") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
+ 'content_elements_products_grid_by_taxon' => '.field > label:contains("Taxon") ~ .sylius-autocomplete',
+ 'content_elements_products_grid_by_taxon_item' => '.field > label:contains("Taxon") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
'content_elements_taxons_list' => '.field > label:contains("Taxons") ~ .sylius-autocomplete',
'content_elements_taxons_list_item' => '.field > label:contains("Taxons") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
]);
diff --git a/tests/Behat/Page/Admin/Block/CreatePageInterface.php b/tests/Behat/Page/Admin/Block/CreatePageInterface.php
index 95bbcfbb..54605051 100755
--- a/tests/Behat/Page/Admin/Block/CreatePageInterface.php
+++ b/tests/Behat/Page/Admin/Block/CreatePageInterface.php
@@ -45,6 +45,10 @@ public function addProductsCarouselContentElementWithProducts(array $productsNam
public function addProductsCarouselByTaxonContentElementWithTaxon(string $taxon): void;
+ public function addProductsGridContentElementWithProducts(array $productsNames): void;
+
+ public function addProductsGridByTaxonContentElementWithTaxon(string $taxon): void;
+
public function addTaxonsListContentElementWithTaxons(array $taxons): void;
public function disable(): void;
diff --git a/tests/Behat/Page/Admin/Page/CreatePage.php b/tests/Behat/Page/Admin/Page/CreatePage.php
index c2eedbb3..2e292220 100755
--- a/tests/Behat/Page/Admin/Page/CreatePage.php
+++ b/tests/Behat/Page/Admin/Page/CreatePage.php
@@ -206,6 +206,44 @@ public function addProductsCarouselByTaxonContentElementWithTaxon(string $taxon)
$item->click();
}
+ public function addProductsGridContentElementWithProducts(array $productsNames): void
+ {
+ $dropdown = $this->getElement('content_elements_products_grid');
+ $dropdown->click();
+
+ foreach ($productsNames as $productName) {
+ $dropdown->waitFor(5, function () use ($productName): bool {
+ return $this->hasElement('content_elements_products_grid_item', [
+ '%item%' => $productName,
+ ]);
+ });
+
+ $item = $this->getElement('content_elements_products_grid_item', [
+ '%item%' => $productName,
+ ]);
+
+ $item->click();
+ }
+ }
+
+ public function addProductsGridByTaxonContentElementWithTaxon(string $taxon): void
+ {
+ $dropdown = $this->getElement('content_elements_products_grid_by_taxon');
+ $dropdown->click();
+
+ $dropdown->waitFor(5, function () use ($taxon): bool {
+ return $this->hasElement('content_elements_products_grid_by_taxon_item', [
+ '%item%' => $taxon,
+ ]);
+ });
+
+ $item = $this->getElement('content_elements_products_grid_by_taxon_item', [
+ '%item%' => $taxon,
+ ]);
+
+ $item->click();
+ }
+
public function addTaxonsListContentElementWithTaxons(array $taxons): void
{
$dropdown = $this->getElement('content_elements_taxons_list');
@@ -245,6 +283,10 @@ protected function getDefinedElements(): array
'content_elements_products_carousel_item' => '.field > label:contains("Products") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
'content_elements_products_carousel_by_taxon' => '.field > label:contains("Taxon") ~ .sylius-autocomplete',
'content_elements_products_carousel_by_taxon_item' => '.field > label:contains("Taxon") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
+ 'content_elements_products_grid' => '.field > label:contains("Products") ~ .sylius-autocomplete',
+ 'content_elements_products_grid_item' => '.field > label:contains("Products") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
+ 'content_elements_products_grid_by_taxon' => '.field > label:contains("Taxon") ~ .sylius-autocomplete',
+ 'content_elements_products_grid_by_taxon_item' => '.field > label:contains("Taxon") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
'content_elements_taxons_list' => '.field > label:contains("Taxons") ~ .sylius-autocomplete',
'content_elements_taxons_list_item' => '.field > label:contains("Taxons") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")',
]);
diff --git a/tests/Behat/Page/Admin/Page/CreatePageInterface.php b/tests/Behat/Page/Admin/Page/CreatePageInterface.php
index 5b511a7c..cd67dc2b 100755
--- a/tests/Behat/Page/Admin/Page/CreatePageInterface.php
+++ b/tests/Behat/Page/Admin/Page/CreatePageInterface.php
@@ -51,5 +51,9 @@ public function addProductsCarouselContentElementWithProducts(array $productsNam
public function addProductsCarouselByTaxonContentElementWithTaxon(string $taxon): void;
+ public function addProductsGridContentElementWithProducts(array $productsNames): void;
+
+ public function addProductsGridByTaxonContentElementWithTaxon(string $taxon): void;
+
public function addTaxonsListContentElementWithTaxons(array $taxons): void;
}