//For Free Cost Shipping
function zeroCost($cost, $package, $ship)
{
foreach (WC()->cart->get_cart() as $cart_item) {
if (has_term(array('15', '456'), 'product_cat', $cart_item['product_id'])) {
$cost = 0;
}
if (has_term(array('15', '456'), 'product_tag', $cart_item['product_id'])) {
$cost = 0;
}
}
return $cost;
}
add_filter('woocommerce_shipping_mnsjay_shipping_1_cost', 'zeroCost', 10, 3);
add_filter('woocommerce_shipping_mnsjay_shipping_2_cost', 'zeroCost', 10, 3);
add_filter('woocommerce_shipping_mnsjay_shipping_3_cost', 'zeroCost', 10, 3);
add_filter('woocommerce_shipping_mnsjay_shipping_4_cost', 'zeroCost', 10, 3);
Code Example |
---|
:: |
:: remove public from laravel 8 |
:: |
:: |
:: |
Php :: laravel telescope redirect to localhost |
:: if laravel pagiantion not found error occured then |
:: getname eloquent slug laravel |
:: "A non well formed numeric value encountered |
:: |
:: |
:: apagar windows desde consola |
:: PHP $argv echo with number of words |
Php :: |
:: laravel tips |
Php :: |
:: import csv in laravel |
:: |
Php :: |
Php :: wordpress pass parameters variables arguments to enqueued script |
Php :: |
:: envato purchase code verfication in php |
:: how to check request method in php |
Php :: php send POST request same folder |
Php :: |
Php :: remove public url laravel |
Php :: |
:: |
:: |
Php :: orWhereRaw |