This file contains 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_mpc_measurement_label( $label ) { | |
return apply_filters( 'translate_string', $label, 'woocommerce-measurement-price-calculator', $label); | |
} | |
add_filter( 'wc_measurement_price_calculator_label', 'sv_mpc_measurement_label' ); | |
add_filter( 'wc_measurement_price_calculator_unit_label', 'sv_mpc_measurement_label' ); |
This file contains 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 third_party_tab( $tabs ) { | |
global $product; | |
$some_check = $product ? third_party_check( $product->id ) : null; | |
if ( $product && ! $some_check ) { | |
return $tabs; | |
} | |
$tabs['third_party_tab'] = array( |
This file contains 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! | |
// REQUIRES PHP 5.3+ | |
/** | |
* Create a shortcode to insert a header with an anchor icon. | |
* Use [heading size="2" id="anchor"]Heading[/heading] | |
* | |
* Recommended: Add prefix / change shortcode name to avoid conflicts | |
*/ |
This file contains 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
/** | |
* Reference post: http://www.skyverge.com/blog/remove-woocommerce-default-sorting-option/ | |
*/ | |
/** | |
* Removes "Default Sorting" from the shop template | |
* | |
* Can be used to unset other keys / sorting options instead | |
* Ref: https://github.com/woothemes/woocommerce/blob/master/includes/wc-template-functions.php#L654 | |
*/ |
This file contains 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
// rename the coupon field on the cart page | |
function woocommerce_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) { | |
// bail if not modifying frontend woocommerce text | |
if ( is_admin() || 'woocommerce' !== $text_domain ) { | |
return $translated_text; | |
} | |
if ( 'Apply Coupon' === $text ) { | |
$translated_text = 'Apply Promo Code'; |
This file contains 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 if needed! | |
/** | |
* Register new status | |
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/ | |
**/ | |
function register_awaiting_shipment_order_status() { | |
register_post_status( 'wc-awaiting-shipment', array( | |
'label' => 'Awaiting shipment', | |
'public' => true, |
This file contains 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
/** | |
* Register new statuses - add an array for each status | |
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/ | |
**/ | |
function register_new_wc_order_statuses() { | |
register_post_status( 'wc-awaiting-shipment', array( | |
'label' => 'Awaiting shipment', | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, |
This file contains 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
// Hides the coupon code applied by replacing it with a generic message | |
add_filter( 'woocommerce_cart_totals_coupon_label', 'skyverge_change_coupon_label' ); | |
function skyverge_change_coupon_label() { | |
echo 'Discount Applied'; | |
// Change this text to whatever you want | |
} |
This file contains 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
// Remove SKUs from frontend product pages for admin-only use | |
function skyverge_unhook_product_page_skus( $enabled ) { | |
// Only remove SKUs if we're not in the admin & on a product page | |
if ( ! is_admin() && is_product() ) { | |
return false; | |
} | |
return $enabled; | |
} | |
add_filter( 'wc_product_sku_enabled', 'skyverge_unhook_product_page_skus' ); |
OlderNewer