This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Hook the function to the filter | |
| add_filter('gens_raf_coupon_amount', 'modify_raf_coupon_amount', 10, 2); | |
| function modify_raf_coupon_amount($amount, $order_id) { | |
| // Get the user email from the order | |
| $order = wc_get_order($order_id); | |
| if (!$order) return $amount; | |
| $rafID = get_post_meta($order_id,'_wpgens_raf_id',true); | |
| if(!$rafID) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* TEMPORARY FEES INSTEAD OF COUPONS CODE */ | |
| add_action('woocommerce_cart_calculate_fees', 'apply_10_percent_discount_as_fee'); | |
| function apply_10_percent_discount_as_fee($cart) { | |
| // Avoid applying the fee in the admin or if cart is empty | |
| if (is_admin() || !WC()->cart->get_cart_contents_count()) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table style="border-collapse: collapse; font-family: Arial; width: 100%;" cellspacing="0" cellpadding="0"> | |
| <tbody> | |
| <tr> | |
| <td style="padding: 0px;"> | |
| <table cellspacing="0" cellpadding="0"> | |
| <tbody> | |
| <tr> | |
| <td style="text-align: left; padding-top: 10px; padding-bottom: 20px;"> | |
| <p style="font-size: 14px; margin: 0;">Michael Baum</p> | |
| <p style="font-size: 14px; margin: 0;">Founder and CEO</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { google } from "googleapis"; | |
| import { Readable } from "stream"; | |
| import { NextResponse } from "next/server"; | |
| import { Client } from "@notionhq/client"; | |
| let auth; | |
| let drive; | |
| const notion = new Client({ auth: process.env.NOTION_API_KEY }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add this code to your theme's functions.php file | |
| function custom_raf_popup() { | |
| // Check if the URL contains the 'raf' query parameter | |
| if (isset($_GET['raf'])) { | |
| // Add popup HTML, CSS, and JS to footer | |
| add_action('wp_footer', 'custom_popup_html'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Exit if accessed directly | |
| if (!defined('ABSPATH')) { | |
| exit; | |
| } | |
| add_action('rest_api_init', 'register_withreach_webhook_endpoint'); | |
| function register_withreach_webhook_endpoint() { | |
| register_rest_route('withreach/v1', '/webhook', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Hook to save user meta when a user registers | |
| add_action('user_register', 'save_source_tracker_user_meta', 10, 1); | |
| function save_source_tracker_user_meta($user_id) { | |
| $disabled = get_option('wpgens_st_disable'); | |
| if ($disabled) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function save_source_tracker_meta($order_id) | |
| { | |
| $disabled = get_option('wpgens_st_disable'); | |
| if ($disabled) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'woocommerce_before_calculate_totals', 'wpgens_auto_apply_coupons_and_add_product', 10, 1 ); | |
| function wpgens_auto_apply_coupons_and_add_product( $cart ) { | |
| if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
| return; | |
| if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) | |
| return; | |
| if(!is_user_logged_in()) | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class WPGens_RAF_Email | |
| { | |
| private $email; | |
| private $coupon_code; | |
| private $name; |