Open sidebar
PLUGİN'İN ÜRÜNDE AKTİF EDİLDİP EDİLMEDİĞİNİ GÖSTEREN KOD function alg_wc_crdfnd_count_crowdfunding_products( $post_id ) { $args = array( 'post_type' => 'product', 'post_status' => array( 'any', 'trash' ), 'posts_per_page' => 3, 'meta_key' => '_alg_crowdfunding_enabled', 'meta_value' => 'yes', 'post__not_in' => array( $post_id ), 'fields' => 'ids', ); $loop = new WP_Query( $args ); return $loop->found_posts; } } BTC ÖDEME FONKSİYON KODLARI public function _update_order_status( $order, $timeline ) { $prev_status = $order->get_meta( '_coinbase_status' ); $last_update = end( $timeline ); $status = $last_update['status']; if ( $status !== $prev_status ) { $order->update_meta_data( '_coinbase_status', $status ); if ( 'EXPIRED' === $status && 'pending' == $order->get_status() ) { $order->update_status( 'cancelled', __( 'Coinbase payment expired.', 'coinbase' ) ); } elseif ( 'CANCELED' === $status ) { $order->update_status( 'cancelled', __( 'Coinbase payment cancelled.', 'coinbase' ) ); } elseif ( 'UNRESOLVED' === $status ) { if ($last_update['context'] === 'OVERPAID') { $order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) ); $order->payment_complete(); } else { // translators: Coinbase error status for "unresolved" payment. Includes error status. $order->update_status( 'failed', sprintf( __( 'Coinbase payment unresolved, reason: %s.', 'coinbase' ), $last_update['context'] ) ); } } elseif ( 'PENDING' === $status ) { $order->update_status( 'blockchainpending', __( 'Coinbase payment detected, but awaiting blockchain confirmation.', 'coinbase' ) ); } elseif ( 'RESOLVED' === $status ) { // We don't know the resolution, so don't change order status. $order->add_order_note( __( 'Coinbase payment marked as resolved.', 'coinbase' ) ); } elseif ( 'COMPLETED' === $status ) { $order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) ); $order->payment_complete(); } } // Archive if in a resolved state and idle more than timeout. if ( in_array( $status, array( 'EXPIRED', 'COMPLETED', 'RESOLVED' ), true ) && $order->get_date_modified() < $this->timeout ) { self::log( 'Archiving order: ' . $order->get_order_number() ); $order->update_meta_data( '_coinbase_archived', true ); } } HEDEFE KALAN TUTARI SAYAN FONKSIYON function alg_product_crowdfunding_goal_remaining( $atts ) { if ( empty( $atts ) ) { $atts = array(); } $product_id = isset( $atts['product_id'] ) ? $atts['product_id'] : get_the_ID(); if ( ! $product_id ) { return ''; } if ( isset( $atts['type'] ) && 'percent' === $atts['type'] ) { $atts['total_value'] = get_post_meta( $product_id, '_' . 'alg_crowdfunding_goal_sum', true ); } elseif ( ! isset( $atts['type'] ) ) { $atts['type'] = 'price'; } return $this->output_shortcode( floatval( get_post_meta( $product_id, '_' . 'alg_crowdfunding_goal_sum', true ) ) - alg_wc_crdfnd_get_product_orders_data( 'orders_sum', $atts ), $atts ); } ////////////BENİM İSTEDİĞİM/////////////////// 1 - Plugin'in ürün üzerinde aktif edilip edilmediğini kontrol et. 2 - if remaining >=0 ise ödeme alındığında satın alan kişinin ödeme durumunu HEDEFE ULAŞILMASI BEKLENİYOR yap 3 - remaining <=0 olduğu zaman ödeme yapanların ödeme durumunu tamamlandı yap ve dosyaya erişim ver. (ödeme durumu tamamlandı olduğu zaman otomatik olarak dosyaya erişim sağlıyorlar ekstra birşey yapılması gerekmiyor sanırım.
Close sidebar
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting