-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: CatalogIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report
Description
Steps to reproduce
- Create configurable product with no simple products associated
- Associate product to category
- Save category
Actual result
- Exception: Configurable product "%1" does not have sub-products
The problem is with the method, cause the configurable product has no child:
<?php
namespace Magento\ConfigurableProduct\Pricing\Price;
/**
* @param \Magento\Framework\Pricing\SaleableInterface|\Magento\Catalog\Model\Product $product
* @return float
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function resolvePrice(\Magento\Framework\Pricing\SaleableInterface $product)
{
$price = null;
foreach ($this->configurable->getUsedProducts($product) as $subProduct) {
$productPrice = $this->priceResolver->resolvePrice($subProduct);
$price = $price ? min($price, $productPrice) : $productPrice;
}
if ($price === null) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Configurable product "%1" does not have sub-products', $product->getSku())
);
}
return (float)$price;
}
antbates91, manfrinm, bordeo, Yonn-Trimoreau, serzhik and 4 more
Metadata
Metadata
Assignees
Labels
Component: CatalogIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report