This file contains hidden or 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 item properties | |
add_filter( 'invoicexpress_woocommerce_document_item', function( $item_data, $item, $product, $order_object, $document_type, $args ) { | |
// Do whatever you want with the $item_data array, for example, change its reference (sku) | |
$item_data['name'] = 'whatever'; | |
// Or add something to its description (product title) | |
$item_data['description'] .= 'whatever'; | |
// And return it | |
return $item_data; |
This file contains hidden or 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 | |
/* Get AT Code 2 minutes after issuing Delivery Note - WordPress crons need to be running properly */ | |
add_action( 'invoicexpress_woocommerce_after_document_finish', function( $order_id, $type ) { | |
if ( $type == 'transport_guide' ) { | |
$minutes = 2; | |
wp_schedule_single_event( time() + ( $minutes * 60 ), 'invoicexpress_woocommerce_fetch_at_code', array( $order_id ) ); | |
} | |
}, 10, 2 ); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 ) { |