Hi,
By "subproducts" I suppose that you're talking about variants, is that right ?
This code could work for some variants. It depends on how the variants and the main product is configured, and if you have discounts, taxes, etc.
This code is not complete enough to take into account all the cases.
The proper way to do it would be to load the main product and the variant data, feed them both in $ids and add the variant in the variants array of the product: $product->variants = array($variant);
Something like that:
$currencyClass = hikashop_get('class.currency');
$config = hikashop_config();
$parent = $productClass->get(($product->product_parent_id);
$ids = array($product->product_id, $parent->product_id);
$parent->variants = array($product);
$currencyClass->getPrices($parent, $ids, hikashop_getCurrency(), $config->get('main_currency'), hikashop_getZone(), $config->get('discount_before_tax'));
And then you'll get the prices of the main product in $parent->prices and the prices of the variant in $parent->variants[0]->prices and if the variant doesn't have any prices configured but the main product has prices, you need to use the prices from the parent.