cart->get_cart(); error_log('Cart items: ' . print_r($cart_items, true)); $tour_id = null; $available_extras = array(); // Poišči tour ID iz prvega izdelka v košarici foreach ($cart_items as $cart_item) { if (isset($cart_item['product_id'])) { $product = wc_get_product($cart_item['product_id']); if ($product) { $sku = $product->get_sku(); if (strpos($sku, 'tour-') === 0) { $tour_id = str_replace('tour-', '', $sku); break; } } } } // Če smo našli tour ID, pridobimo njegove extras if ($tour_id) { $available_extras = get_post_meta($tour_id, '_available_extras', true); } // Če ni extras-ov, ne prikazujemo ničesar if (empty($available_extras)) { return; } ?>

Available Extras

Enhance your tour experience with these additional services:

$extra) : ?>