We will start by making a simple class that gets all our parent(Configurable products)
<?php
namespace Test\Test\Controller\Test;
use Magento\Framework\App\Action\Context;
class Products extends \Magento\Framework\App\Action\Action
{
public function __construct(
\...
Here we first fetch our parent product and the we will get all children products that this parent have.
<?php
namespace Test\Test\Controller\Test;
use Magento\Framework\App\Action\Context;
class Products extends \Magento\Framework\App\Action\Action
{
public function __cons...