Category Archives: Magento

How to add ecommerce tracking with gtag in magento order success

Every merchant wants to track their sales in google analytics. Currently google have changed google analytics (GA) to google tag manager(GTag). If you use gtag.js as your Google Analytics tag and you have Ecommerce reporting enabled, you can measure ecommerce transactions. To measure a transaction, send a purchase event with the items in the transaction. For example: <script… Read More »

how to block requests with specific string using .htaccess in apache

These days common problem of hacking of website by hacker with scrips. They always use some common method or string to hack it. Now you can prevent these requests by adding some simple .htaccess rules. You could send a 403 Forbidden (access denied) in case -admin is requested : RewriteEngine On RewriteCond %{REQUEST_URI} ^/(.*?)admin RewriteRule ^(.*)$ – [F,L]  … Read More »

Magento 1.9.4.1 Invalid header line detected error

HTTP headers are the name or value pairs that are displayed in the request and response messages of message headers for Hypertext Transfer Protocol (HTTP). Usually, the header name and the value are separated by a single colon. HTTP headers are an integral part of HTTP requests and responses. In simpler terms, HTTP headers are… Read More »

WHM cpanel magento 2 php cli command error

If you saw error php-cli: command not found when running magento command php bin/magento, then you need to run following commands. To fix this error, you need to enable php cli mode. Run following command source /opt/cpanel/ea-php72/enable It will solve your problem. but it will come again when you will reboot your server. You need… Read More »

SetEnv fails with Apache 2.4

If Apache error logs show below error message Invalid command ‘SetEnv’, perhaps misspelled or defined by a module not included in the server configuration The control of internal environment variables that are used by various Apache HTTP Server modules are controlled by the module mod_env. By default module ‘mod_env’ will not be enabled in apache2.4.… Read More »

How we can add each type of attribute filters in magento

Sometimes we need to add custom condition on product listing or some custom pages to fetch data. Here you will how easily we can add conditions with addAttributeToFilter .  addAttributeToFilter is a method that can be called on EAV collections in Magento. This includes product collections, category collections, customer collections and many more. In short,… Read More »