Skip to main content
2 of 3
added 129 characters in body
Wajahat Bashir
  • 412
  • 1
  • 4
  • 24

Add Custom Attribute Text In PDF Invoice after Product Name in Magento 2.4.0

How to i can add attribute text in pdf invoice after product name in Magento 2.4.0 ?

I am writing this code but not effecting.

$id = $item->getProductid();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($id);
$preorder =   $product->getAttributeText('preorder');

 if($preorder == "Yes") {
   $lines[][] = [
   'text' => $this->string->split('Pre Order', 10, true, true),
   'feed' => 125,
   'height' => 0,
    ];
  }

enter image description here

Wajahat Bashir
  • 412
  • 1
  • 4
  • 24