How to access the product combinations from the products variable below ? I cant find it when i print the variable. Do we need to pass a param to get the same
list($products, $search) = fn_get_products($params, 15000);
//echo(count($products));
//echo date(' h:i:s A');
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'get_features' => true,'get_extra' => false, 'detailed_params' => false, 'get_options'=> true));
If you want to get a list of all combinations, please use the following code:
list($products, $search) = fn_get_products($params, 15000);
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'get_features' => true,'get_extra' => false, 'detailed_params' => false, 'get_options'=> true));
foreach ($products as $k => $v) {
list($inventory, $search) = fn_get_product_options_inventory(array('product_id' => $v['product_id']));
$products['combinations'] = $inventory;
}
(!) Not tested
We got a message
If you want to get a list of all combinations, please use the following code:
list($products, $search) = fn_get_products($params, 15000);
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'get_features' => true,'get_extra' => false, 'detailed_params' => false, 'get_options'=> true));
foreach ($products as $k => $v) {
list($inventory, $search) = fn_get_product_options_inventory(array('product_id' => $v['product_id']));
$products['combinations'] = $inventory;
}
(!) Not tested
We got a message that the function fn_get_product_options_inventory doesnt exist.
For 4.2.4 please try
list($products, $search) = fn_get_products($params, 15000);
fn_gather_additional_products_data($products, array(‘get_icon’ => false, ‘get_detailed’ => true, ‘get_additional’ => true, ‘get_features’ => true,‘get_extra’ => false, ‘detailed_params’ => false, ‘get_options’=> true));
foreach ($products as $k => $v) {
$inventory_combinations = db_get_array(“SELECT combination FROM ?:product_options_inventory WHERE product_id = ?i AND combination != ‘’”, $v[‘product_id’]);
if (!empty($inventory_combinations)) {
$_combinations = array();
foreach ($inventory_combinations as $_combination) {
$_combinations[] = fn_get_product_options_by_combination($_combination['combination']);
}
$products[$k]['combinations'] = $_combinations;
unset($_combinations);
}
}