Migrating from Magento 1.9.4 to Magento 2.4.1 – use the The Magento Migration Tool OR do it manually?

I would also prefer you to use the Data Migration Tool.
First, you need to install the data migration via Composer.

Ensure that you must update the location of the Data Migration Tool package in the composer.json file to make it work.

To do that,run the following commands:

composer config repositories.magento composer https://repo.magento.com
composer require magento/data-migration-tool:<version>

Then, migrate settings using Magento 2 Data Migration Tool and start migrating your store by using the following command:

php bin/magento migrate:data --reset <path to your config.xml>

If your store was up and running do checkout the best SEO practices as well.

  • Analyze Your Google Analytics
  • Analyze Your Google Search Console
  • Check Your High Performing Keywords
  • Fix The 404 Errors
  • Analyze Your Robots.txt File
  • Analyze Sitemap.xml File
  • Analyze Your Canonical Tags
  • Don’t Change Your Meta Tags

It’s not a complete process of migration but just a quick overview. I hope, it might be helpful for you.

magento2.4.1 – Magento 2.4.1 PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 176128 bytes)

This error(Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in vendor/magento/framework/Serialize/Serializer/Json.php on line 37) is populated when we access the category page (this category is top level category which shows all products (we have only 20-24 configurable products)). Not each time but it come after 10-12 days interval on the production environment.

We recently upgraded our server memory from 4g to 8g to solve this issue but it is still there.

We use nginx and php-fpm

We also updated the memory limit from .user.ini file from both the location m2 root and Pub

Thanks in advance.

magento2 – Problem when install any thing using composer in magento 2.4.1

am trying to install any module using composer v.1 and v.2 but I get this error all the time

 Problem 1
    - The requested package laminas/laminas-servicemanager (locked at 2.7.11, required as ^3.6) is satisfiable by laminas/laminas-servicemanager(2.7.11) but these conflict with your requirements or minimum-stability.
  Problem 2
    - magento/magento2-base 2.4.1 requires laminas/laminas-servicemanager ^2.7.8 -> satisfiable by laminas/laminas-servicemanager(2.7.10, 2.7.11, 2.7.8, 2.7.9) but these conflict with your requirements or minimum-stability.
    - magento/magento2-base 2.4.1 requires laminas/laminas-servicemanager ^2.7.8 -> satisfiable by laminas/laminas-servicemanager(2.7.10, 2.7.11, 2.7.8, 2.7.9) but these conflict with your requirements or minimum-stability.
    - magento/magento2-base 2.4.1 requires laminas/laminas-servicemanager ^2.7.8 -> satisfiable by laminas/laminas-servicemanager(2.7.10, 2.7.11, 2.7.8, 2.7.9) but these conflict with your requirements or minimum-stability.
    - magento/magento2-base 2.4.1 requires laminas/laminas-servicemanager ^2.7.8 -> satisfiable by laminas/laminas-servicemanager(2.7.10, 2.7.11, 2.7.8, 2.7.9) but these conflict with your requirements or minimum-stability.
    - Installation request for magento/magento2-base (locked at 2.4.1) -> satisfiable by magento/magento2-base(2.4.1).


Installation failed, reverting ./composer.json to its original content.

importexport – Getting issue while importing product data in Magento 2.4.1

We are looking for solution in Magento 2.4.1 which can resolve our issue in data import

In our case the category name are like

Available Brands Migrated/Kitchen, Storage & Furniture/Cookware/Baking & Roasting Trays

So in this case Kitchen, Storage & Furniture is a single category but Magento taking it a comma separate making kitchen and Storage & Furniture as separate category. So does anybody have faced similar issue. The problem is that in CSV everything is comma separated but if category name have comma then how can we resolve this case.

magento2.4.1 – Magento 2.4.1 Out of Stock In last

I want to move out of stock product in last of the category listing, itried below code but same seems not working.

app/code/Meetanshi/StockQuantity/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
   <module name="Meetanshi_StockQuantity" setup_version="1.0.0"/>
</config>

app/code/Meetanshi/StockQuantity/etc/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
   <event name="catalog_block_product_list_collection">
       <observer name="stockLast" instance="MeetanshiStockQuantityObserverStockLast" />
   </event>
</config>

app/code/Meetanshi/StockQuantity/Observer/StockLast.php

