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
/** | |
* Flux checkout - disable autofill. | |
* | |
* @return void | |
*/ | |
function iconic_flux_disable_autofill_address() { | |
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
<?php | |
// Create a custom merge tag for gravity forms. | |
add_filter( 'gform_custom_merge_tags', 'pj_add_custom_merge_tags', 10, 4 ); | |
function pj_add_custom_merge_tags( $merge_tags, $form_id, $fields, $element_id ) { | |
$merge_tags[] = array( 'label' => 'Today date(Y-M-D)', 'tag' => '{custom_today_ymd}' ); | |
return $merge_tags; | |
} | |
// Add a custom merge tag to the list of available merge tags in the form editor. | |
add_filter( 'gform_merge_tags', 'pj_add_custom_merge_tag', 10, 4 ); |
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 // do not include this line to functions.php | |
/** | |
* Flux checkout - hide shipping section for details and address step. | |
*/ | |
function flux_hide_shipping_section_for_details_address_step() { | |
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 WDS - compatiblity with CartFlows. | |
*/ | |
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
<?php //do not add this line to functions.php | |
/** | |
* Iconic WDS - modify same day cut off time for certain categories. | |
*/ | |
function iconic_wds_modify_same_day_cutoff_for_categories( $cut_off ) { | |
// todo - change the categories. | |
$categories_a = array( 'pizza' ); | |
$categories_b = array( 'bread' ); | |
global $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 timeslot for specific products. | |
* | |
* @return bool | |
*/ | |
function iconic_wds_disable_timeslot_for_specific_products( $disabled ) { | |
// todo replace with your product ids. | |
$disable_for_products = array( 10 ); | |
if ( only_these_products_are_in_cart( $disable_for_products ) ) { |
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 // do not add this line to functions.php | |
/** | |
* Iconic Delivery slots - open date picker by default on page load. | |
*/ | |
function iconic_wds_trigger_delivery_date_focus() { | |
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
<?php | |
/** | |
* Multi currency - set currency based on browser language. | |
* | |
* @return void | |
*/ | |
function idea_multi_set_currency_based_on_browser_lang() { | |
?> | |
<script> | |
(function() { |
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 - compatibility with Divi Checkout modules. | |
*/ | |
add_action( | |
'init', | |
function() { | |
remove_action( 'woocommerce_after_checkout_validation', array( 'Iconic_WDS_Checkout', 'catch_shipping' ), 10, 2 ); | |
} | |
); |
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
/* | |
JS function to convert decimal number to Binary | |
*/ | |
function decimal_to_binary( num ) { | |
var div = 0; | |
var res = []; | |
do { | |
div = parseInt(num/2); | |
var remainder = num % 2; |