Search
 
SCRIPT & CODE EXAMPLE
 

PHP

reindex after post api magento 2

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $indexerCollectionFactory = $objectManager->get("MagentoIndexerModelIndexerCollectionFactory");
    $indexerFactory = $objectManager->get("MagentoIndexerModelIndexerFactory");

    $indexerCollection = $indexerCollectionFactory->create();
    $allIds = $indexerCollection->getAllIds();
    foreach ($allIds as $id) {
        $indexer = $indexerFactory->create()->load($id);
        $indexer->reindexAll();
    }
Comment

PREVIOUS NEXT
Code Example
Php :: tinker laravel 8 
Php :: string to array php 
Php :: cakephp group by count 
Php :: how to redirect in php use variable from another file 
Php :: strpos 
Php :: check date is in the last 24 hours? 
Php :: laravel withwhere 
Php :: find auth laravel 
Php :: Laravel htaccess for aws ec2 
Php :: Uninitialized string offset 
Php :: laravel collection forPage 
Php :: sometimes validation in laravel 
Php :: php substr_replace 
Php :: redirect to intent url after login laravel 
Php :: Add current year on WordPress using Shortcode 
Php :: csv file import to mysqli using php 
Php :: create migration command in laravel 
Php :: change url wordpress 
Php :: laravel id generator 
Php :: php get error 
Php :: create qr code png image of 200*200 using phpqrcode 
Php :: doctrine orm refresh 
Php :: add filter in wordpress 
Php :: Laravel 9 Multiple File Upload Tutorial 
Php :: php += 
Php :: PHP substr_replace — Replace text within a portion of a string 
Php :: php thread safe or not thread safe windows 
Php :: php header 
Php :: ModelNotFoundException 
Php :: What is the purpose of an abstract? 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =