How to Get Gender Value by the Customer id Magento 2?

You can retrieve the customer Gender value in Magento 2 by email or customer id. Customer Gender is visible in the frontend only if the storefront allows it to display in front otherwise it will be set from the Customer Admin panel with the customer edit section.

If you have set customer gender for the customer data and want to fetch the selected value of the gender you can do it using the customer Metadata interface. Continue reading “How to Get Gender Value by the Customer id Magento 2?”

How to write text file and create directory in Magento 2 standard way?

You can write the content dynamically in text(.txt) file using Programmatic way with Magento 2 Standard approach.

Sometimes you need to create a directory and write a text file in the specific location of the system, You can add the content with interface Magento\Framework\Filesystem\Directory\WriteInterface. Continue reading “How to write text file and create directory in Magento 2 standard way?”

How to add Cms Page Custom Layout Update file in Magento 2.3.4?

From Magento 2.3.4, For the security enhancements, default custom layout update Textarea removed from the CMS page admin section.

If you want to add XML code snippet for the CMS Page, You must have to create a CMS Page layout handle for the page.

If you want to add Custom layout update code for the About Us page, You need to create a unique XML handle for the CMS page. Continue reading “How to add Cms Page Custom Layout Update file in Magento 2.3.4?”