Adding new category attribute in Magento 2

Sometimes you need to extend functionality of Magento 2 categories. In this article I would like to show you how to add a new custom category attribute. Let’s say, this attribute is needed to display/hide some content on the category page. Now let’s write our installation script under Setup folder. I’ve included comments within to guide you along. Note that the custom variable I’m adding is called hide_this_category. This attribute

View Full Post

Magento 2 – How to add calendar in admin configuration options?

Recently I have found one solution to add calendar in system configuration options. Lets discuss in detail. In order to add calendar in system configuration options, we have to add one system field and require one Block file. Use below code to add system field.

Now lets create Block file – Calendar.php Download Free Most Viewed Products Extension

Lets discuss some terms used in this block. Magewallet –

View Full Post

How to get current CMS page id in Magento2

To get the id of current CMS page in Magento 2, use the following code snippet.

There are so many other methods to get CMS page details like title, identifier, content, and content heading. Lets check one by one. To get the identifier of the current CMS page you can use

To get the Page Title :

To get the Page Content :

To get the

View Full Post

Magento 2 – How to add WYSIWYG editor in admin configuration options?

In this blog post, we learn how to add WYSIWYG editor with textarea in admin system configuration options. First we will add one system config field in system.xml file. Use below code to add new field with the type Editor. Download Free New Order Notification Extension

In order display WYSIWYG editor with this textarea we need one frontend block. so you can create editor.php file at below location. Download

View Full Post

How to get parent product id in Magento 2?

As you know when we works with any customization work related to configurable product and simple product, we need some code snippet that helps us to find out the relation between parent and child product. Lets take one example, when we have one simple product (child product) and we need all the simple (child) product associated with its parent product. In this case we require solution that gives us Parent

View Full Post