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 as many IBAN / NIB field IDs as you want | |
var ibanFields = [ | |
"LT_BPINet_wt1_block_wtMainContent_CS_ClienteCanais_wt42_block_WebPatterns_wt581_block_wtContent_LT_BPI_Patterns_wtDadosBeneficiarioNacional_block_wtForm_LT_BPI_Patterns_wtRowIBAN_block_wtRow_LT_BPI_Patterns_wtIBAN_block_wtInput_wtTxtIBAN", | |
"LT_BPINet_wt20_block_wtMainContent_CS_Transferencias_wt12_block_wt3_WebPatterns_wt820_block_wtContent_LT_BPI_Patterns_wtfmFomularioDadosTranferencia_block_wtForm_LT_BPI_Patterns_wttxtIBAN_block_wtRow_LT_BPI_Patterns_wt652_block_wtInput_wttxtIBAN2", | |
"LT_BPINet_wt60_block_wtMainContent_CS_Transferencias_wt68_block_WebPatterns_wt273_block_wtContent_LT_BPI_Patterns_wt999_block_wtForm_LT_BPI_Patterns_wt442_block_wtRow_LT_BPI_Patterns_wt55_block_wtInput_wttxtContaIBANDestinatario" | |
]; | |
//Add the event listener | |
for (var i = 0, len = ibanFields.length; i < len; i++) { | |
if ( el=document.getElementById(ibanFields[i]) ) el.addEventListener('paste', cleanIban); |
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
var pagServField1 = "LT_BPINet_wt43_block_wtMainContent_CS_CartoesDebito_wt7_block_WebPatterns_wt122_block_wtContent_LT_BPI_Patterns_wt292_block_wtForm_LT_BPI_Patterns_wt57_block_wtRow_LT_BPI_Patterns_wt691_block_wtInput_wttxtRef1"; | |
var pagServField2 = "LT_BPINet_wt43_block_wtMainContent_CS_CartoesDebito_wt7_block_WebPatterns_wt122_block_wtContent_LT_BPI_Patterns_wt292_block_wtForm_LT_BPI_Patterns_wt57_block_wtRow_LT_BPI_Patterns_wt691_block_wtInput_wttxtRef2"; | |
var pagServField3 = "LT_BPINet_wt43_block_wtMainContent_CS_CartoesDebito_wt7_block_WebPatterns_wt122_block_wtContent_LT_BPI_Patterns_wt292_block_wtForm_LT_BPI_Patterns_wt57_block_wtRow_LT_BPI_Patterns_wt691_block_wtInput_wttxtRef3"; | |
if ( el=document.getElementById(pagServField1) ) el.addEventListener('paste', pasteRef); | |
function pasteRef(e) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
var clipboardData = e.clipboardData || window.clipboardData; |
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( 'cppw_get_shipping_methods', 'woocommerce_flatrate_percountry_cppw_get_shipping_methods' ); | |
function woocommerce_flatrate_percountry_cppw_get_shipping_methods( $shipping_methods ) { | |
$shipping_methods[] = 'woocommerce_flatrate_percountry'; | |
return $shipping_methods; | |
} |
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 client type field to registration */ | |
add_action( 'woocommerce_register_form_start', 'woocommerce_register_form_start_client_type' ); | |
function woocommerce_register_form_start_client_type() { | |
?> | |
<p class="form-row form-row-wide"> | |
<label for="reg_client_type"><?php _e( 'Client type', 'textdomain' ); ?></label> | |
<select class="" name="client_type" id="client_type"> | |
<option value="person"<?php if ( isset($_POST['client_type']) && $_POST['client_type']=='person' ) echo ' selected="selected"'; ?>><?php _e( 'Person', 'textdomain' ); ?></option> | |
<option value="company"<?php if ( isset($_POST['client_type']) && $_POST['client_type']=='company' ) echo ' selected="selected"'; ?>><?php _e( 'Company', 'textdomain' ); ?></option> | |
</select> |
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( 'cppw_map_width', function( $width ) { | |
return 200; | |
} ); | |
add_filter( 'cppw_map_height', function( $height ) { | |
return 100; | |
} ); |
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 | |
// Multibanco IfThen - Keep order pending instead of on-hold - Be advised that no "new order" email will be sent to the client | |
add_filter( 'multibanco_ifthen_set_on_hold', '__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 | |
// Multibanco IfThen - Cancel orders if "Manage stock" and "Hold stock (minutes)" are configured - Be advised that the Multibanco reference will still be active and can be paid | |
add_filter( 'multibanco_ifthen_cancel_unpaid_orders', '__return_true' ); |
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( 'woocommerce_email_recipient_cancelled_order', 'cancelled_order_add_customer_email', 10, 2 ); | |
function cancelled_order_add_customer_email( $recipient, $order ) { | |
if ( $order ) { | |
return $recipient . ',' . ( version_compare( WC_VERSION, '3.0', '>=' ) ? $order->get_billing_email() : $order->billing_email ); | |
} else { | |
return $recipient; | |
} | |
} |
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 | |
/* WooCommerce emails for cancelled pending orders */ | |
add_action('woocommerce_order_status_pending_to_cancelled', 'pending_cancelled_send_an_email_notification', 10, 2 ); | |
function pending_cancelled_send_an_email_notification( $order_id, $order ) { | |
if ( version_compare( WC_VERSION, '3.0.8', '>=' ) ) { | |
// Getting all WC_emails objects | |
$email_notifications = WC()->mailer()->get_emails(); | |
// Sending the email | |
$email_notifications['WC_Email_Cancelled_Order']->trigger( $order_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 add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' ); ?> |