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 | |
//Return 10 users and 10 order (20 results) to the Shop As Client Pro Add-on autocomplete feature | |
add_filter( 'shop_as_client_autocomplete_limit', function( $limit ) { | |
return 10; | |
} |
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( 'woo_dpd_portugal_email_tracking_hook_action', function( $action ) { | |
return 'woocommerce_email_customer_details'; | |
} ); | |
add_filter( 'woo_dpd_portugal_email_tracking_hook_priority', function( $priority ) { | |
return 1; | |
} ); |
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( 'multicaixa_create_ref_min', function( $value ) { | |
return 0; | |
} ); | |
add_filter( 'multicaixa_create_ref_max', function( $value ) { | |
return 333333333; | |
} ); |
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 | |
//We hook woocommerce_checkout_fields at 50, so this needs to be at least 51 | |
add_filter( 'woocommerce_checkout_fields', 'ix_vat_woocommerce_checkout_fields', 51 ); | |
function ix_vat_woocommerce_checkout_fields( $fields ) { | |
//Change label - originally __( 'VAT number', 'woo-billing-with-invoicexpress' ) | |
$fields['billing']['billing_VAT_code']['label'] = 'My VAT label'; | |
//Change priority - originally 120, 31 is after company | |
$fields['billing']['billing_VAT_code']['priority'] = 31; | |
//Make it half size and on the left | |
$fields['billing']['billing_VAT_code']['class'] = array( 'form-row', 'form-row-first' ); |
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 | |
//You need this plugin: https://www.webdados.pt/wordpress/plugins/dpd-portugal-para-woocommerce-wordpress/ | |
//Monitor the "issue label" result (success) and do whatver you want with it - Needs to be set before running "woo_dpd_portugal_issue_label" | |
add_action( 'woo_dpd_portugal_label_issued', function( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
echo 'Label issued for order '.$order_id.' on '.$order->get_meta( '_woo_dpd_portugal_label_issued' ).'<br/>'; | |
echo 'Tracking number(s): '.implode( ' / ', $order->get_meta( '_woo_dpd_portugal_tracking_number' ) ).'<br/>'; | |
echo 'Label PDF URL: '.$order->get_meta( '_woo_dpd_portugal_pdf_url' ).'<br/>'; |
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 | |
/* Email to admin when WordPress lost password is requested */ | |
add_action( 'lostpassword_post', 'my_lostpassword_post', 10, 2 ); | |
function my_lostpassword_post( $errors, $user_data ) { | |
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
//check ip from share internet | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
//to check ip is pass from proxy | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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( 'manage_edit-shop_order_columns', 'woocommerce_ixpro_invoice_order_list_column_header' ); | |
function woocommerce_ixpro_invoice_order_list_column_header( $columns ) { | |
$columns['ixpro_docs'] = __( 'InvoiceXpress', 'webdados-toolbox' ); | |
return $columns; | |
} | |
add_action( 'manage_shop_order_posts_custom_column', 'woocommerce_ixpro_invoice_order_list_column_value' ); | |
function woocommerce_ixpro_invoice_order_list_column_value( $column ) { | |
global $post; | |
if ( 'ixpro_docs' === $column ) { |
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
(function($) { | |
$( '.variations_form' ).on( 'woocommerce_variation_has_changed', function( ev ) { | |
$( this ).find( '.variations select' ).each( function( index, el ) { | |
//Get the first select current value | |
var value = $( el ).val(); | |
//Get the original HTML from .data( 'attribute_html' ) and replace it again on the element. | |
$( el ).html( $( el ).data( 'attribute_html' ) ); | |
//Then set the value again | |
$( el ).val( value ); |
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 | |
//Change NIF field priority | |
add_filter( 'woocommerce_nif_field_priority', 'woocommerce_nif_field_priority' ); | |
function woocommerce_nif_field_priority( $priority ) { | |
//Default is 120 | |
return 25; | |
} |