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 | |
/** | |
* Iconic WDS - Change next day cutoff for fridays. | |
*/ | |
function iconic_change_next_day_cutoff() { | |
global $iconic_wds; | |
$day = '5'; // Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 | |
// set cut off to 14:00 for fridays. |
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 | |
// Iconic WDS - Disable ASAP timeslot for other than today's date | |
function iconic_wds_filter_out_asap_timeslot( $slots, $ymd ) { | |
$date_ymd = filter_input( INPUT_POST, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); | |
if ( $date_ymd !== wp_date( 'Ymd' ) ) { | |
$slots = array_filter( $slots, function( $slot ) { | |
return empty( $slot['asap'] ); | |
} ); |
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 | |
/** | |
* Flux checkout - Reverse order of street number and address fields. | |
* | |
* @param array $fields The checkout fields. | |
* | |
* @return array | |
*/ | |
function flux_reverse_order_of_street_number_address_fields( $fields ) { | |
$fields['billing']['billing_street_number']['priority'] = 60; |
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 | |
/** | |
* Flux checkout - Update button text. | |
* | |
* @return void | |
*/ | |
add_action( 'wp_footer', function() { | |
if ( ! is_checkout() ) { | |
return; | |
} |
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
/** | |
* Iconic LV - remove unavailable terms from dropdown. | |
*/ | |
function iconic_wlv_remove_unavailable_terms( $group_data, $product_id ) { | |
foreach ( $group_data['attributes'] as $attribute_slug => $attribute ) { | |
foreach ( $attribute['terms'] as $term_slug => $term ) { | |
if ( empty( $term['linked_variation_data']['variation']['purchasable']) || 'outofstock' === $term['linked_variation_data']['variation']['stock_status'] ) { | |
unset( $group_data['attributes'][$attribute_slug]['terms'][$term_slug] ); | |
} | |
} |
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 | |
/** | |
* Iconic WDS - Disable day fee for local pickup. | |
* | |
* @return void | |
*/ | |
function disable_day_fee_for_local_pickup() { | |
global $iconic_wds; | |
if ( ! isset( $iconic_wds ) ) { |
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
/** | |
* Iconic WDS - Disable same day fee for local pickup. | |
* | |
* @return void | |
*/ | |
function disable_same_day_fee_for_local_pickup() { | |
global $iconic_wds; | |
$chosen_delivery_method = $iconic_wds->get_chosen_shipping_method(); | |
if ( str_contains( $chosen_delivery_method, 'local_pickup' ) ) { |
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 | |
/* | |
* Iconic WDS - Disable timeslots for specific products. | |
*/ | |
function iconic_wds_disable_slots_for_specific_products( $available_timeslots, $ymd ) { | |
$disabled_product_categories = array( 18 ); | |
$disable_timeslots = array( | |
'4sb7fvlfurg', | |
); |
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 | |
/** | |
* Iconic Flux checkout - validate phone number on step change. | |
* | |
* @param array $messages The inline errors. | |
* | |
* @return array | |
*/ | |
function flux_checkout_custom_inline_error_message( $messages ) { |
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 | |
/** | |
* Iconic WDS - Disable specific dates for specific products. | |
* | |
* @param array $available_dates Available dates. | |
* @param string $format Date format. | |
* @param bool $ignore_slots Ignore slots. | |
* | |
* @return array | |
*/ |
NewerOlder