Skip to main content
deleted 45 characters in body
Source Link

Try this, hope this is what looking for

if ($product->getCustomAttributes()) {
        $attribute_value = $product->getCustomAttribute('attribute_code') ?  $product->getCustomAttribute('attribute_code')->getValue() : '';
        return [
            'msg' => $attribute_value ,
        ];$attribute_value;
}

Try it and do let me know. Peace :)

Try this, hope this is what looking for

if ($product->getCustomAttributes()) {
        $attribute_value = $product->getCustomAttribute('attribute_code') ?  $product->getCustomAttribute('attribute_code')->getValue() : '';
        return [
            'msg' => $attribute_value ,
        ];
}

Try it and do let me know. Peace :)

Try this, hope this is what looking for

if ($product->getCustomAttributes()) {
        $attribute_value = $product->getCustomAttribute('attribute_code') ?  $product->getCustomAttribute('attribute_code')->getValue() : '';
        return $attribute_value;
}

Try it and do let me know. Peace :)

Source Link

Try this, hope this is what looking for

if ($product->getCustomAttributes()) {
        $attribute_value = $product->getCustomAttribute('attribute_code') ?  $product->getCustomAttribute('attribute_code')->getValue() : '';
        return [
            'msg' => $attribute_value ,
        ];
}

Try it and do let me know. Peace :)