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
//changed currency from kr to ,- | |
add_filter('woocommerce_currency_symbol', 'jagels_change_existing_currency_symbol', 10, 2); | |
function jagels_change_existing_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'NOK': $currency_symbol = ',-'; break; | |
} | |
return $currency_symbol; | |
} |
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
//Remove the outlet category from the shop page | |
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); | |
function custom_pre_get_posts_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$q->set( 'tax_query', array(array( | |
'taxonomy' => 'product_cat', |
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 shipping info above the proceed to checkout button | |
add_action('woocommerce_proceed_to_checkout', 'jagels_custom_checkout_field'); | |
function jagels_custom_checkout_field() { | |
echo '<p><small>Levering innen 2-5 virkedager.</small></p>'; | |
} |
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
//Remove the Black friday category from category widget | |
function jagels_exclude_widget_categories($args){ | |
$exclude = "99"; // The IDs of the excluding categories separated by commas. | |
$args["exclude"] = $exclude; | |
return $args; | |
} | |
add_filter('woocommerce_product_categories_widget_args','jagels_exclude_widget_categories'); |
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
$("input[name=postnummer]").on("change", function () { | |
$this = $(this); | |
$.getJSON("https://fraktguide.bring.no/fraktguide/api/postalCode.json?country=no&pnr=" + $(this).val() + "&callback=?", function (json) { | |
$(".poststed").text((json.result)); | |
$("input[name=poststed]").val((json.result)); | |
}); | |
}); |