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
function sv_wc_csv_export_replace_line_item_delimiter( $order_data ) { | |
// temporarily replace the line item delimiter | |
$order_data['line_items'] = str_replace( ';', '>>>', $order_data['line_items'] ); | |
// replace the line item meta delimiter with ; | |
$order_data['line_items'] = str_replace( '|', ';', $order_data['line_items'] ); | |
// replace the temporary line item delimiter with | | |
$order_data['line_items'] = str_replace( '>>>', '|', $order_data['line_items'] ); |
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 sv_add_weight_to_csv_export_import_format( $order_data, $order ) { | |
$count = 1; | |
// add line items | |
foreach ( $order->get_items() as $item ) { | |
$product = $order->get_product_from_item( $item ); | |
if ( ! is_object( $product ) ) { |
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_checkout_add_ons_wpml_multi_currency_support( $adjustment ) { | |
return apply_filters( 'wcml_raw_price_amount', $adjustment ); | |
} | |
add_filter( 'woocommerce_checkout_add_on_get_adjustment', 'wc_checkout_add_ons_wpml_multi_currency_support', 100 ); | |
add_filter( 'wc_checkout_add_ons_add_on_option_cost', 'wc_checkout_add_ons_wpml_multi_currency_support', 100 ); |
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
/** | |
* Add the product price to the individual line item entry | |
* | |
* @param array $line_item the original line item data | |
* @param array $item WC order item data | |
* @param WC_Product $product the product | |
* @return string | |
*/ | |
function wc_csv_export_order_line_item_price( $line_item, $item, $product ) { |
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
/** | |
* Add support for %%payment_method%% merge variable to XML export file names | |
* | |
* @param string $post_replace_filename the post replace filename | |
* @param string $post_replace_filename the pre replace filename | |
* @param array $order_ids the order ids | |
* @return string | |
*/ | |
function wc_xml_export_suite_file_name_payment_method( $post_replace_filename, $pre_replace_filename, $order_ids ) { |
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 Mollie Gateway - Additional Fees Compatibility | |
* Plugin URI: http://www.woothemes.com/products/ideal-mollie/ | |
* Description: Adds support for Payment Gateway Based Fees. Adds fees for each Mollie payment gateway based on fees listed at https://www.mollie.com/en/pricing | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com | |
* Version: 1.0.0 | |
* | |
* Copyright: (c) 2015 SkyVerge, Inc. ([email protected]) |
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 sv_wc_order_status_manager_order_is_editable( $editable, $order ) { | |
// list the slugs of all order statuses that should be editable. | |
// Note 'pending', 'on-hold', 'auto-draft' are editable by default | |
$editable_custom_statuses = array( 'packaging', 'awaiting-shipment' ); | |
if ( in_array( $order->get_status(), $editable_custom_statuses ) ) { | |
$editable = true; | |
} |
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_address_validation_smartystreets_badge_fix() { | |
wc_enqueue_js( ' | |
$( "body" ).on( "wc_address_validation_fields_mapped", function() { | |
$.each( [ "billing", "shipping" ], function( index, addressType ) { | |
var fields = $( "#" + addressType + "_address_1, #" + addressType + "_address_2, #" + addressType + "_city, #" + addressType + "_state, #" + addressType + "_postcode, #" + addressType + "_country" ); | |
fields.on( "visibility", function() { |