Skip to main content

Magento2

Power your online business with the most flexible and scalable ecommerce platform

Magento2 indexes

First of all you need to change the directory to  shell folder under magento root

 

Checking for the status of all indexes

php bin/magento indexer:status


Re-indexing a single index
Each index has its own index key that you can use to reference it when asking Magento to re-index. To get these keys, you can use the following command:

php bin/magento indexer:info

 

Magento2 log messages

Hi, In this wiki  we will show you how we can logging in Magento2 

as you know in Magento1, we can doing log by this code

<?php

Mage::log("You message here");

?>

but in magento2 this code will not work, we can easily log by this code

in your file just you need to make new instance of Object Manager, then we will create a new object of LoogerInterface

Magento2 Create Configurable Product via Rest in PHP

In this wiki we will see how can we create new configurable product using rest in magento2.

- First let us write the configurations (URL's,username,password)

// configuration Data
$url="http://www.example.com/index.php/";
$token_url=$url."rest/V1/integration/admin/token";
$product_url=$url. "rest/V1/products";
$username="your admin username";
$password="your admin password";
$children_ids=array(196);

 

- Then let us get access token

Magento2 Create Simple Product via Rest in PHP

In this wiki we will see how can we create new simple product using rest in magento2.

- First let us write the configurations (URL's,username,password)

// configuration Data
$url="http://www.example.com/index.php/";
$token_url=$url."rest/V1/integration/admin/token";
$product_url=$url. "rest/V1/products";
$username="your admin username";
$password="your admin password";

 

- Then let us get access token

Magento2 Upgrade current installation using command line

Hello In this wiki i will show you how to upgrade magento to  (CC 2.3.6) version by Command line

Please follow these steps 

direct use of composer.phar

 

To see the full list of available 2.3 versions:

composer show magento/product-community-edition 2.3.* --available | grep -m 1 versions

 

To see the full list of available 2.4 versions:

composer show magento/product-community-edition 2.4.* --available | grep -m 1 versions

 

 

Create category in magento2 programmatically

In this we are going to see how we can create category in Magento2 programmatically,

First we need to have the ObjectManager by this code

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

Then let us have array with some Categories names

$cats = [ "cat1","cat2" ];

Let us setup the Parent Id of the categories

$parent_id = 322;

After that we will going throw the arrays items to create those categories

Magento2 Create Bundle Product via Rest in PHP

Product bundles are several individual goods or services that are sold to consumers as one combined package. Sometimes called "package deals," product bundles are generally made up of complementary items or, less frequently, similar items. When retailers offer multiples of the exact same item, this is generally referred to as a "multipack," not a product bundle (1). Examples of product bundles would be a fixed-price meal at a restaurant or a beach kit that includes sunscreen, sand toys, flip flops and towels as one saleable item.