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_filter( 'gettext', 'woocommerce_rename_coupon_message_on_checkout' ,10,3); | |
// rename the coupon field on the checkout page | |
function woocommerce_rename_coupon_message_on_checkout( $translated_text, $text, $text_domain ) { | |
// bail if not modifying frontend woocommerce text | |
if ( is_admin() || 'woocommerce' !== $text_domain ) { | |
return $translated_text; | |
} elseif ( 'Apply coupon' === $text ) { | |
$translated_text = 'Special Code'; | |
} |
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 | |
add_action( 'wp_ajax_nopriv_wfacp_custom_create_account', 'wfacp_custom_create_account' ); | |
function wfacp_custom_create_account() { | |
WFACP_AJAX_Controller::check_nonce(); | |
$resp = [ | |
'msg' => '', | |
'status' => false, | |
]; | |
if ( isset( $_POST['data'] ) ) { |
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_filter( 'wfacp_percentage_number_format', 'change_number_format' ); | |
function change_number_format( $percentage ) { | |
return number_format( $percentage, 0 ); | |
} |
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 | |
add_action( 'wfacp_before_process_checkout_template_loader', function () { | |
add_action( 'woocommerce_checkout_process', function () { | |
$instance = WFACP_Core()->template_loader->get_template_ins(); | |
remove_filter( 'woocommerce_checkout_posted_data', [ $instance, 'assign_email_as_a_username' ] ); | |
} ); | |
} ); |
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_filter( 'wfacp_global_checkout_page_id', function ( $id ) { | |
$virtual_product_checkout_id=978; // Make new checkout page for only virtual product and assign here | |
if ( 0 == $id ) { | |
return $id; | |
} | |
if ( WFACP_Common::is_cart_is_virtual() || WFACP_Common::is_cart_is_virtual( true ) ) { | |
return $virtual_product_checkout_id; | |
} | |
return $id; | |
} ); |
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 | |
class WFACP_Conditional_field { | |
private $conditional_field = []; | |
public function __construct() { | |
$this->conditional_field = [ | |
'business_delivery' => [ | |
[ | |
'value' => 'checked', |
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 | |
class WFACP_Conditional_field { | |
private $conditional_field = []; | |
public function __construct() { | |
$this->conditional_field = [ | |
'user_type' => [ | |
[ |
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 | |
add_filter( 'wfob_product_raw_data', function ( $raw_data, $product ) { | |
/** | |
* @var $product WC_Product | |
*/ | |
$raw_data['regular_price'] = $product->get_regular_price(); | |
$raw_data['price'] = $product->get_price(); | |
return $raw_data; |
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_filter( 'wfacp_assign_email_as_a_username', '__return_false' ); |
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 | |
add_filter( 'wfacp_print_cart_error_notice', '__return_false' ); | |
?> |
OlderNewer