-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add templates extending from the core app to make sure items are mark…
…ed as samples when shown
- Loading branch information
Showing
9 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="ui header"> | ||
{% include '@SyliusAdmin/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_admin_product_tiny_thumbnail'} %} | ||
<div class="content"> | ||
<div class="sylius-product-name" title="{{ item.productName }}">{{ item.productName }}</div> | ||
<span class="sub header sylius-product-variant-code" title="{{ variant.code }}"> | ||
{{ variant.code }} | ||
</span> | ||
</div> | ||
</div> | ||
{% if product.hasOptions() %} | ||
<div class="ui horizontal divided list sylius-product-options"> | ||
{% for optionValue in variant.optionValues %} | ||
<div class="item" data-sylius-option-name="{{ optionValue.name }}"> | ||
{{ optionValue.value }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% elseif item.variantName is not null %} | ||
<div class="ui horizontal divided list"> | ||
<div class="item sylius-product-variant-name"> | ||
{{ item.variantName }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if variant.sampleOf is not null %} | ||
<span class="ui small blue tag label">{{ 'babdev_sylius_product_samples.ui.sample'|trans }}</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} | ||
|
||
{% if cart.empty %} | ||
{{ 'sylius.ui.your_cart_is_empty'|trans }}. | ||
{% else %} | ||
<div class="ui list"> | ||
{% for item in cart.items %} | ||
<div class="item"> | ||
{% if item.variant.sampleOf is null %} | ||
{{ item.quantity }} x <strong>{{ item.product }}</strong> {{ money.convertAndFormat(item.unitPrice) }} | ||
{% else %} | ||
{{ item.quantity }} x <strong>{{ 'babdev_sylius_product_samples.ui.sample_of_product'|trans({'%product%': item.product}) }}</strong> {{ money.convertAndFormat(item.unitPrice) }} | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
<div class="item"><strong>{{ 'sylius.ui.subtotal'|trans }}</strong>: {{ money.convertAndFormat(cart.itemsTotal) }}</div> | ||
</div> | ||
<a href="{{ path('sylius_shop_cart_summary') }}" class="ui fluid basic text button">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a> | ||
<div class="ui divider"></div> | ||
<a href="{{ path('sylius_shop_checkout_start') }}" class="ui fluid primary button">{{ 'sylius.ui.checkout'|trans }}</a> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} | ||
|
||
{% set itemsSubtotal = sylius_order_items_subtotal(order) %} | ||
{% set taxIncluded = sylius_order_tax_included(order) %} | ||
{% set taxExcluded = sylius_order_tax_excluded(order) %} | ||
|
||
<div class="ui segment"> | ||
<table class="ui very basic table" id="sylius-checkout-subtotal" {{ sylius_test_html_attribute('checkout-subtotal') }}> | ||
<thead> | ||
<tr> | ||
<th class="sylius-table-column-item">{{ 'sylius.ui.item'|trans }}</th> | ||
<th class="sylius-table-column-qty">{{ 'sylius.ui.qty'|trans }}</th> | ||
<th class="sylius-table-column-subtotal">{{ 'sylius.ui.subtotal'|trans }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for item in order.items %} | ||
<tr> | ||
<td> | ||
{% if item.getVariant.sampleOf is null %} | ||
{{ item.getVariant.product.name }} | ||
{% else %} | ||
{{ 'babdev_sylius_product_samples.ui.sample_of_product'|trans({'%product%': item.getVariant.product.name}) }} | ||
{% endif %} | ||
</td> | ||
<td class="center aligned"> | ||
{{ item.quantity }} | ||
</td> | ||
<td class="right aligned" id="sylius-item-{{ item.variant.product.slug }}-subtotal" {{ sylius_test_html_attribute('item-subtotal', item.variant.product.slug) }}> | ||
{{ money.convertAndFormat(item.subtotal) }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
<tfoot> | ||
<tr> | ||
<td colspan="1" style="border-top: 2px solid #ddd;"> | ||
<strong>{{ 'sylius.ui.items_total'|trans }}:</strong> | ||
</td> | ||
<td colspan="2" id="sylius-summary-items-subtotal" class="right aligned" style="border-top: 2px solid #ddd;"> | ||
{{ money.convertAndFormat(itemsSubtotal) }} | ||
</td> | ||
</tr> | ||
<tr {% if taxIncluded and not taxExcluded %}class="tax-disabled" {% endif %}> | ||
<td colspan="1"> | ||
<strong>{{ 'sylius.ui.taxes_total'|trans }}:</strong> | ||
</td> | ||
<td colspan="2" class="right aligned"> | ||
{% if not taxIncluded and not taxExcluded %} | ||
<div id="sylius-summary-tax-none">{{ money.convertAndFormat(0) }}</div> | ||
{% endif %} | ||
{% if taxExcluded %} | ||
<div id="sylius-summary-tax-excluded">{{ money.convertAndFormat(taxExcluded) }}</div> | ||
{% endif %} | ||
{% if taxIncluded %} | ||
<div class="tax-disabled"> | ||
<span id="sylius-summary-tax-included">{{ money.convertAndFormat(taxIncluded) }}</span> | ||
<div><small>({{ 'sylius.ui.included_in_price'|trans }})</small></div> | ||
</div> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="1"> | ||
<strong>{{ 'sylius.ui.discount'|trans }}:</strong> | ||
</td> | ||
<td colspan="2" id="sylius-summary-promotion-total" class="right aligned"> | ||
{{ money.convertAndFormat(order.orderPromotionTotal) }} | ||
</td> | ||
</tr> | ||
{% if order.shipments is not empty %} | ||
<tr> | ||
<td colspan="1"> | ||
<strong>{{ 'sylius.ui.shipping_estimated_cost'|trans }}:</strong> | ||
</td> | ||
<td colspan="2" class="right aligned"> | ||
{% if order.getAdjustmentsTotal('shipping') > order.shippingTotal %} | ||
<div class="old-price">{{ money.convertAndFormat(order.getAdjustmentsTotal('shipping')) }}</div> | ||
{% endif %} | ||
<span id="sylius-summary-shipping-total">{{ money.convertAndFormat(order.shippingTotal) }}</span> | ||
</td> | ||
</tr> | ||
{% endif %} | ||
<tr class="ui large header"> | ||
<td colspan="1"> | ||
<strong>{{ 'sylius.ui.order_total'|trans }}:</strong> | ||
</td> | ||
<td colspan="2" id="sylius-summary-grand-total" class="right aligned"> | ||
{{ money.convertAndFormat(order.total) }} | ||
</td> | ||
</tr> | ||
</tfoot> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% set product = variant.product %} | ||
|
||
<div class="ui header"> | ||
{% if variant.hasImages %} | ||
{% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': variant, 'filter': 'sylius_shop_product_tiny_thumbnail'} %} | ||
{% else %} | ||
{% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_shop_product_tiny_thumbnail'} %} | ||
{% endif %} | ||
<div class="content"> | ||
<a href="{{ path('sylius_shop_product_show', {'slug': product.slug}) }}"> | ||
<div class="sylius-product-name" {{ sylius_test_html_attribute('product-name', item.productName) }}>{{ item.productName }}</div> | ||
<span class="sub header sylius-product-variant-code" {{ sylius_test_html_attribute('product-variant-code') }}> | ||
{{ variant.code }} | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
{% if product.hasOptions() %} | ||
<div class="ui horizontal divided list sylius-product-options" {{ sylius_test_html_attribute('product-options') }}> | ||
{% for optionValue in variant.optionValues %} | ||
<div class="item" data-sylius-option-name="{{ optionValue.name }}" {{ sylius_test_html_attribute('option-name', optionValue.name) }}> | ||
{{ optionValue.value }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% elseif item.variantName is not null %} | ||
<div class="ui horizontal divided list"> | ||
<div class="item sylius-product-variant-name" {{ sylius_test_html_attribute('product-variant-name') }}> | ||
{{ item.variantName }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if variant.sampleOf is not null %} | ||
<span class="ui small blue tag label">{{ 'babdev_sylius_product_samples.ui.sample'|trans }}</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/Application/templates/bundles/SyliusAdminBundle/Product/_info.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% include '@BabDevSyliusProductSamplesPlugin/Admin/Product/_info.html.twig' %} |
14 changes: 14 additions & 0 deletions
14
tests/Application/templates/bundles/SyliusShopBundle/Checkout/_header.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="ui basic segment"> | ||
<div class="ui large text menu"> | ||
<div class="ui small image"> | ||
<a href="{{ path('sylius_shop_homepage') }}"><img src="{{ asset('build/shop/images/logo.png', 'shop') }}" /></a> | ||
</div> | ||
<div class="right menu"> | ||
{% if order.customer.id|default(null) is not null %} | ||
<div class="item" id="purchaser-email" {{ sylius_test_html_attribute('purchaser-name-or-email') }}>{{ 'sylius.ui.checking_out_as'|trans }} {{ app.user is null ? order.customer.email : order.customer.fullName|default(order.customer.email) }}.</div> | ||
{% else %} | ||
<a href="{{ path('sylius_shop_login') }}" class="item">{{ 'sylius.ui.sign_in'|trans }}</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
tests/Application/templates/bundles/SyliusShopBundle/Product/_info.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% include '@BabDevSyliusProductSamplesPlugin/Shop/Product/_info.html.twig' %} |