Magento 2 Commands List and their usage

Add Custom Category Attribute Magento2 Extension Free

USER GUIDE

  1. How to Register Module in Magento 2
  2. Tell Magento Which Extesions to Be Included
  3. Register Attribute in our Core
  4. Add Code for showing Attribute to set value from Admin Dashboard  

After Registering Tell Magento to Load Our Extension

Not it’s time to Implement Logic, Here are we Registering our Attribute for Category which will be Boolean Formed.

Now we have to add Admin side option in Category options to set value of our Attribute.

Hurrayyyy… That’s all needed Now run Following commands according to your Installation.

]]>

Magento 2 Commands List and their usage

How to Create Barcode in Magento 2 Invoice PDF

Magento 2 facilitates the merchants to provide multiple things in invoice PDFs like order id, customer name, shipping address, product name, product quantity, product price, total amount, and so on.

However, depending on the business requirements, customization in invoice PDF can be done.

One such customization solution is offered in this post to create barcode and add it in Magento 2 invoice PDF.

Barcode in invoice PDF helps the customer to scan and get the order id using which it is easy to get order details.

Steps to Create Barcode and Add it in Magento 2 PDF Invoice

1. Create di.xml file at Vendor\Extension\etc

 

2. Create Invoice.php file in Vendor\Extension\Plugin\Invoice.php

Done! That’s what you need to do.

 

For Details Visit Cozmot.com 

Follow us on Facebook and visit Our Blog]]>

What's New in PHP 8.0 Release a Major Update of the PHP language

What's New in PHP 8.0 Release a Major Update of the PHP language

Named arguments

  • Specify only required parameters, skipping optional ones.
  • Arguments are order-independent and self-documented.

Attributes

Instead of PHPDoc annotations, you can now use structured metadata with PHP’s native syntax.

Constructor property promotion

Less boilerplate code to define and initialize properties.

Union types

Instead of PHPDoc annotations for a combination of types, you can use native union type declarations that are validated at runtime.

Match expression

The new match is similar to switch and has the following features:
  • Match is an expression, meaning its result can be stored in a variable or returned.
  • Match branches only support single-line expressions and do not need a break; statement.
  • Match does strict comparisons.

Nullsafe operator

Instead of null check conditions, you can now use a chain of calls with the new nullsafe operator. When the evaluation of one element in the chain fails, the execution of the entire chain aborts and the entire chain evaluates to null.

Saner string to number comparisons

When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to a string and uses a string comparison.

Consistent type errors for internal functions

Most of the internal functions now throw an Error exception if the validation of the parameters fails.

]]>

How to get Product Grid by Category ID Magento2

How to get Product Grid by Category ID Magento2

Another solution if you only wanna fetch Products 

Object Manager Usage Good and Bad: ]]>