Skip to content

Instantly share code, notes, and snippets.

View IlonaF's full-sized avatar

Ilona IlonaF

View GitHub Profile
@IlonaF
IlonaF / fullstripe_before_subscription_charge_v6-0.php
Last active November 11, 2021 17:40 — forked from wpfullstripe/fullstripe_before_subscription_charge_v6-0.php
The fullstripe_before_subscription_charge Wordpress action
<?php
/**
* A 'fullstripe_before_subscription_charge' action hook example for WP Full Stripe.
* It blocks the subscripton if the quantity is less than 3.
*
* @param array $params with the following keys:
* email => Email address of the customer
* urlParameters => Array of URL parameters
* formName => Name of the form the payment is being made on
* productName => Name of the Stripe product being purchased
@IlonaF
IlonaF / european_countries.txt
Created October 31, 2018 12:14
WooCommerce Sell to European Countries only (woocommerce_specific_allowed_countries database field value)
a:52:{i:0;s:2:"AL";i:1;s:2:"AD";i:2;s:2:"AM";i:3;s:2:"AT";i:4;s:2:"AZ";i:5;s:2:"BY";i:6;s:2:"BE";i:7;s:2:"BA";i:8;s:2:"BG";i:9;s:2:"HR";i:10;s:2:"CY";i:11;s:2:"CZ";i:12;s:2:"DK";i:13;s:2:"EE";i:14;s:2:"FI";i:15;s:2:"FR";i:16;s:2:"GE";i:17;s:2:"DE";i:18;s:2:"GR";i:19;s:2:"HU";i:20;s:2:"IS";i:21;s:2:"IE";i:22;s:2:"IM";i:23;s:2:"IT";i:24;s:2:"JE";i:25;s:2:"KZ";i:26;s:2:"LV";i:27;s:2:"LI";i:28;s:2:"LT";i:29;s:2:"LU";i:30;s:2:"MK";i:31;s:2:"MT";i:32;s:2:"MD";i:33;s:2:"MC";i:34;s:2:"ME";i:35;s:2:"NL";i:36;s:2:"NO";i:37;s:2:"PL";i:38;s:2:"PT";i:39;s:2:"RO";i:40;s:2:"RU";i:41;s:2:"SM";i:42;s:2:"RS";i:43;s:2:"SK";i:44;s:2:"SI";i:45;s:2:"ES";i:46;s:2:"SE";i:47;s:2:"CH";i:48;s:2:"TR";i:49;s:2:"UA";i:50;s:2:"GB";i:51;s:2:"VA";}
//Get category from the url (#id) and filter the items leaving only the ones for that category
if( $('body').hasClass('page-we-are-redirecting-to') ){
var cat = window.location.hash.substr(1);
$('.filters a[data-category="' + cat + '"]').click();
}
@IlonaF
IlonaF / if-functions.php
Created August 15, 2017 10:27
Redirect to custom user dashboard after logging in with OneAll WordPress plugin
/* Change redirect URL for OnaAll Social Login */
function if_login_registration_redirect_filter ($url, $user_data){
$student_name = get_the_author_meta( 'user_nicename', $user_data->id );
$redirection_url = get_site_url() . '/author/' . $student_name;
return $redirection_url;
}
add_filter('oa_social_login_filter_registration_redirect_url', 'if_login_registration_redirect_filter', 10, 2);
add_filter('oa_social_login_filter_login_redirect_url', 'if_login_registration_redirect_filter', 10, 2);