How to override cart/item/default.phtml in Magento 2?

For override default.phtml file in Magento 2, We need to create the plugin for it. We need to override Magento\Checkout\Block\Cart\AbstractCart Block file to override default.phtml in the module.
create the file at the location in your module.

I have created a module with Rbj/CartItem as {Namespace/Modulename},
app/code/Rbj/CartItem/etc/di.xml file,

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- override cart/item/default.phtml file -->
    <type name="Magento\Checkout\Block\Cart\AbstractCart">
        <plugin name="item-test" type="Rbj\CartItem\Plugin\Cart\AbstractCart" sortOrder="1"/>
    </type>
</config>

Create plugin file at below location in your module,
app/code/Rbj/CartItem/Plugin/Cart/AbstractCart.php

<?php
namespace Rbj\CartItem\Plugin\Cart;
class AbstractCart
{
    /*
    *   Override cart/item/default.phtml file
    *   \Magento\Checkout\Block\Cart\AbstractCart $subject
    *   $result
    */
    public function afterGetItemRenderer(\Magento\Checkout\Block\Cart\AbstractCart $subject, $result)
    {
        $result->setTemplate('Rbj_CartItem::cart/item/default.phtml');
        return $result;
    }
}

Create template file in your module view folder,
app/code/Rbj/CartItem/view/frontend/templates/cart/item/default.phtml
Keep your content in default.phtml file to override Cart module default template.

How to get product image url in Magento 2?

In the e-Commerce Site, Each Product contains unique images like Small Images, Base images, and thumbnail images.

Many times in custom development we need to required get the product URL in Magento 2. If you are developing some features related to images and want to retrieve the image URL, You can achieve the image full URL by referring to this article.

If you are dealing with PWA stuff and want to fetch the product image URL by GraphQL, Get Product Image URLs with GraphQl Continue reading “How to get product image url in Magento 2?”

What is the use of search_query table in magento 2?

In Magento 2 search_query database table store the search query, which users have searched using the search box in Magento 2.
— query_text field in a search_query table in stores the value of search string. When User search through site, all of the search entry will be added to search_query table in query_text field.
num_results field used for Number of results for specific word in the site. That field show count of any string search in site.
— popularity field is displayed popularity of specific word in your site, the Biggest number will have the most popular search word for your site.
store_id will show search from a specific store.
There are some other field also available in search_query table but above field is the main field of a table.

You can check from the admin panel, all of the search query will be shown from Search Terms sectino.
Click on Marketing -> SEO & Search -> Search Terms
You will get all the search result grid for your site.