Hi there fellow members,
ex: prod 1 have combination: prod 1 + prod 2 + prod 3 = X price
Buy Together tab will appear only on prod 1 and with the trick bellow will appear also on prod 2 and prod 3
for this you need to add in file [color=#0000ff]addons/buy_together/func.php[/color]
after:
$chains = db_get_array("SELECT $fields FROM ?:buy_together AS items LEFT JOIN ?:products AS p ON p.product_id = items.product_id LEFT JOIN ?:buy_together_descriptions AS descr ON items.chain_id = descr.chain_id AND descr.lang_code = ?s $condition", $lang_code);
add:
//add by hungryweb.net ****************************************************************
if (empty($chains) && AREA == 'C') {
if (!empty($params['product_id'])){
$conditions[0] = 'products LIKE \'%product_id";s:'.strlen($params['product_id']).':"'.$params['product_id'].'"%\'';
}
$condition = 'WHERE ' . implode(' AND ', $conditions);
$chains = db_get_array("SELECT $fields FROM ?:buy_together AS items LEFT JOIN ?:products AS p ON p.product_id = items.product_id LEFT JOIN ?:buy_together_descriptions AS descr ON items.chain_id = descr.chain_id AND descr.lang_code = ?s $condition", $lang_code);
}
//end *****************************************************************************************
Tested on v3.0.6
I hope that helps,
—
Valentin