Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Order][OrderItem] Immutable product/variant names #8874

Merged
merged 9 commits into from
Oct 30, 2017
Prev Previous commit
Next Next commit
[Order] Add displaying immutable product/variant names and codes in ui
  • Loading branch information
GSadee committed Oct 30, 2017
commit 3b0fb9542d759901d8422c12808b19b2040a5fa5
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Viewing order items with proper names
And I addressed it to "Lucifer Morningstar", "Seaside Fwy", "90802" "Los Angeles" in the "United States" with identical billing address
And I chose "Free" shipping method with "Cash on Delivery" payment

@ui @todo
@ui
Scenario: Viewing basic information about an order
Given the product "Angel T-Shirt" was renamed to "Devil Cardigan"
And the product "Angel Mug" was renamed to "Devil Glass"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: Seeing order items with proper names
And the customer chose "Free" shipping method to "United States" with "Cash on Delivery" payment
And I am logged in as an administrator

@ui @todo
@ui
Scenario: Seeing order items with proper names
Given the product "Angel T-Shirt" was renamed to "Devil Cardigan"
And the product "Angel Mug" was renamed to "Devil Glass"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% set taxAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::TAX_ADJUSTMENT') %}

{% set variant = item.variant %}
{% set product = variant.product %}
{% set product = item.variant.product %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference?


<tr>
<td class="single line">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% set product = variant.product %}

<div class="ui header">
{% include '@SyliusAdmin/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_admin_product_tiny_thumbnail'} %}
<div class="content">
<a href="{{ path('sylius_admin_product_update', {'id': product.id}) }}" class="sylius-product-name" title="{{ product.name }}">{{ product.name }}</a>
<span class="sub header sylius-product-variant-code" title="{{ variant.code }}">
{{ variant.code }}
<div class="sylius-product-name" title="{{ item.immutableProductName }}">{{ item.immutableProductName }}</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add immutable prefix? It is set to order item, so it shouldn't change anyway.

Just thinking

<span class="sub header sylius-product-variant-code" title="{{ item.immutableVariantCode }}">
{{ item.immutableVariantCode }}
</span>
</div>
</div>
Expand All @@ -17,10 +15,10 @@
</div>
{% endfor %}
</div>
{% elseif variant.name is not null %}
{% elseif item.immutableVariantName is not null %}
<div class="ui horizontal divided list">
<div class="item sylius-product-variant-name">
{{ variant.name }}
{{ item.immutableVariantName }}
</div>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="ui header">
{% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_shop_product_tiny_thumbnail'} %}
<div class="content">
<a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}" class="sylius-product-name">{{ product.name }}</a>
<div class="sylius-product-name">{{ item.immutableProductName }}</div>
<span class="sub header sylius-product-variant-code">
{{ variant.code }}
{{ item.immutableVariantCode }}
</span>
</div>
</div>
Expand All @@ -17,10 +17,10 @@
</div>
{% endfor %}
</div>
{% elseif variant.name is not null %}
{% elseif item.immutableVariantName is not null %}
<div class="ui horizontal divided list">
<div class="item sylius-product-variant-name">
{{ variant.name }}
{{ item.immutableVariantName }}
</div>
</div>
{% endif %}