How to change the order status from COMPLETED TO CLOSED in Magento?

 To Translate the words in Magento:


app/design/frontend/Package_Name/Theme_Name/i18n/en_US.csv file and add the following rows:

"Add to Cart", "Purchase"
"Add to Compare", "Compare"
"Add to Wish List", "Wishlist"

Then run :

php bin/magento setup:static-content:deploy -f
change directories according to your theme

How can i Import all categories into Magento Site ?

How to Import all Categories into Magento website

To import all categories and products to your Magento website, we need to follow the following instructions.

  1. Create all categories and create one product on your Magento website
  2. Then export the data and keep that file with you.
  3. Now arrange the data which you want to import into the website, that total has to be arranged in the format which like your exported data.
  4. After arranging you can easily import the data into your Magento website.

Note:  After import the data, you need to make reindex.

How to redirect my Magento website from HTTP to HTTPS ?

To redirect a Magento website from HTTP to HTTPS, I think which Magento version you are using is not an important one.  

You just follow these following steps:

  1. Your host/PHPMyAdmin
  2. Select your database from the existing
  3. Find for the table `core_config_data` in that
  4. Now, change the secured and unsecured URLs here, like https://www.domain.com/

New order confirmation email is not being sent on Magento website

We have 2 methods to send the confirmation emails from our Magento 1 website.

  1. Using Cron
  2. Avoiding Cron

If you want to avoid the Cron :

Open the file order.php file from the following path:

app/code/core/Mage/Sales/Model/Order.php

Line#1356,1450

Change the following

    //$mailer->setQueue($emailQueue)->send(); 

to the following:

    $mailer-> send();

In the following path `app/design/frontend/base/default/template/checkout/success.phtml`:

add the following line Top success page for sending mail direct

    $order = Mage::getModel('sales/order');

    $incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); 

    $order->loadByIncrementId($incrementId);

    try{ 

    $order->sendNewOrderEmail();

    } catch (Exception $ex) { 

    echo "Email Not Sent..."; 

    }

    $customer = Mage::getSingleton('customer/session')->getCustomer();

    $email = $customer->getEmail();

    //End Email Sending

Magento 2: How to remove decimal points from the price

 You need to override vendor/magento/module-catalog/view/base/web/js/price-utils.js and change the value of precision on line 38:

from

    var precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision,

to

    var precision = 0

Magento2: How to get list of category's dropdown attributes?

Let's say that `$category` is the instance of the current category;


    $collection = $category->getProductCollection()->addAttributeToSelect(['manufacturer', 'color']);

    $manufacturers = [];

    $colors = [];

    foreach ($collection as $product) {

        $manufacturer = $product->getData('manufacturer');

        if ($manufacturer && !isset($manufacturers[$manufacturer])) {

             $manufacturers[$manufacturer] = $product->getAttributeText('manufacturer');

        }

        $color = $product->getData('color');

        if ($color && !isset($colors[$color])) {

             $colors[$color] = $product->getAttributeText('color');

        }

    }


after this, `$manufacutrers` and `$colors` should contain all the values you need. The key is the id, and the value is the option label.  

But this may cause performance issues if you have a large product collection.

What is Magento ?

  1.  Magento is an open-source e-commerce platform written in PHP.
  2. It uses multiple other PHP frameworks such as Laminas and Symfony.
  3. Magento source code is distributed under Open Software License v3.0.
  4. Magento was acquired by Adobe Inc in May 2018 for $1.68 Billion USD.

Initial release date31 March 2008
Developer(s)Magento, Inc
LicenseOSL v3, AFL v3

Magento : 404 error is showing admin page

Hello, Sometimes we may get the error on admin page once done with the Magento installation. In that scenario, we have to do the following: ...