diff --git a/app/migrations/Version20170913125128.php b/app/migrations/Version20170913125128.php index 10bf022b08c2..e1eee588b580 100644 --- a/app/migrations/Version20170913125128.php +++ b/app/migrations/Version20170913125128.php @@ -20,21 +20,23 @@ public function up(Schema $schema) $this->addSql('ALTER TABLE sylius_order_item ADD product_name VARCHAR(255), ADD variant_name VARCHAR(255)'); - $this->addSql('UPDATE sylius_order_item - INNER JOIN sylius_order AS o ON sylius_order_item.order_id = o.id - INNER JOIN sylius_product_variant AS pv ON sylius_order_item.variant_id = pv.id - INNER JOIN sylius_product AS p ON pv.product_id = p.id - INNER JOIN sylius_product_translation AS pt ON pt.translatable_id = p.id - INNER JOIN sylius_order AS ol ON pt.locale = ol.locale_code - SET sylius_order_item.product_name = pt.name + $this->addSql(' + UPDATE sylius_order_item + INNER JOIN sylius_order ON sylius_order_item.order_id = sylius_order.id + INNER JOIN sylius_product_variant ON sylius_order_item.variant_id = sylius_product_variant.id + INNER JOIN sylius_product ON sylius_product_variant.product_id = sylius_product.id + INNER JOIN sylius_product_translation ON sylius_product_translation.translatable_id = sylius_product.id + WHERE sylius_product_translation.locale = sylius_order.locale_code + SET sylius_order_item.product_name = sylius_product_translation.name '); - $this->addSql('UPDATE sylius_order_item - INNER JOIN sylius_order AS o ON sylius_order_item.order_id = o.id - INNER JOIN sylius_product_variant AS pv ON sylius_order_item.variant_id = pv.id - INNER JOIN sylius_product_variant_translation AS pvt ON pvt.translatable_id = pv.id - INNER JOIN sylius_order AS ol ON pvt.locale = ol.locale_code - SET sylius_order_item.variant_name = pvt.name + $this->addSql(' + UPDATE sylius_order_item + INNER JOIN sylius_order ON sylius_order_item.order_id = sylius_order.id + INNER JOIN sylius_product_variant ON sylius_order_item.variant_id = sylius_product_variant.id + INNER JOIN sylius_product_variant_translation ON sylius_product_variant_translation.translatable_id = sylius_product_variant.id + WHERE sylius_product_variant_translation.locale = sylius_order.locale_code + SET sylius_order_item.variant_name = sylius_product_variant_translation.name '); $this->addSql('ALTER TABLE sylius_order_item CHANGE product_name product_name VARCHAR(255) DEFAULT NULL, CHANGE variant_name variant_name VARCHAR(255) DEFAULT NULL'); diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Order/Show/Summary/_item.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Order/Show/Summary/_item.html.twig index 0c3e4930bcbf..91e5b99083c0 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Order/Show/Summary/_item.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Order/Show/Summary/_item.html.twig @@ -6,7 +6,7 @@ {% set taxAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::TAX_ADJUSTMENT') %} {% set variant = item.variant %} -{% set product = item.variant.product %} +{% set product = variant.product %}