Skip to content

Commit

Permalink
Small fixes (#53)
Browse files Browse the repository at this point in the history
* fix: move compare-float container into body

* fix: use variable activeRoute

* fix: change duplicated block name for compare-block

* fix: add pipe to raw output at description
  • Loading branch information
tinect authored Aug 25, 2023
1 parent a7937e4 commit 356b865
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/Resources/views/storefront/base.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% sw_extends '@Storefront/storefront/base.html.twig' %}

{% block base_body %}
{% block base_body_inner %}
{{ parent() }}
{% block frosh_product_compare_float_button %}

{% block frosh_product_compare_float_button_container %}
{% sw_include '@Storefront/storefront/component/compare/compare-float.html.twig' %}
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% set hideSpecs = 'specs' in hideAttributes %}

{% set productsCount = products.count %}
{% set isAjaxContent = app.request.attributes.get('_route') == 'frontend.compare.content' %}
{% set isAjaxContent = activeRoute == 'frontend.compare.content' %}
{% if productsCount is same as(0) %}
{% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
type: "info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% for product in products %}
{% block frosh_product_compare_description_cell %}
<td>
{{ product.translated.description|replace({'><': '> <'})raw|striptags|u.truncate(250, '') }}
{{ product.translated.description|replace({'><': '> <'})|raw|striptags|u.truncate(250, '') }}
</td>
{% endblock %}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block component_product_box_action_buy %}
{{ parent() }}

{% if app.request.attributes.get('_route') != 'frontend.compare.content' %}
{% if activeRoute != 'frontend.compare.content' %}
{% block component_product_box_action_add_to_compare_button %}
{% sw_include '@Storefront/storefront/component/product/card/compare-button.html.twig' %}
{% endblock %}
Expand All @@ -13,7 +13,7 @@
{% block component_product_box_action_detail %}
{{ parent() }}

{% if app.request.attributes.get('_route') != 'frontend.compare.content' %}
{% if activeRoute != 'frontend.compare.content' %}
{% block component_product_box_action_detail_add_to_compare_button %}
{% sw_include '@Storefront/storefront/component/product/card/compare-button.html.twig' %}
{% endblock %}
Expand Down

0 comments on commit 356b865

Please sign in to comment.