Author: mohamed
-
CWP Option FollowSymLinks not allowed here
look for this line <Directory “%docroot%”> and replace it with the following go to your cpanel https://yourdomain:2083/from side menu go to Domains-> AutoSSL check Installed Certificates card and click renew for the domain affected
-
Magento 2 wysiwyg upload error {file} was not uploaded. File validation failed.
The cause of this error in Magento 2 is missing php extension imagick or fileinfo both should be installed on the server you can check if they are installed by creating new file in your Magento 2 root directory/pub you can name it info.php and add this to the file and access it from https://yourdomain.com/info.php…
-
Magento 2 : Understand layout XML files
. What is a Layout XML File? “A layout XML file in Magento is like a blueprint for your page. It defines the structure and content of a page using XML.” 2. Creating the Layout Directory In our root module path we will create the file in this location frontend/layout/kickstart_index_index.xml 3. Understanding the URL Anatomy…
-
Magento 2: Return a standard page
Creating a Basic Page Response Magento provides a class to render a blank page that we can build upon. Here’s how to create a basic page response in our index controller. Conclusion Creating a standard blank page is an essential step in Magento module development. It ensures that the response aligns with Magento’s layout system,…
-
Create Custom Payment Methods in Magento 2.4.7
First we create our module registration.php in app/code/Itcforu/CustomPayment/registration.php Now we create module.xml in app/code/Itcforu/CustomPayment/etc/module.xml Create system.xml file app/code/Itcforu/CustomPayment/etc/adminhtml/system.xml Now we create config.xml in app/code/Itcforu/CustomPayment/etc/config.xml Now we create our model app/code/Itcforu/CustomPayment/Model/CustomPayment.php We create this custom payment method for use in create order in admin panel only not in checkout page if you want me to make…
-
Creating Your First PHTML Template in Minutes
Magento uses the .phtml extension for template files, which are PHP files primarily used to output HTML. Magento’s PHTML format includes syntactic sugar for rendering logic like loops and conditionals, making it easier to integrate PHP logic in these templates. Template File Location Magento modules store presentational layer files in the view directory. Depending on…
-
Level Up Your Magento Code with Class Preferences (No More Spaghetti!)
In Magento 2, managing dependencies between different parts of your code is crucial. This lesson will show you how to use XML to define class preferences, a powerful technique for achieving loose coupling and promoting code flexibility. What are Class Preferences? Imagine you have an interface called CategoryInterface that outlines methods for interacting with…
-
Unlocking The Power Of Interfaces In Magento 2!
Interfaces play a vital role in Magento 2 development. Here’s why: Abstraction: They decouple your code from concrete implementations, making it more flexible and adaptable to changes. Extensibility: Interfaces promote modularity, allowing third-party developers to extend or modify functionality without affecting your core code. Testability: Interfaces make it easier to write unit tests by allowing…
-
How to check Magento 2 version
There´s many Magento 2 versions and editions. Sometimes you need to know, which exactly version of Magento you´re running – for example, for planning upgrade. Here is a few tricks, which will show your actual version of Magento 2. Special Magento 2 version page The simplest way to know, which version you are running without…
-
Constructor Property Promotion
With the advent of Magento 2.4.4 and subsequent versions embracing PHP 8, we’re poised to leverage the innovative constructor property promotion feature introduced in PHP 8. This powerful feature streamlines our coding efforts significantly. Traditionally, the practice involved declaring a class property separately and then initializing it within the constructor. Constructor property promotion elegantly condenses…