This file contains hidden or 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 // Do not include this if already open! | |
/** | |
* Code goes in theme functions.php. Free Shipping Method must be enabled. | |
*/ | |
add_filter( 'woocommerce_shipping_free_shipping_is_available', 'free_shipping_based_on_cart_shipping_class' ); | |
function free_shipping_based_on_cart_shipping_class( $is_available ) { | |
/** |
This file contains hidden or 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 // Do not include this if already open! | |
/** | |
* Remove existing tabs from single product pages. | |
*/ | |
function remove_woocommerce_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); | |
unset( $tabs['reviews'] ); | |
unset( $tabs['additional_information'] ); | |
return $tabs; |
This file contains hidden or 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_upsell_display_args', 'custom_woocommerce_upsell_display_args' ); | |
function custom_woocommerce_upsell_display_args( $args ) { | |
$args['posts_per_page'] = 5; // Change this number | |
$args['columns'] = 5; // This is the number shown per row. | |
return $args; | |
} |
This file contains hidden or 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 custom_job_post_type_link( $permalink, $post ) { | |
if ( $post->post_type !== 'job_listing' ) | |
return $permalink; | |
$permalink .= '-' . $post->ID; | |
return $permalink; | |
} | |
add_filter( 'post_type_link', 'custom_job_post_type_link', 10, 2 ); |
This file contains hidden or 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
DELETE from wp_users where wp_users.ID not in ( | |
SELECT meta_value FROM wp_postmeta WHERE meta_key = '_customer_user' | |
) AND wp_users.ID not in ( | |
select distinct(post_author) from wp_posts | |
); | |
delete from wp_usermeta where wp_usermeta.user_id not in (select ID from wp_users); |
This file contains hidden or 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 | |
/** | |
* After adding this code to theme functions.php, ensure you clear transients via WC > System Status > Tools | |
*/ | |
add_filter( 'woocommerce_get_sale_price', '__return_empty_string' ); | |
add_filter( 'woocommerce_variation_prices_sale_price', '__return_empty_string' ); | |
add_filter( 'woocommerce_variation_prices_price', 'custom_get_price', 10, 2 ); | |
add_filter( 'woocommerce_get_price', 'custom_get_price', 10, 2 ); |
This file contains hidden or 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 to theme functions.php | |
add_filter( 'job_manager_geolocation_endpoint', 'change_geocode_lang' ); | |
function change_geocode_lang( $endpoint ) { | |
// Use language from https://developers.google.com/maps/faq#using-google-maps-apis | |
return add_query_arg( 'language', 'en-GB', $endpoint ); | |
} |
This file contains hidden or 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( 'pre_option_job_manager_alerts_page_id', 'wpml_pre_option_job_manager_alerts_page_id' ); | |
function wpml_pre_option_job_manager_alerts_page_id( $id ) { | |
return icl_object_id( $id, 'post', true ); | |
} |
This file contains hidden or 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
/* Code goes in theme functions.php */ | |
add_filter( 'woocommerce_prevent_admin_access', '__return_false' ); | |
add_filter( 'woocommerce_disable_admin_bar', '__return_false' ); |
This file contains hidden or 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_product_add_to_cart_url', 'custom_woocommerce_product_add_to_cart_url', 10, 2 ); | |
function custom_woocommerce_product_add_to_cart_url( $url, $product ) { | |
if ( $product->is_type( 'simple' ) ) { | |
$url = get_permalink( $product->id ); | |
} | |
return $url; | |
} |