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_mollie_reorder_gateways( $gateways ) { | |
$gateway_order = array( | |
// Rearrange these payment options into the order you wish | |
'WC_Gateway_Mollie_iDEAL', | |
'WC_Gateway_Mollie_CreditCard', | |
'WC_Gateway_Mollie_MisterCash', |
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_move_postcode_lookup() { | |
wc_enqueue_js( ' | |
( function() { | |
var $billingLookup = $( "#wc_address_validation_postcode_lookup_billing" ); | |
var $shippingLookup = $( "#wc_address_validation_postcode_lookup_shipping" ); | |
$( "div.woocommerce-billing-fields").find( "h3" ).after( $billingLookup ); |
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( 'wc_nested_category_layout_category_title_html', 'wc_nested_category_layout_category_title_html', 10, 3 ); | |
function wc_nested_category_layout_category_title_html( $title, $categories, $term ) { | |
$category = $categories[ count( $categories ) - 1 ]; | |
$url = esc_attr( get_term_link( $category ) ); | |
$link = '<a href="' . $url . '">' . wptexturize( $category->name ) . '</a>'; | |
return sprintf( '<h2 class="wc-nested-category-layout-category-title">%s</h2>', $link ); |
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 | |
/** | |
* The use of this snippet requires at least WooCommerce 3.2 | |
*/ | |
/** | |
* Alter the column headers for the orders CSV to split item_meta into separate columns | |
* | |
* Note that this change is only applied to the Default - One Row per Item format |
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 | |
// rename a column | |
function wc_csv_export_rename_column( $column_headers ) { | |
// rename the order_notes column to notes | |
// make sure to not change the key (`order_notes`) in this case | |
// as this matches the column to the relevant data | |
// simply change the value of the array to change the column header that's exported | |
$column_headers['order_notes'] = 'Notes'; |
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 adds the new unit to the WooCommerce admin | |
*/ | |
function add_woocommerce_dimension_unit_league( $settings ) { | |
foreach ( $settings as &$setting ) { | |
if ( 'woocommerce_dimension_unit' == $setting['id'] ) { |
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 custom column headers | |
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 | |
// Reposition Checkout Addons to under Order Notes | |
function sv_wc_checkout_addons_change_position() { | |
return 'woocommerce_after_order_notes'; | |
} | |
add_filter( 'wc_checkout_add_ons_position', 'sv_wc_checkout_addons_change_position' ); |
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 | |
/** | |
* Modify the order export column headers to add Custom Order Fields | |
* | |
* @param array $column_headers column headers in column_key => column_name format | |
* @param \WC_Customer_Order_CSV_Export_Generator the generator instance | |
* @return array modified column headers | |
*/ | |
function sv_csv_export_custom_order_fields_order_headers( $column_headers, $generator ) { |
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 | |
/** | |
* CSV Customer Export Column Headers. | |
* | |
* Filter the column headers for the customer export | |
* | |
* @param array $column_headers { | |
* column headers in key => name format | |
* } |