Block/Roi.php
public function getProductNames()
    {
        $items = $this->getOrder()->getAllItems();
        $productNames = [];
        foreach ($items as $item) {
            if ($item->getParentItemId() === null) {
                $productNames[] = str_replace('"', ' ', $item->getName());
            }
        }
        return json_encode($productNames);
    }
public function getProductNames()
    {
        $items = $this->getOrder()->getAllItems();
        $productNames = [];
        foreach ($items as $item) {
            if ($item->getParentItemId() === null) {
                $productNames[] = str_replace('"', ' ', $item->getName());
            }
        }
        return json_encode($productNames);
    }
public function getProductNames ( ) { $ items = $ this -> getOrder ( ) -> getAllItems ( ) ; $ productNames = [ ] ; foreach ( $ items as $ item ) { if ( $ item -> getParentItemId ( ) === null ) { $ productNames [ ] = str_replace ( '"' , ' ' , $ item -> getName ( ) ) ; } } return json_encode ( $ productNames ) ; }
Get product names
@return string
Get product names