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
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 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 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_measurement_price_calculator_amount_needed() { | |
wc_enqueue_js( ' | |
$( "input.amount_needed" ).attr( { "step" : "0.1", "type" : "number" } ); | |
' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'sv_wc_measurement_price_calculator_amount_needed' ); |
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_tab_manager_product_tabs_hide_books_tab( $tabs ) { | |
global $product; | |
// + check if we are on the product page before removing the tab so that the | |
// tab still displays in the admin | |
// + change some_condition() to a function/variable which returns true if the | |
// product should be displayed | |
// + "unique-tab-name" is uniquely generated by Tab Manager and can be found by | |
// inspecting the source on a product page and finding the HTML which outputs |
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_shipwire_remove_notice( $message ) { | |
$shipwire_notices = array( | |
'Please enter your country to see available shipping rates.', | |
'Please enter your ZIP Code to see available shipping rates.', | |
); | |
if ( in_array( $message, $shipwire_notices ) ) { | |
$message = ''; | |
} |
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 // only copy this line if needed | |
function sv_mpc_measurement_label( $label ) { | |
if ( 'fr_FR' === get_locale() ) { | |
$label = str_replace( 'Required Width', 'Largeur requise', $label ); | |
$label = str_replace( 'Width', 'Largeur', $label ); | |
} | |
return $label; |
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 // only copy this line if needed | |
// WPML WooCommerce Multilingual compatability with Measurement Price Calculator | |
function sv_wc_mpc_woocommerce_multilingual_duplicate_exception( $exclude, $cart_item ) { | |
if ( isset( $cart_item[ 'pricing_item_meta_data' ] ) ) { | |
$exclude = true; | |
} | |
return $exclude; |