diff --git a/config/packages/sylius_twig_hooks.yaml b/config/packages/sylius_twig_hooks.yaml index c90e183c..25727b2f 100644 --- a/config/packages/sylius_twig_hooks.yaml +++ b/config/packages/sylius_twig_hooks.yaml @@ -58,7 +58,7 @@ sylius_twig_hooks: component: 'sylius_shop:product:list' props: limit: 4 - template: '@SyliusShop/product/common/list.html.twig' + template: '@SyliusShop/homepage/list_deals.html.twig' configuration: title: 'sylius.homepage.latest_deals' test_attribute: 'latest-deals' @@ -67,6 +67,5 @@ sylius_twig_hooks: component: 'sylius_shop:product:list' props: limit: 8 - template: '@SyliusShop/homepage/latest_products.html.twig' + template: '@SyliusShop/homepage/list_products.html.twig' priority: 0 - diff --git a/public/favicon.ico b/public/favicon.ico index 592f7a8e..e5d8b138 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/templates/bundles/SyliusShopBundle/homepage/banner.html.twig b/templates/bundles/SyliusShopBundle/homepage/banner.html.twig new file mode 100644 index 00000000..ca887eba --- /dev/null +++ b/templates/bundles/SyliusShopBundle/homepage/banner.html.twig @@ -0,0 +1,8 @@ +
+
+
+ Home + New collection +
+
+
diff --git a/templates/bundles/SyliusShopBundle/homepage/card_deals.html.twig b/templates/bundles/SyliusShopBundle/homepage/card_deals.html.twig new file mode 100644 index 00000000..278cd075 --- /dev/null +++ b/templates/bundles/SyliusShopBundle/homepage/card_deals.html.twig @@ -0,0 +1,31 @@ +
+ +
+
+ {% if key == 1 %} + {{ component('sylius_shop:main_image', { + product: product, + class: "w-100 h-100 object-fit-cover", + filter: 'sylius_shop_product_small_thumbnail' + }) }} + {% else %} + {{ component('sylius_shop:main_image', { + product: product, + class: "w-100 h-100 object-fit-cover", + loading: 'lazy', + filter: 'sylius_shop_product_small_thumbnail' + }) }} + {% endif %} +
+
+
+ {{ product.name }} +
+
+
+ {% if not product.enabledVariants.empty() %} + {{ component('sylius_shop:catalog_promotions', { variant: variant, appliedPromotions: applied_promotions, withDescription: false }) }} + {{ component('sylius_shop:product:card:price', { variant: variant, template: '@SyliusShop/product/common/price.html.twig' }) }} + {% endif %} +
+
diff --git a/templates/bundles/SyliusShopBundle/homepage/product_card.html.twig b/templates/bundles/SyliusShopBundle/homepage/card_products.html.twig similarity index 100% rename from templates/bundles/SyliusShopBundle/homepage/product_card.html.twig rename to templates/bundles/SyliusShopBundle/homepage/card_products.html.twig diff --git a/templates/bundles/SyliusShopBundle/homepage/list_deals.html.twig b/templates/bundles/SyliusShopBundle/homepage/list_deals.html.twig new file mode 100644 index 00000000..fc7c5395 --- /dev/null +++ b/templates/bundles/SyliusShopBundle/homepage/list_deals.html.twig @@ -0,0 +1,11 @@ +
+

{{ hookable_metadata.configuration.title|default('sylius.ui.latest_products')|trans }}

+ +
+
+ {% for key,product in latest_products %} +
{{ component('sylius_shop:product:card', { key: loop.index, product: product, template: '@SyliusShop/homepage/card_deals.html.twig' }) }}
+ {% endfor %} +
+
+
diff --git a/templates/bundles/SyliusShopBundle/homepage/latest_products.html.twig b/templates/bundles/SyliusShopBundle/homepage/list_products.html.twig similarity index 81% rename from templates/bundles/SyliusShopBundle/homepage/latest_products.html.twig rename to templates/bundles/SyliusShopBundle/homepage/list_products.html.twig index be31ae35..2e274482 100644 --- a/templates/bundles/SyliusShopBundle/homepage/latest_products.html.twig +++ b/templates/bundles/SyliusShopBundle/homepage/list_products.html.twig @@ -4,7 +4,7 @@
{% for product in latest_products %} -
{{ component('sylius_shop:product:card', { product: product, template: '@SyliusShop/homepage/product_card.html.twig' }) }}
+
{{ component('sylius_shop:product:card', { key: loop.index, product: product, template: '@SyliusShop/homepage/card_products.html.twig' }) }}
{% endfor %}