Skip to main content
added 89 characters in body
Source Link
Wajahat Bashir
  • 412
  • 1
  • 4
  • 24

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

enter image description here

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

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

enter image description here

added 129 characters in body
Source Link
Wajahat Bashir
  • 412
  • 1
  • 4
  • 24

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);
$locationCode$preorder =   $product->getData>getAttributeText('preorder');

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

enter image description here

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);
$locationCode = $product->getData('preorder');

$lines[0][] = [
    'text' => $locationCode,
     'feed' => 160,
];

enter image description here

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

Source Link
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);
$locationCode = $product->getData('preorder');

$lines[0][] = [
    'text' => $locationCode,
    'feed' => 160,
];

enter image description here