Categories: General

How to Change Admin Sales Order Grid Row Color Base on COD payment method in Magento.

Ecommerce payment methods are one of the important factors behind the success of stores. Even though there are various payment methods available online, but cash on delivery is still a hot favorite & trustable payment method compared to other available methods. According to a recent survey, 70 % of shoppers ate likely to use Cash on Delivery to prevent their self from online transnational frauds. Understanding customer convenience and providing better service is must to be ahead in online E-commerce competition. But everything doesn’t end up here when you store get thousands of orders every day it will become more difficult to identify that which orders are placed using Cash on Delivery Payment method.

So, we are back with an interesting trick that will help you to identify that which orders are placed using Cash on Delivery Payment method directly from the Sales Order Grid in Magento 2.

To do the same, first we need to override “Adminhtml_Sales_Order_Grid” file by creating new “config.xml” file.
In this file override Adminhtml_Sales_Order_Grid.
app\code\local\Vendor\Extension\etc\config.xml

    
        
            Vendor_Extension_Block
        
        
            
              Vendor_Extension _Block_Adminhtml_Sales_Order_Grid
            
        
    

Now we need to create one more file “grid.php” file at below location.
app\code\local\Vendor\Extension\Block\Adminhtml\Sales\Order\Grid.php


app\code\local\Vendor\Extension\Block\Adminhtml\Sales\Order\Renderer.php

‘; return $orderId; } else{ return $orderId; } } }

That’s it. Simply clear cache and you are done with coloring Cash on Delivery Payment method orders in Magento Sales Order Grid. You can even use or customize this code according to your need for colouing different grids with your specified condition. Also, you can track all admin action activities by installing Magento 2 Admin Actions Log Extension.
That’s it for today, Let us know if you are facing an issue while implementing using this code by commenting below.
Happy Coding!

Click to rate this post!
[Total: 4 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

Recent Posts

Magento 2: Add Quantity Increment and Decrement on Category Page

Hello Magento Friends, In this blog, we will discuss about adding quantity increment and decrement…

4 hours ago

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

3 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

5 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

5 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

6 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

1 week ago