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( 'woocommerce_account_menu_items', 'custom_remove_downloads_my_account', 999 ); | |
function custom_remove_downloads_my_account( $items ) { | |
unset($items['downloads']); | |
return $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
<?php | |
/** | |
* Change Turkish Lira currency symbol to "TL" | |
*/ | |
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2); | |
function change_existing_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'TRY': $currency_symbol = 'TL'; 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 | |
/* | |
* Remove "url" input from comment from | |
*/ | |
add_filter('comment_form_default_fields', 'unset_url_field'); | |
function unset_url_field($fields){ | |
if(isset($fields['url'])) |
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 | |
/* | |
* Remove "Fixed Price" label from shipping method on the cart page. | |
*/ | |
add_filter( 'woocommerce_cart_shipping_method_full_label', 'bbloomer_remove_shipping_label', 9999, 2 ); | |
function bbloomer_remove_shipping_label( $label, $method ) { | |
$new_label = preg_replace( '/^.+:/', '', $label ); | |
return $new_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 | |
/** | |
* Hide shipping rates when free shipping is available. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); |
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 | |
/** | |
* is_really_woocommerce_page - Returns true if on a page which uses WooCommerce templates | |
* | |
* @access public | |
* @return bool | |
*/ | |
function is_really_woocommerce_page () { | |
if( function_exists ( "is_woocommerce" ) && is_woocommerce()){ |