Skip to content

Instantly share code, notes, and snippets.

@bekarice
bekarice / wc-custom-order-status-icon.php
Last active May 13, 2019 17:01
Add WooCommerce custom order status icon
/**
* Adds icons for any custom order statuses
* Tutorial: http://www.skyverge.com/blog/changing-woocommerce-custom-order-status-icons/
**/
add_action( 'wp_print_scripts', 'skyverge_add_custom_order_status_icon' );
function skyverge_add_custom_order_status_icon() {
if( ! is_admin() ) {
return;
}
@BFTrick
BFTrick / woocommerce-add-css-to-emails.php
Created October 8, 2014 21:46
Add CSS to WooCommerce Emails
<?php
/**
* Plugin Name: WooCommerce Add CSS to Emails
* Plugin URI: https://gist.github.com/BFTrick/01cc414ee56ce93715ec
* Description: Add CSS styles to WooCommerce emails
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active October 28, 2024 06:16
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@WillBrubaker
WillBrubaker / remove-woocommerce-submenu-items
Last active November 22, 2022 13:34
Remove WooCommerce submenu items for Shop Managers
<?php
/*
Don't copy the opening php tag
*/
/*
Removes submenu items from WooCommerce menu for 'Shop Managers'
available submenu slugs are:
wc-addons - the Add-ons submenu
wc-status - the System Status submenu
@jjgrainger
jjgrainger / array_insert.php
Last active December 3, 2017 10:25
Add an element to an array at a specific position
<?php
/*
Array insert
@array the array to add an element to
@element the element to add to the array
@position the position in the array to add the element
*/
@Freekbron
Freekbron / fa-icon-walker.php
Created November 11, 2014 10:07
Font Awesome - WordPress - Custom nav walker
<?php
/**
* Custom nav walker
*
* Custom nav walker to assign icons to menu items.
*/
class FA_Icon_Walker extends Walker_Nav_Menu
{
/**
@tamarazuk
tamarazuk / wc-address-validation-move-postcode-lookup.php
Created November 20, 2014 22:57
WooCommerce Address Validation: Move postcode lookup fields to the top of billing and shipping fields rather than keeping them below the country field.
<?php
function wc_address_validation_move_postcode_lookup() {
wc_enqueue_js( '
( function() {
var $billingLookup = $( "#wc_address_validation_postcode_lookup_billing" );
var $shippingLookup = $( "#wc_address_validation_postcode_lookup_shipping" );
$( "div.woocommerce-billing-fields").find( "h3" ).after( $billingLookup );
@mohammadmursaleen
mohammadmursaleen / gist:9622098e43afdab6025e
Last active October 15, 2021 18:29
Adding custom fields above WOOCOMMERCE add to cart button
<?php
// To add custom data above add to cart button in woocommerce
// step 1
add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
function wdm_add_user_custom_data_options_callback()
@helgatheviking
helgatheviking / KIA-comment-blacklist.txt
Last active January 28, 2023 09:06
Customizing the WordPress Install Process with install.php - All files go in your /wp-content/ folder. http://www.kathyisawesome.com/421/customizing-wordpress-install/
_abercrombie
_account
_adidas
_advantage
_alviero
_article
_asics
_babe
_backup
_barata
@bekarice
bekarice / wc-coa-conditional-addons.php
Created December 23, 2014 02:23
WooCommerce Checkout Add-ons conditional display
/**
* Conditionally show gift add-ons if shipping address differs from billing
**/
function wc_checkout_add_ons_conditionally_show_gift_add_on() {
wc_enqueue_js( "
$( 'input[name=ship_to_different_address]' ).change( function () {
if ( $( this ).is( ':checked' ) ) {