Archives of Magento 2 Tips

Using Someone’s Module in your File

Assuming a module developer has setup a composer.json file, and you can access their source code repository, you’ll be able to use it in your project. If the module developer has listed their package in packagist, the only thing you’ll need to add to your project’s composer.json file is the following require:{ //... "pulsestorm/module-name":"dev-master" //... }   The above code […]

PHP Primer: Interfaces

On a “what they do level”, interfaces are pretty simple. Consider the following PHP class We’re all (I hope!) familiar with the idea of one class extending another. Interfaces allows a PHP class to do something else. With interfaces, a PHP class may also implement something <?php class Foo extends Bar implements BazInterface { } In the above […]

File & Folder permission problem

After installing Magento 2, we have to update permission follow this guide: https://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html Basically, this guide does not work with some web server that uses Fast-CGI which use permission 755 for folders and 644 for files. But if Magento generates new files or directories, those will have the permission 770 and 660 again. You can edit those […]

How to check display shipping method base on condition ?

How to check display shipping method base on condition ? In magento 2, as we know we have free shipping is shipping base on price to display, we can make other shipping display base on condition (based on order total, country, …). In this article, we will take an example to check whether dispay a […]