0

I want to add the simple products with custom options to configurable product.When I am trying to add the simple product to configurable product, it's not showing after product save.Need suggestion to achieve this . Basically it not updating into database once it assign it saved but not showing in configuration grid i think it some conditions based can any one tell me where i need to change that conditions

0

After debugging i got the solution when we save product that time if custom options having in data base catalog_product_entity table required_options is updating as 1 if not having it updating as 0. Based on this field configuration data filtering If you look in to this file you will get public_html\vendor\magento\module-configurable-product\Model\Product\Type\Configurable.php

present code below function line number 1408 to 1411

private function getConfiguredUsedProductCollection(
        \Magento\Catalog\Model\Product $product,
        $skipStockFilter = true
    )

    $collection
                ->addAttributeToSelect($this->getAttributesForCollection($product))
                 ->addFilterByRequiredOptions()
                ->setStoreId($product->getStoreId());

i change like this

 $collection
            ->addAttributeToSelect($this->getAttributesForCollection($product))
             //->addFilterByRequiredOptions()
            ->setStoreId($product->getStoreId());

now working as i expected

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.