I'm trying writing a module, for my website to synchronize quantities through in a webservice in hook of the product page, everything works for me, except in case the product has combinations.
I need to check the product id of the current combination and update the quantities via the reference.
$product = new
Product(Tools::getValue('id_product'));
$idarticolo = $product->reference;
if ($product->hasAttributes()) {
$id_product_attribute=Tools::getValue('id_product_attribute');
$combination = new Combination($id_product_attribute);
$idarticolo = $combination->reference;
}
can you help me?