Scommerce Mage

Knowledge base

The latest magento articles and tutorials

Latest posts


How to uninstall modules in Magento 2?

Installing module in Magento 2 is far easier than uninstalling Magento 2 module(s) so today we are going to cover how to uninstall Magento 2 modules from your webstore without leaving any trace of that module on your filesystem and database 🙂 Here is the step to step guide to uninstall any third party module … Continue reading “How to uninstall modules in Magento 2?”

Read more

Magento server hacked or compromised

Here is the step by step guide if your Magento server hacked or compromised -: Step 1 – Check for infected services or files on the server by installing antimalware solution like chkrootkit scanner wget –passive-ftp ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz tar xvfz chkrootkit.tar.gz cd chkrootkit-*/ make sense Once installed, you can move the chkrootkit directory to /usr/local/chkrootkit and … Continue reading “Magento server hacked or compromised”

Read more

Check large files or folders on your Magento or Linux folders

Here is the simple tricks and number of commands to find out the disk space used on your Linux server First of all check size of the whole server disk space by using the following simple command -: df -h The output should look like this -: Now you can check which folders are large … Continue reading “Check large files or folders on your Magento or Linux folders”

Read more

Magento 2: Fatal error: Cannot redeclare class

We were writing our new module Canonical URL in Magento 2 which allows you to set your own canonical tag on product, category and CMS pages but while we were buiding this module we came across the following fatal error related to cannot redeclare class -: It took our development team a while to figure … Continue reading “Magento 2: Fatal error: Cannot redeclare class”

Read more

Override core javascript files in Magento 2

Override core Javascript files in Magento 2 Today we are going to talk about how to Override core Javascript files in Magento 2 in your own custom module. We had a requirement to add custom attribute to checkout which we are not covering in this post but we will talk about how to override Magento_Checkout/js/model/shipping-save-processor/default … Continue reading “Override core javascript files in Magento 2”

Read more

Add custom JS or Jquery plugin in Magento 2

As you might know, Magento 2 comes with some good javascript libraries like knockoutJS, requireJS, jQuery. Today we are going to cover simple way to add jquery plugin i.e. jquery_cookie in our module. Let’s get started -: Step 1: Create requirejs-config.js under Scommerce\Custom\view\frontend\ folder with the following code Step 2: Add jquery_cookie.js under Scommerce\Custom\view\frontend\web\js\ folder … Continue reading “Add custom JS or Jquery plugin in Magento 2”

Read more

Magento 2 logging

Today we are going to talk about Magento 2 logging. Logging is the most effective and important way for developers to find out where things are going wrong in their code. Magento 2 comes with built-in logging feature which is based on Monolog library. You can find this library under “/vendor/monolog” of your Magento 2 … Continue reading “Magento 2 logging”

Read more

Save order custom field in sales_order_after_save event

Morning folks, hope you are well, we had a requirement to set a flag in our enhanced ecommerce module after sending offline data to Google Analytics using measurement protocol. To set this flag we called sales_order_after_save event by adding entry in config.xml then we created observer.php and defined sendOrderDataToGoogle function as mentioned in our config.xml … Continue reading “Save order custom field in sales_order_after_save event”

Read more

Magento 2 quick tips and tricks

As you might know our team is busy creating Magento 2 extensions and progress can be seen by clicking on the following link http://www.scommerce-mage.co.uk/extensions-for-magento-2.html. Also if you have any Magento 2 extension in mind then please feel free to send us your idea to us via email (core@scommerce-mage.co.uk) and if we like your idea then … Continue reading “Magento 2 quick tips and tricks”

Read more

How to add js css or less with your custom module in Magento 2

Today we are going to learn about how to add JS, CSS or Less in Magento 2, there are several ways to add JS, CSS or Less in Magento 2 but we are going to cover the most simple and straight forward method. This is the most common requirement for any custom module so hopefully … Continue reading “How to add js css or less with your custom module in Magento 2”

Read more
Load more on scroll