Hello,
You need something like the code below:
add_filter('pre_option_tgpc_gift_wrapper_cost', function($cost) {
// if (is_product()) { // This if is wrong
$product_fees = [
5 => [111],
10 => [112, 113],
15 => [114, 115],
];
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$product_id = get_the_ID(); // this is WRONG
$product_id = $cart_item['product_id'];
foreach ($product_fees as $fee => $ids) {
if (in_array($product_id, $ids)) {
return $fee;
}
}
}
return $cost;
});
But the code is not tested, so you need to hire a developer to fix the code according to your needs or to ask chatgpt if is not worked.
But have in mind that, if the cart contains 112 and 115 products (with these ids) for example we don’t know exactly the result of this hook