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 | |
function sv_wc_auth_net_cim_tweak_held_order_status( $order_status, $order, $response ) { | |
if ( 'on-hold' === $order_status && $response instanceof SV_WC_Payment_Gateway_API_Response && $response->transaction_approved() ) { | |
$order_status = 'processing'; | |
} | |
return $order_status; | |
} |
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
function wc_local_pickup_plus_remove_pickup_location() { | |
$methods = WC()->shipping->load_shipping_methods(); | |
if ( isset( $methods['local_pickup_plus'] ) ) { | |
remove_action( 'woocommerce_after_template_part', array( $methods['local_pickup_plus'], 'review_order_shipping_pickup_location' ), 10, 4 ); | |
} | |
} | |
add_action( 'wc_shipping_local_pickup_plus_init', 'wc_local_pickup_plus_remove_pickup_location' ); |
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
function wc_shipwire_set_custom_shipping_method( $fields, $order_id ) { | |
$fields['shipping_code'] = 'GD'; | |
$order = wc_get_order( $order_id ); | |
foreach ( $order->get_shipping_methods() as $method ) { | |
if ( '2-Day Shipping' == $method['name'] ) { | |
$fields['shipping_code'] = '2D'; | |
break; |
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 | |
/** | |
* Plugin Name: WooCommerce Sage ERP Connector Customizations | |
* Plugin URI: https://github.com/skyverge/woocommerce-sage-erp-connector | |
* Description: This is a sample customization plugin for the WooCommerce Sage ERP Connector extension. | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com | |
* Version: 1.0.0 | |
* Text Domain: wc-sage-erp-connector-customizations | |
* Domain Path: /languages/ |
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 | |
function wc_xml_export_output_custom_format( $output, $order_data ) { | |
$output = ''; | |
foreach ( $order_data['Orders']['Order'] as $order ) { | |
$output .= "--START ORDER--\n"; | |
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 | |
// this will update an order's status immediately after it's exported | |
function wc_csv_export_update_exported_order_status( $order, $export_method ) { | |
// uncomment this to restrict the order status update to a specific export method | |
//if ( 'ftp' != $export_method ) { | |
// return; | |
//} | |
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 | |
/** | |
*Additional columns for CSV Export | |
*/ | |
function wc_csv_export_modify_column_headers( $column_headers ) { | |
$new_headers = array( | |
'column_1' => 'Column 1', | |
'column_2' => 'Column 2', | |
// add other column headers here in the format column_key => Column Name |
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 | |
function wc_csv_export_add_http_post_basic_auth( $args ) { | |
// you can set other HTTP headers using the format $args['headers']['Header Name'] = 'header value' | |
$args['headers']['Authorization'] = 'Basic ' . base64_encode( 'your_username:your_password' ); | |
return $args; | |
} | |
add_filter( 'wc_customer_order_csv_export_http_post_args', 'wc_csv_export_add_http_post_basic_auth' ); |
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 CSV delimiter to a semi-colon (;) | |
function wc_csv_export_modify_delimiter() { | |
return ';'; | |
} | |
add_filter( 'wc_customer_order_csv_export_delimiter', 'wc_csv_export_modify_delimiter' ); | |
// change CSV enclosure to a pipe (|) | |
function wc_csv_export_modify_enclosure() { | |
return '|'; |
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 | |
function wc_csv_export_edit_filename( $post_replace_filename, $pre_replace_filename, $order_ids ) { | |
// only for orders | |
if ( false !== strpos( $pre_replace_filename, '%%order_numbers%%' ) ) { | |
$order_numbers = array(); | |
foreach ( $order_ids as $id ) { | |