Skip to content

Instantly share code, notes, and snippets.

@MindyPostoff
MindyPostoff / order-notes-required.php
Last active July 31, 2020 13:16
Make the Order Notes field required in the WooCommerce Checkout
// Place this code in your theme's functions.php file
// 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['order']['order_comments']['required'] = true;
return $fields;
}
@thamas
thamas / menu.html.twig
Last active October 3, 2018 14:16
Full template
{#
/**
* @file
* Theme override to display a menu.
*/
#}
{% import _self as menus %}
{#
We call a macro which calls itself to render the full tree.
<?php
function bkap_show_hide_persons_based_on_date( $data ) {
$persons_to_hide = array(
'84217' => array( // 84217 is product id
array(
'dates' => '2023-06-25,2023-06-22', // in Y-m-d format.
'person_ids' => array( 84226, 84227 ), // 84226, 84227 are persons ids to hide
),
array(