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 coupon field on cart page | |
function hide_coupon_field_on_cart( $enabled ) { | |
if ( is_cart() ) { | |
$enabled = false; | |
} | |
return $enabled; |
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
/* | |
* ---------------------------------------------------------------------------- | |
* ADDS ANOTHER RECIPIENT TO COMPLETE ORDER EMAIL NOTIFICATION | |
* Permite que as notificações enviadas para o cliente sejam copiadas | |
* em BCC para outros destinatarios | |
* ---------------------------------------------------------------------------- | |
*/ | |
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 3); |
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
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 ); | |
function woocommerce_custom_sales_price( $price, $product ) { | |
$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 ); | |
return $price . sprintf( __(' Save %s', 'woocommerce' ), $percentage . '%' ); | |
} |
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
/* | |
* Personalizar apresentacao do price range de produto | |
* para produtos variaveis | |
*/ | |
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2); | |
function custom_variation_price( $price, $product ) { | |
$price = ''; | |
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>'; | |
$price .= woocommerce_price($product->min_variation_price); | |
return $price; |
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 mw_theme_categories( $context ) | |
{ | |
$args = array( 'taxonomy' => 'product_cat' ); | |
$terms = wp_get_post_terms( $context['post']->ID ,'product_cat', $args ); | |
foreach ($terms as $cat) { | |
if($cat->parent == 0){ | |
$out = '<div class="prodLabel prodLabel--' . strtolower( $cat->name ) . '">'; | |
$out .= "<a href='/product-category/$cat->slug'>$cat->name</a>"; | |
$out .= '</div>'; | |
echo $out; |
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
var | |
gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'); | |
var config = { | |
dest: "./build", | |
src: "./src", |
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
<div class="container"> | |
<div class="col col01">col01</div> | |
<div class="col col02"> | |
<div>col02</div> | |
<div class="col col02-1">col02-1</div> | |
<div class="col col02-2">col02-2</div> | |
</div> | |
<div class="col col03">col03</div> | |
</div> |
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
/** | |
* ---------------------------------------------------------------------------- | |
* LIMITAR EXCERPT | |
* Limita o excerpt sem cortar palavras a meio | |
* http://wordpress.stackexchange.com/questions/70913/how-can-i-limit-the-character-length-in-excerpt | |
* ---------------------------------------------------------------------------- | |
*/ | |
function get_excerpt($limit, $source = null){ |
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
#!/bin/sh | |
wp plugin install be-subpages-widget --activate | |
wp plugin install bulk-creator --activate | |
wp plugin install cookie-notice --activate | |
wp plugin install disable-comments --activate | |
wp plugin install jigsaw --activate | |
wp plugin install jetpack --activate | |
wp plugin install mailchimp --activate | |
wp plugin install mce-table-buttons --activate | |
wp plugin install menu-customizer --activate |
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
/** | |
* A function to reorder the default display of fields on the WooCommerce Bookings form | |
* Put this function in your theme's functions.php file | |
*/ | |
function custom_order_booking_fields ( $fields ) { | |
$reorder = array(); | |
$reorder[] = $fields['wc_bookings_field_duration']; | |
$reorder[] = $fields['wc_bookings_field_resource']; | |
$reorder[] = $fields['wc_bookings_field_persons']; |