Category: web development
-
Magento2 Wrong create options MYSQL Error
On transferring a Magento website Database running on MySQL 5.7.34 to MariaDB 10.2.39, I get the following error: SQL Strict mode was already off on this MySQL server. To fix the problem, edited the db.sql file, added below line at the top of the file. After this change, the restore worked without any error. Tweet…
-
Magento2 Folder and Files Permissions
We all are developers and generally we do mistake in files and folders permission. It might be intentionally to fix any issue or by mistake. But how to fix the permissions back when it happened. Just go to your Magento setup root folder and run these all commands: Tweet This Post
-
Magenta Connect – Access is locked. Please try again in a few minutes
Getting error on Magento connect manager “Access is locked. Please try again in a few minutes.” Go to var/ folder and open file /var/brute-force.ini Change the following two first lines to: brute-force-bad-attempts-count = 0 brute-force-diff-time-to-attempt = 180 and remove all other lines and Save. Tweet This Post
-
How to replace string in parentheses using regex
PHP, Java and other languages provide replace all functionality to replace any character by any specific character. But REGEX is best method to replace or remove any specific value using pattern. Suppose, we have input string is $xyz = “This is my best (friend)”; and we want to remove words from “()”. So it so…
-
How to programmatically add shipment with a tracking number to any order : PART II
In my previous post [How to programmatically add shipment with a tracking number to any order : PART I], you found that how can we generate shipment for an order programmatically. Here we are going to learn next step to add tracking number with generated shipment. We are assuming that you are going to use…
-
How to programmatically add shipment with a tracking number to any order : PART I
We are assuming that we have an order incremented id. and we want to make shipment for this order. Here also we are assuming that invoice has been generated for order already. so we are going to generate only shipment. $orderId = ‘1000001’; $order = Mage::getModel(‘sales/order’)->loadByIncrementId($orderId); Here we are checking the current status of order…
-
How to get ordered Items and their detail for an order ID in Magento?
I tried to wrote this code when I was working on a cron file for all orders. My client wants a cron file that get all orders information including all ordered item and their detail. First, I searched on google but I didn’t found any exact solution then I tried below code: By below code…
-
How to add custom layout template in Magento
Magento provides following types of page layout in default. 1column, 2columns-left, 2columns-right, 3columns, empty, and print. But sometimes we need to change design in layout and we do not want to affect on other pages. For example, we want to use different layout for all static pages. and we want to use 2columns-left layout style…
-
Magento: How to merge multiple fields in a colum in Magento admin panel grid?
Magento provides lot of inbuild functionalities. Using “protected function _prepareColumns()” function we can create or add new column to the grid. Like: protected function _prepareColumns() { $this->addColumn(‘first_name’, array( ‘header’ => Mage::helper(‘custommodule’)->__(‘First Name’), ‘align’ => ‘left’, ‘width’ => ’50px’, ‘index’ => ‘first_name’, )); $this->addColumn(‘last_name’, array( ‘header’ => Mage::helper(‘custommodule’)->__(‘Last Name’), ‘align’ => ‘left’, ‘width’ => ’50px’, ‘index’…
-
Fatal error: Call to a member function addFieldToFilter() on a non-object in magento
Have you upgraded your magento version OR installed any module/extension manually? If you getting this error: “Fatal error: Call to a member function addFieldToFilter() on a non-object ……” after doing any step above then you have to following steps to solve: Step 1: Re-index the all tables. a) To re-index Go to your site admin…
-
Magento: Fatal error: Call to a member function getModelInstance() on a non-object in appMage.php on line
Today we are working on cron file that will call all model methods of my custom module. But we are getting error: “Magento: Fatal error: Call to a member function getModelInstance() on a non-object in appMage.php on line 141”. when we are using: require_once ‘app/Mage.php’; $customobj = Mage::getModel(‘custommodule/custommodule’); It was amazing for us that we…
-
Magento: Free shipping without shipping method
Sometimes we need to give free shipping on some specific conditions but we do not want to enable free shipping method. Then what to do? After did much R&D and read many blogs I found a solution. It was so simple, it is possible by shopping cart price rule. First disable to Free shipping method…
-
Magento: How to enable template path hints?
Magento comes with many folders and its structure is complex. In general, it is not easy to find the perfect file to edit for a specific section. Because there may be many folders with same name in different directories. you are thinking then What is template path hints? Template path hints is just a tags…
-
What is Memcached?
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Memcached is simple yet…
-
Magento: How to debug error quickly
Magento provides log file to maintain each type of error on your application. By this you can add log error or exception to magento’s system log file. Its very handy to view coding errors. Developing for Magento is often hard, especially since it’s not always possibly to have error reporting on (and even when it…