<?php
namespace MeetanshiStockQuantityObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkAppConfigScopeConfigInterface;
use MagentoStoreModelStoreManagerInterface;
use MagentoFrameworkEventObserver;
use MagentoCatalogBlockProductProductListToolbar as CoreToolbar;
class StockLast implements ObserverInterface
{
   protected $scopeConfig;
   protected $_storeManager;
   protected $coreToolbar;
   public function __construct(
       ScopeConfigInterface $scopeConfig,
       StoreManagerInterface $storeManager,
       CoreToolbar $toolbar
   )
   {
       $this->scopeConfig = $scopeConfig;
       $this->_storeManager = $storeManager;
       $this->coreToolbar = $toolbar;
   }
   public function execute(Observer $observer)
   {
       $collection = $observer->getEvent()->getData('collection');
       try {
           $websiteId = 0;
           $stockId = 'stock_id';
           $collection->getSelect()->joinLeft(
               array('_inv' => $collection->getResource()->getTable('cataloginventory_stock_status')),
               "_inv.product_id = e.entity_id and _inv.website_id=$websiteId",
               array('stock_status')
           );
           $collection->addExpressionAttributeToSelect('in_stock', 'IFNULL(_inv.stock_status,0)', array());
           $collection->getSelect()->reset('order');
           $collection->getSelect()->order('in_stock DESC');
           //code for Filter Price Low to High or High to Low with stock filter.
           if ($this->coreToolbar->getCurrentOrder() == 'price') {
               $direction = $this->coreToolbar->getCurrentDirection();
               $collection->getSelect()->order("min_price $direction");
           }
       } catch (Exception $e) {
       }
       return $this;
   }
}

magento2.4.1 – curl_exec issue in Magento 2.4.1 and PHP 7.4.x

I have following code in the Magento site for getting external site data in PHP file, this worked fine in Magento CE 2.3.6 site but getting HTTP error code 400(Bad Request) after upgrading Magento to CE ver. 2.4.1-p1. I came across cURL way of making calls in Magento 2 but couldn’t find any documentation on why current code wouldn’t work.

Any ideas on what the issue is here?

const EXT_URL = "http://www.myexturl.com/blah/";
$ch = curl_init();
$myurl = self::EXT_URL . $param1 . "/" . $param2;
print_r($myurl);

curl_setopt($ch, CURLOPT_URL, $myurl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$s_output = curl_exec($ch);
// Getting 400 error code -- Bad Request. Your browser sent a request that this server could not understand.
print_r($s_output);

Note that the external URL call with hard coded parameters work fine from the browser and using curl command inside the Magento server, so it’s not a firewall or network issue.

Magento2: how to remove edit product link from minicart (2.4.1)

I have attempted to follow lots of answers on here which cover overriding the minicart via a new extension/module.

I have successfully removed all the edit links from the cart by adding the file:
checkout_cart_index.xml
to this location:
/app/design/frontend/BlackRhino/luma/Magento_Checkout/layout/

Which looks like this:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
    <body>
    <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.virtual.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.giftcard.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.grouped.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.downloadable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.bundle.actions.edit" remove="true"/>
</body>

Can I do the same for the minicart?

I have tried copying the file from this location:
/vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html

Various locations seem to be suggested:
/app/design/frontend/BlackRhino/luma/Magento_Checkout/web/template/minicart/item/
/app/design/frontend/BlackRhino/Magento_Checkout/web/template/minicart/item
/app/code/BlackRhino/BlackForest/template/minicart/item/

I’ve tried all of these locations with deploying static content (although its in developer mode) but the pencil prevails.

I don’t know if things have changed recently, quite alot of the questions appear to be 3-4 years old in some cases and I wonder if the recent changes now require a slightly different approach?

I have also tried to override this file:
/vendor/magento/module-checkout/view/frontend/requirejs-config.js
by placing one here with an alternative location like this:

var config = {
map: {
    '*': {
        'Magento_Checkout/template/minicart/content.html':
            'BlackRhino_BlackForest/template/minicart/content.html'
    }
}

};

but this answer Magento 2: How to override mini-cart default template html file? doesn’t make it clear where the alternative file should be located and again is 5+ years old.

I wonder if someone could put me out my misery and tell me where I have gone wrong and which one of these solutions should work and how I can get it to work please?