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_thankyou', 'gens_save_check', 10, 1 ); | |
| function gens_save_check() { | |
| WPGens_RAF_User::new_user_add_referral_id(get_current_user_id()); | |
| } |
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 | |
| // Hide refer a friend tab for users without any orders: | |
| add_action('wp','wpgens_custom_account_tabs'); | |
| function wpgens_custom_account_tabs(){ | |
| if ( !is_account_page() ) { // User is NOT on my account pages | |
| return false; | |
| } | |
| $customer_orders = get_posts( 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 | |
| add_filter('wpgens_raf_code','gens_raf_link',10,1); | |
| function gens_raf_link($raf_id) { | |
| $current_user = wp_get_current_user(); | |
| return $current_user->user_email; | |
| } |
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_account_dashboard','show_referral'); | |
| function show_referral(){ | |
| echo do_shortcode('[WOO_GENS_RAF_FULL]'); | |
| } |
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 | |
| /** | |
| * RAF & Points & Rewards Plugin Integration | |
| * | |
| * @since 2.1.2 | |
| */ | |
| // Add the action setting |
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 | |
| /** | |
| * RAF & Woocommerce Subscription | |
| * | |
| * @since 2.0.0 | |
| */ | |
| $gens_subs = get_option("gens_raf_subscription"); | |
| if(isset($gens_subs) && $gens_subs === "yes") { | |
| add_filter('wcs_new_order_created','gens_renewal_order_created', 10, 2 ); |
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 { useState, useEffect } from 'react'; | |
| import { parseCookies } from 'nookies'; | |
| import axios from 'axios'; | |
| import qs from 'qs'; | |
| import { apiURL } from '../utils/constants'; | |
| const useAxios = ({ url, method, body = null, ssrToken, ssrIp }) => { | |
| const [response, setResponse] = useState(null); | |
| const [error, setError] = useState(''); | |
| const [loading, setloading] = useState(true); |
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
| add_filter('body_class', 'custom_body_class'); | |
| function custom_body_class($classes) { | |
| global $wp; | |
| $vars = $wp->query_vars; | |
| if(array_key_exists('myreferrals', $vars)) { | |
| $classes[] = 'new-class'; | |
| } | |
| return $classes; | |
| } |
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_checkout_update_order_review', 'checkout_form_check_custom', 99, 1); | |
| add_action( 'woocommerce_applied_coupon', 'checkout_form_check_custom', 99, 1 ); | |
| function checkout_form_check_custom($post_data){ | |
| // var_dump(count(WC()->cart->get_cart())); | |
| $guest_coupon_code = get_option( 'gens_raf_guest_coupon_code' ); | |
| $coupons = WC()->cart->applied_coupons; | |
| $old_cupon = ''; | |
| foreach ($coupons as $coupon) { |