Skip to content

Instantly share code, notes, and snippets.

View hannahswain's full-sized avatar

Hannah Swain Løvik hannahswain

View GitHub Profile
add_action( 'wp_enqueue_scripts', 'custom_frontend_scripts' );function custom_frontend_scripts() {global $post, $woocommerce;
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? : '.min';
wp_deregister_script( 'jquery-cookie' );
wp_register_script( 'jquery-cookie', $woocommerce->plugin_url() . '/assets/js/jquery-cookie/jquery_cookie' . $suffix . '.js', array( 'jquery' ), '1.3.1', true );
}
@hannahswain
hannahswain / custom-shipping-and-billing
Last active February 19, 2018 21:21
Customizing WooCommerce checkout fields - Adding custom shipping and billing fields
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields['shipping']['shipping_phone'] = array(
'label' => __('Phone', 'woocommerce'),
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
/* Code goes in theme functions.php */
add_filter( 'woocommerce_email_template_store_credit', 'wc_ninja_store_credit_template' );
function wc_ninja_store_credit_template() {
return get_stylesheet_directory() . "/woocommerce/customer-store-credit.php";
}
function () ?
.class {
}