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
.
<?php | |
// Set the endpoint and request method | |
$endpoint = '/wp/v2/posts'; | |
$method = 'POST'; | |
// Set the request body data | |
$body = array( | |
'title' => 'My new post', | |
'content' => 'This is the content of my new post.', |
// ==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== |
[ | |
{ | |
"type": "banner", | |
"title": "WooCommerce Payments \u2013 payments made simple, with no monthly fees", | |
"image": "https://woocommerce.com/wp-content/uploads/2021/05/wc-pay-core-visual-2021-05.jpg", | |
"image_alt": "WooCommerce Payments", | |
"description": "Securely accept major cards, <a href=\"https://woocommerce.com/apple-pay/\">Apple Pay\u00ae</a> and payments in <a href=\"https://docs.woocommerce.com/document/payments/faq/available-currencies/\">over 100 currencies</a>. View and manage transactions right from your store\u2019s dashboard. Use with <a href=\"https://woocommerce.com/products/woocommerce-subscriptions/\">WooCommerce Subscriptions</a> to earn and track recurring revenue. No setup costs or monthly fees.", | |
"buttons": [ | |
{ | |
"title": "Get started for free", |
// ==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== |
<?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 |
wp post delete $(wp post list --post_type='product' --format=ids --posts_per_page=10000) --force |
<?php | |
if ( current_user_can( 'edit_pages' ) ) { // Edit capability here. | |
remove_filter( 'product_type_selector', 'WC_Subscriptions_Admin::add_subscription_products_to_select' ); | |
} |
This snippet gives the ability to redirect a user after removing a coupon. You can place the code in 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 ); | |
/** |
<?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> |