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 | |
/////////////////////////////////////////// COUPON CONDIZIONALI ///////////////////////////////////////////////////// | |
/** | |
* @snippet Add A Coupon Dynamically based on Cart Subtotal with WooCommerce | |
* @sourcecode http://hirejordansmith.com | |
* @author Davide Ladisa | |
* @compatible WooCommerce 2.4.7 | |
*/ |
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 | |
/* | |
* Woocommerce Remove excerpt from single product | |
*/ | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); | |
add_action( 'woocommerce_single_product_summary', 'the_content', 20 ); | |
?> |
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 | |
/** | |
* @snippet Always Show Variation Price @ WooCommerce Single Product | |
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 | |
* @sourcecode https://businessbloomer.com/?p=101266 | |
* @author Rodolfo Melogli | |
* @compatible WooCommerce 3.5.3 | |
* @donate $9 https://businessbloomer.com/bloomer-armada/ | |
*/ |
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 extra charge on shipping rate for each KG weight on cart | |
*/ | |
add_filter( 'woocommerce_package_rates', 'custom_delivery_flat_rate_cost_calculation', 10, 2 ); | |
function custom_delivery_flat_rate_cost_calculation( $rates, $package ) | |
{ | |
// The total cart items weight | |
$cart_weight = WC()->cart->get_cart_contents_weight(); |
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 extra charge on shipping rate for each KG weight on cart based by zone | |
*/ | |
add_filter( 'woocommerce_package_rates', 'custom_delivery_flat_rate_cost_calculation_by_zone', 10, 2 ); | |
function custom_delivery_flat_rate_cost_calculation_by_zone( $rates, $package ) | |
{ | |
// The total cart items weight | |
$cart_weight = WC()->cart->get_cart_contents_weight(); |
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 Free shipping conditionally with certain category on cart and minimum order | |
*/ | |
add_filter( 'woocommerce_package_rates', 'hide_shipping_flat_rate_conditionaly', 90, 2 ); | |
function hide_shipping_flat_rate_conditionaly( $rates, $package ){ | |
// HERE Define your product category (ID, slug or name or an array of values) | |
$term = '52'; ## ID Categoria prodotto |
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 unitary price into select variation | |
*/ | |
add_filter( 'woocommerce_variation_option_name', 'display_price_in_variation_option_name' ); | |
function display_price_in_variation_option_name( $term ) { | |
global $wpdb, $product; |
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 | |
/** | |
* Discount as fee at first order exclude product on sale and if is applied a coupon disable fee | |
*/ | |
add_action('woocommerce_cart_calculate_fees' , 'custom_discount', 10, 1); | |
function custom_discount( $cart ){ |
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
<? | |
/** | |
* Automatically Update Cart on Quantity Change - WooCommerce | |
*/ | |
add_action( 'wp_footer', 'bbloomer_cart_refresh_update_qty' ); | |
function bbloomer_cart_refresh_update_qty() { |
OlderNewer