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 WooCommerce Checkbox checkout | |
*/ | |
add_action( 'woocommerce_review_order_before_submit', 'woofers_add_checkout_checkbox', 10 ); | |
function woofers_add_checkout_checkbox() { | |
woocommerce_form_field( 'checkout-checkbox', array( // CSS ID | |
'type' => 'checkbox', | |
'class' => array('form-row mycheckbox'), // CSS Class | |
'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'), |
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
wp_enqueue_style( 'site-css', get_template_directory_uri() . '/assets/css/style.css', array(),filemtime(get_theme_file_path('/assets/css/style.css')), 'all' ); |
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_action( 'woocommerce_cart_totals_after_shipping' , 'shipping_zone_targeted_postcodes_custom_notice' ); */ | |
add_action( 'woocommerce_review_order_after_shipping' , 'shipping_zone_targeted_postcodes_custom_notice' ); | |
function shipping_zone_targeted_postcodes_custom_notice() { | |
// HERE DEFINE YOUR SHIPPING ZONE NAME(S) | |
$targeted_zones_names = array('Afhalen'); // <====== <====== <====== <====== <====== | |
// Get the customer shipping zone name | |
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); // The chosen shipping mehod | |
$chosen_method = explode(':', reset($chosen_methods) ); | |
$shipping_zone = WC_Shipping_Zones::get_zone_by( 'instance_id', $chosen_method[1] ); |
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_action( 'woocommerce_review_order_after_shipping' , 'shipping_zone_targeted_postcodes_afhaal2030' ); | |
function shipping_zone_targeted_postcodes_afhaal2030() { | |
// HERE DEFINE YOUR SHIPPING ZONE NAME(S) | |
$targeted_zones_names = array('Verzendzones 20 euro', 'Verzendzone 30 euro'); // <====== <====== <====== <====== <====== | |
// Get the customer shipping zone name | |
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); // The chosen shipping mehod | |
$chosen_method = explode(':', reset($chosen_methods) ); | |
$shipping_zone = WC_Shipping_Zones::get_zone_by( 'instance_id', $chosen_method[1] ); | |
$current_zone_name = $shipping_zone->get_zone_name(); |
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
/* verberg gratis shipping > €85 als verzendklasse groot in winkelwagen zit */ | |
/* source: https://businessbloomer.com/woocommerce-disable-free-shipping-if-cart-has-shipping-class/ */ | |
add_filter( 'woocommerce_package_rates', 'hide_free_shipping_for_shipping_class', 10, 2 ); | |
function hide_free_shipping_for_shipping_class( $rates, $package ) { | |
$shipping_class_target = array( 220,318,319); // shipping class ID (to find it, see screenshot below) | |
$in_cart = false; | |
foreach( WC()->cart->get_cart_contents() as $key => $values ) { | |
$product_shipping_class = $values[ 'data' ]->get_shipping_class_id(); | |
if (in_array($product_shipping_class, $shipping_class_target)) { |
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
// Display a custom text under cart item name in checkout | |
add_filter( 'woocommerce_checkout_cart_item_quantity', 'custom_checkout_text_cart_item_name', 10, 3 ); | |
function custom_checkout_text_cart_item_name( $item_qty, $cart_item, $cart_item_key ) { | |
// Here below define your shipping class slug | |
$shipping_class = 'be-shipping-klein'; | |
if( $cart_item['data']->get_shipping_class() === $shipping_class ) { | |
$item_qty .= '<br /><div class="item-shipping-class">' . __("Gratis geleverd 2-4 werkdagen", "woocommerce") . '</div>'; | |
} | |
return $item_qty; |
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
// Display a custom text under cart item name in cart page for specific shipping class | |
add_filter( 'woocommerce_cart_item_name', 'custom_text_cart_item_name', 10, 3 ); | |
function custom_text_cart_item_name( $item_name, $cart_item, $cart_item_key ) { | |
// Here below define your shipping class slug | |
$shipping_class = 'be-shipping-klein'; | |
if( is_cart() && $cart_item['data']->get_shipping_class() === $shipping_class ) { | |
$item_name .= '<br /><div class="item-shipping-class">' . __("Gratis geleverd 2-4 werkdagen", "woocommerce") . '</div>'; | |
} |
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 | |
// link to the font file no the server | |
$fontname = 'font/Capriola-Regular.ttf'; | |
// controls the spacing between text | |
$i=30; | |
//JPG image quality 0-100 | |
$quality = 90; | |
function create_image($user){ |
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 wpdocs_custom_excerpt_length( $length ) { | |
return 150; | |
} | |
add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); |
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
/* | |
Theme Name: Twenty Fifteen | |
Description: Used to style the TinyMCE editor. | |
*/ | |
/** | |
* Table of Contents: | |
* | |
* 1.0 - Body | |
* 2.0 - Typography | |
* 3.0 - Elements |