From 01a5adedb7f52f4d9995d3e9b0fcb2ce138acbbd Mon Sep 17 00:00:00 2001 From: vikas vishwakarma Date: Fri, 31 Jan 2025 10:32:17 +0530 Subject: [PATCH] issue #10517 fixed --- .../Webkul/Product/src/Type/AbstractType.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index 1fe4829a082..1f44ba45a14 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -532,20 +532,31 @@ public function canBeAddedToCartWithoutOptions() public function getEditableAttributes($group = null, $skipSuperAttribute = true) { if ($skipSuperAttribute) { - $this->skipAttributes = array_merge( + $this->skipAttributes =array_merge( $this->product->super_attributes->pluck('code')->toArray(), $this->skipAttributes ); } - + if (! $group) { return $this->product->attribute_family->custom_attributes()->whereNotIn( 'attributes.code', $this->skipAttributes )->get(); } - - return $group->custom_attributes()->whereNotIn('code', $this->skipAttributes)->get(); + + return $group->custom_attributes() + ->select( + 'attributes.*', + 'attribute_translations.name as admin_name', + 'attribute_translations.locale', + ) + ->whereNotIn('code', $this->skipAttributes) + ->leftJoin('attribute_translations', function ($join) { + $join->on('attributes.id', '=', 'attribute_translations.attribute_id') + ->where('attribute_translations.locale', '=', app()->getLocale()); + }) + ->get(); } /**