Skip to content

Instantly share code, notes, and snippets.

Avatar

Remi Corson corsonr

View GitHub Profile
@corsonr
corsonr / iDoneThis-clickable-urls.user.js
Created Jul 1, 2022
Make iDoneThis URLs Clickable on Calendar View
View iDoneThis-clickable-urls.user.js
// ==UserScript==
// @name iDoneThis - Make URLs clickable
// @version 0.1
// @description Make URLs clickable on iDoneThis
// @author Remi Corson
// @match https://app.idonethis.com/*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@corsonr
corsonr / featured.json
Last active Aug 5, 2022
featured.json.txt
View featured.json
@corsonr
corsonr / attestation-derogatoire.user.js
Last active Jan 16, 2021
Génération automatique de l'attestation dérogatoire obligatoire en France pour le confinement V2.
View attestation-derogatoire.user.js
// ==UserScript==
// @name Attestation Derogatoire
// @namespace https://media.interieur.gouv.fr/
// @version 0.1
// @description Auto-génération de l'attestation. Passez le motif en URL, par exemple https://media.interieur.gouv.fr/deplacement-covid-19/?raison=travail
// @author Remi Corson
// @match https://media.interieur.gouv.fr/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==
@corsonr
corsonr / woo-restrict-ordersper-day.php
Last active May 6, 2020
WooCommerce - restrict number of orders per day
View woo-restrict-ordersper-day.php
<?php
/**
* Plugin Name: Restrict Orders per Day for WooCommerce
* Plugin URI: https://remicorson.com
* Description: Put the shop into catalogue mode once number of orders per day is reached.
* Version: 0.1
* Author: Remi Corson, corsonr
* Author URI: https://remicorson.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@corsonr
corsonr / gist:c9b03ee67425606365b17742ba3d0a2f
Created Feb 14, 2020
wp-cli: delete all WooCommerce products
View gist:c9b03ee67425606365b17742ba3d0a2f
wp post delete $(wp post list --post_type='product' --format=ids --posts_per_page=10000) --force
@corsonr
corsonr / functions.php
Created Dec 20, 2019
Restrict WooCommerce Subscriptions Creation Process
View functions.php
<?php
if ( current_user_can( 'edit_pages' ) ) { // Edit capability here.
remove_filter( 'product_type_selector', 'WC_Subscriptions_Admin::add_subscription_products_to_select' );
}
@corsonr
corsonr / README.md
Last active Sep 25, 2022
WooCommerce: redirect user upon coupon removal
View README.md

WooCommerce: Redirect user to a specific page after removing a coupon

This snippet gives the ability to redirect a user after removing a coupon. You can place the code in functions.php.

@corsonr
corsonr / functions.php
Created Jan 28, 2019
WooCommerce: display products discounted price in cart table
View functions.php
<?php
/*
* Display discounted products prices in the cart table.
*
* Modification of code provided here https://businessbloomer.com/woocommerce-display-cart-item-subtotal-coupon-discount/.
*/
add_filter( 'woocommerce_cart_item_subtotal', 'if_coupon_slash_item_subtotal', 99, 3 );
add_filter( 'woocommerce_cart_item_price', 'if_coupon_slash_item_subtotal', 99, 3 );
/**
@corsonr
corsonr / functions.php
Last active Sep 14, 2018
WooCommerce: set price to zero
View functions.php
<?php
function make_it_free() {
echo '<table class="variations" cellspacing="0">
<tbody>
<tr>
<td class="label"><label>Make this free!</label></td>
<td class="value">
<label><input type="checkbox" name="option_free" value="YES" /> Set price to zero</label>
</td>
</tr>
@corsonr
corsonr / functions.php
Created Jul 24, 2018
WooCommerce 360: slow down...
View functions.php
<?php // Do not include this if already open! Code goes in theme functions.php.
/*
* Slow down WooCommerce 360 images rotation.
*/
add_filter( 'wc360_js_playspeed', 'woo_slow_down360' );
function woo_slow_down360( $speed ) {
return 50;
}