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(); } /**