Recently, I installed a plugin that send the order details to WhatsApp, I did some changes on this to fit more for that I need, but now I have a problem and no ideia how to resolve, basically I need the attribute name and value after the user selected in this message as well I tried many ways and nothing work.
I tried this:
$product = $product->get_id();
$attr = $product->get_attribute( 'Tamanhos' ); // 'Tamanhos' is my attribute in admin panel
echo $attr;
Its show me my product ID perfectly but I got a error: "Fatal error: Uncaught Error: Call to a member function get_attribute() on int"
$product->get_id(); works good but the $product->get_attribute( 'tamanhos' ) have this error.
Someone know how how can I get the attribute name and value that user selected from a product?