To get all the children product ids from the configurable product in Magento 2, you need to retrieve the list of child item ids by the configurable product id.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?php namespace Magemonkeys\ChildIds\Model; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; class ConfigurableChildrenIds { private $configurable; public function __construct( Configurable $configurable ) { $this->configurable = $configurable; } public function getChildrenIds(int $id) { $childItemId = $this->configurable->getChildrenIds($id); return $childItemId; } } ?> |
List out the children items id for a configurable product by using below commands.
1 2 |
$configurableId = 1478; $superAttributeByChild = $this->getChildrenIds($configurableId); |
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-6284651c35f0d487319451/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...