From 70fed940a40e0b2109b3bac9fe2f4f25fe4d0ac5 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Fri, 25 Jan 2019 21:28:18 +0530 Subject: [PATCH 1/3] issue #438 --- packages/Webkul/Product/src/Helpers/View.php | 16 +++- .../views/layouts/header/index.blade.php | 83 +------------------ 2 files changed, 18 insertions(+), 81 deletions(-) diff --git a/packages/Webkul/Product/src/Helpers/View.php b/packages/Webkul/Product/src/Helpers/View.php index 87e67842b..26d887b84 100755 --- a/packages/Webkul/Product/src/Helpers/View.php +++ b/packages/Webkul/Product/src/Helpers/View.php @@ -16,13 +16,25 @@ class View extends AbstractProduct $attributes = $product->attribute_family->custom_attributes; + $attributeOptionReposotory = app('Webkul\Attribute\Repositories\AttributeOptionRepository'); + foreach ($attributes as $attribute) { if ($attribute->is_visible_on_front && $product->{$attribute->code}) { + $value = $product->{$attribute->code}; + + if ($attribute->type == 'select') { + $attributeOption = $attributeOptionReposotory->find($value); + + if ($attributeOption) { + $value = $attributeOption->translate(app()->getLocale())->label; + } + } + $data[] = [ 'code' => $attribute->code, 'label' => $attribute->name, - 'value' => $product->{$attribute->code}, - ]; + 'value' => $value, + ]; } } diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php index 59c6780e5..8764994b6 100755 --- a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php @@ -30,7 +30,6 @@
- - {{--
- @if (core()->getCurrentChannel()->currencies->count() > 1) - - @endif - - - - -
--}} -
@@ -202,7 +126,6 @@
- @push('scripts')