Question

We are looking for a way to get a list with all possible product configurations per product and its associated price, including delivery. If the same product has a different price or options it has to be registered as a new product.

e.g.

productName, price, sku, entityId, array(options, optionIds), delivery

Flyer, 1.99, flyer, 1, [[small, 1], [colorful, 2]], normalDelivery

Flyer, 2.99, flyer, 1, [[big, 3], [colorful, 2]], normalDelivery

Flyer, 3.99, flyer, 1, [[small, 1], [colorful, 2]], fastDelivery

Flyer, 4.99, flyer, 1, [[big, 3], [colorful, 2]], fastDelivery

We tried the following code but it doesn’t contain all possible configurations and their associated price like shown in the example above:

<?php $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');

Thanks in Advance.

Was it helpful?

Solution

With getUsedProducts function, an example code part may look like this:

$product = Mage::getModel('catalog/product')->load(%PRODUCT_ID%); 
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);

foreach($childProducts as $child) {
    print_r($child->getWhateveryouwant());
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top