Skip to main content

E-commerce Platforms

E-commerce Platforms

Sending an email with PDF attachment in Magento

in this script we will mention two ways to add an attachment to an email in Magento2, one is for Magento 2.4.6 and less and the another one for Magento < 2.4.6 or 2.4.8 in specifc 

 

first of all override the templatebuilder clas

in the di.xml add his 

    <preference for="Magento\Framework\Mail\Template\TransportBuilder" type="Vendor\Module\Rewrite\Magento\Framework\Mail\Template\TransportBuilder"/>

now add this class (Magento 2.4.8)

Checking Magento 2 Custom Code for PHP Version Compatibility

🧪 Checking Magento 2 Custom Code for PHP 8.2 Compatibility

As of Magento 2.4.6+, core support for PHP 8.2 is stable — but ensuring your custom modules and themes are compatible is crucial before upgrading your environment.

This guide walks you through using PHPCompatibility + PHP_CodeSniffer to audit your code for PHP 8.2 issues.


🛠️ Step 1: Install PHPCompatibility & PHPCS

Start by requiring the tools via Composer:

Magento Tip: Move an Attribute to Another Attribute Group and Adjust Display Order

When working with Magento's EAV model, it's common to reorganize attributes across different attribute sets or groups — especially when customizing product forms in the admin panel. Here's a quick tip on how to move an attribute to the same group as another attribute and place it right next to it.

Let’s say you have: