This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_eu_vat_number_country_codes', 'woo_custom_eu_vat_number_country_codes' ); | |
function woo_custom_eu_vat_number_country_codes( $vat_countries ) { | |
// only show field for users in BE | |
return array( 'BE' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_countries_base_postcode', create_function( '', 'return "80903";' ) ); | |
add_filter( 'woocommerce_countries_base_city', create_function( '', 'return "COLORADO SPRINGS";' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_subscriptions_custom_price_string( $pricestring ) { | |
$pricestring = str_replace( 'every 3 months', 'per season', $pricestring ); | |
$pricestring = str_replace( 'sign-up fee', 'initial payment', $pricestring ); | |
return $pricestring; | |
} | |
add_filter( 'woocommerce_subscriptions_product_price_string', 'wc_subscriptions_custom_price_string' ); | |
add_filter( 'woocommerce_subscription_price_string', 'wc_subscriptions_custom_price_string' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_edit_bookings_form_fields_order( $fields ) { | |
$duration = $fields['wc_bookings_field_duration']; | |
$persons = $fields['wc_bookings_field_persons']; | |
$resource = $fields['wc_bookings_field_resource']; | |
$date = $fields['wc_bookings_field_start_date']; | |
$new_fields = array( | |
'wc_bookings_field_start_date' => $date, | |
'wc_bookings_field_resource' => $resource, | |
'wc_bookings_field_duration' => $duration, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :) | |
* | |
**/ | |
add_action( 'init', 'custom_fix_thumbnail' ); | |
function custom_fix_thumbnail() { | |
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); | |
function custom_woocommerce_placeholder_img_src( $src ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Returns a set of admin custom order field options from the database, rather | |
* than as configured by the admin | |
*/ | |
add_filter( 'wc_admin_custom_order_field_options', function( $options, $field ) { | |
global $wpdb; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add the action setting | |
add_filter( 'wc_points_rewards_action_settings', 'points_rewards_newsletter_action_settings' ); | |
function points_rewards_newsletter_action_settings( $settings ) { | |
$settings[] = array( | |
'title' => __( 'Points earned for newsletter signup' ), | |
'desc_tip' => __( 'Enter the amount of points earned when a customer signs up for a newsletter via MailChimp.' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds a top bar to Storefront, before the header. | |
*/ | |
function storefront_add_topbar() { | |
?> | |
<div id="topbar"> | |
<div class="col-full"> | |
<p>Your text here</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Insert text below the Featured Products title | |
function add_featured_text_example() { | |
// Echo out content | |
echo '<p>' . esc_html__( 'These are definitely our best products to consider!', 'storefront' ) . '</p>'; | |
} | |
add_action( 'storefront_homepage_after_featured_products_title' , 'add_featured_text_example' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds a top bar to Storefront, before the header. | |
*/ | |
function storefront_add_topbar() { | |
global $current_user; | |
get_currentuserinfo(); | |
if ( ! empty( $current_user->user_firstname ) ) { | |
$user = $current_user->user_firstname; |