function kerim_alp_get_user_course_ids_from_orders($user_id = 0) { if (!$user_id || !function_exists('wc_get_orders')) return []; $orders = wc_get_orders([ 'customer_id' => $user_id, 'status' => ['completed','processing','on-hold'], 'limit' => -1, ]); if (!$orders) return []; $product_ids = []; foreach ($orders as $order) { foreach ($order->get_items() as $item) { $product_ids[] = $item->get_product_id(); } } $product_ids = array_unique(array_filter($product_ids)); if (!$product_ids) return []; $courses = get_posts([ 'post_type' => 'ka_course', 'numberposts' => -1, 'post_status' => 'publish', 'meta_query' => [[ 'key' => '_ka_course_product_id', 'value' => $product_ids, 'compare' => 'IN', ]] ]); return $courses ?: []; } function kerim_alp_wc_thankyou_redirect($order_id) { if (!$order_id || is_admin()) return; $redirect = kerim_alp_get_option('post_purchase_redirect', home_url('/panelim/')); if ($redirect) { $redirect = add_query_arg('ka_purchase', 'success', $redirect); wp_safe_redirect($redirect); exit; } } add_action('woocommerce_thankyou', 'kerim_alp_wc_thankyou_redirect', 20); function kerim_alp_payment_success_notice() { if (!is_user_logged_in()) return; if (empty($_GET['ka_purchase']) || $_GET['ka_purchase'] !== 'success') return; $text = kerim_alp_get_option('welcome_notice_text', 'Satın alma başarılı. Eğitim paneline hoş geldin.'); echo '
' . esc_html($text) . '
'; } add_action('wp_footer', 'kerim_alp_payment_success_notice'); function kerim_alp_append_order_email_text($order, $sent_to_admin, $plain_text, $email) { if ($sent_to_admin || !$order instanceof WC_Order) return; $panel = home_url('/panelim/'); $courses = home_url('/egitimler/'); $title = kerim_alp_get_option('mail_cta_title', 'Eğitimine Erişim Hazır'); $text = kerim_alp_get_option('mail_cta_text', 'Satın aldığın eğitime panelinden hemen erişebilirsin.'); if ($plain_text) { echo "\n" . wp_strip_all_tags($title) . "\n"; echo wp_strip_all_tags($text) . "\n"; echo 'Panel: ' . esc_url($panel) . "\n"; echo 'Eğitimler: ' . esc_url($courses) . "\n"; return; } echo '
'; echo '

' . esc_html($title) . '

'; echo '

' . esc_html($text) . '

'; echo '

Panelime Git

'; echo '

Eğitimleri Aç

'; echo '
'; } if (function_exists('add_action')) { add_action('woocommerce_email_after_order_table', 'kerim_alp_append_order_email_text', 20, 4); } function kerim_alp_user_has_course_access($course_id) { if (!is_user_logged_in()) return false; $product_id = (int) get_post_meta($course_id, '_ka_course_product_id', true); if (!$product_id) return true; if (function_exists('wc_customer_bought_product')) { $user = wp_get_current_user(); if (wc_customer_bought_product($user->user_email, $user->ID, $product_id)) { return true; } } return false; } Hello world! – Kerim Alp Tütüncü
Mart 20, 2026 Uncategorized 1 dk okuma

Hello world!

STRATEJİ

Markan için premium büyüme planı hazırla

Reklam, ürün ve konumlandırma tarafında daha güçlü sonuçlar almak için Telegram üzerinden direkt ulaş.

Ücretsiz Analiz İçin Yaz

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Bu içerik hoşuna gittiyse sonraki adımı birlikte planlayalım

Markanı büyütmek, reklam performansını artırmak ve daha premium bir yapı kurmak için analiz iste.

Telegram’dan Yaz
Ücretsiz Analiz İçin Yaz