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 | |
/* Hide WooCommerce default category on the frontend */ | |
add_filter( 'woocommerce_product_subcategories_args', 'woocommerce_hide_default_category' ); | |
function woocommerce_hide_default_category( $args ) { | |
$args['exclude'] = get_option( 'default_product_cat' ); | |
return $args; | |
} |
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 | |
/* Removes the "added to cart" message and "continue shopping" link after a product was added to the cart and the user was redirected to the cart page */ | |
add_filter( 'wc_add_to_cart_message_html', 'remove_wc_add_to_cart_message_html' ); | |
function remove_wc_add_to_cart_message_html( $message ) { | |
$message = ''; | |
return $message; | |
} | |
?> |
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 | |
add_filter( 'pvkw_map_width', function( $width ) { | |
return 200; | |
} ); | |
add_filter( 'pvkw_map_height', function( $height ) { | |
return 100; | |
} ); |
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 | |
add_filter( 'pvkw_get_shipping_methods', 'woocommerce_flatrate_percountry_pvkw_get_shipping_methods' ); | |
function woocommerce_flatrate_percountry_pvkw_get_shipping_methods( $shipping_methods ) { | |
$shipping_methods[] = 'woocommerce_flatrate_percountry'; | |
return $shipping_methods; | |
} |
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 | |
//Disable city field on the WooCommerce cart shipping calculator | |
add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' ); | |
//Disable postcode field on the WooCommerce cart shipping calculator | |
add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' ); |
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 | |
/* Shortcode actualizado por Ajax */ | |
//My shortcode that outputs the DIV and the necessary javascript (which should be external actually) | |
add_shortcode( 'my_shortcode' , 'my_shortcode_function' ); | |
function my_shortcode_function() { | |
ob_start(); | |
echo my_shortcode_function_content(); | |
?> |
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 | |
/* | |
If you want the "Facebook Open Graph, Google+ and Twitter Card Tags" WordPress plugin to be able | |
to clear/update the cache of your posts and pages, you'll need to create a facebook app and add | |
it's ID and secret to the URL. | |
1) Go to https://developers.facebook.com/apps/ and create a new app (or choose and existant one, any app will do) | |
2) Copy the App ID and App Secret from your app dashboard | |
3) Add this to your (child-)theme's functions.php file and replace MY_APP_ID and MY_APP_SECRET with your app details |
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
WooCommerce stores tax subtotals rounded with the same number of decimals that are set for the store, which can cause problems when invoicing on external services | |
Example when using 2 decimals and tax 23%: | |
Total itens (without tax): 68.24 | |
Itens tax (rounded with 2 decimals): 15.6952 = 15.70 | |
Shipping (without tax): 4.73 | |
Shipping tax (rounded with 2 decimals): 1.0879 = 1.09 | |
Total taxes: 16.79 | |
Total: 72.97 + 16.79 = 89.76 |
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 | |
add_action( 'wse_screen_new_header', 'wse_screen_new_header_css', 11 ); | |
function wse_screen_new_header_css() { | |
?> | |
<style type="text/css"> | |
#stock-export-table .column-value-image img { | |
max-width: 200px; | |
max-height: 200px; | |
} |