Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Jaygaah Free Shipping Woocommerce

//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);
Comment

PREVIOUS NEXT
Code Example
Php :: spring delete objest from database that are not in your object list 
Php :: cakephp Not Found error handle in pagination 
Php :: php soap wordpress parsing 
Php :: laravel helper.php session data 
Php :: get all routes in laravel 
Php :: laravel sql illegal collation 
Php :: Never return type - PHP 8.1 
Php :: OR criteria 
Php :: Breaking of code snippets in CKEditor as result code blocks are empty. 
Php :: Secured PHP Contact Form 
Php :: only fetch specific array keys php 
Php :: change varchar limit in migration file. 
Php :: symony type request 
Php :: itop cron.php 
Php :: php update json file 
Php :: SQLSTATE[HY000]: General errorstring(58) 
Php :: php array merge 
Php :: cf7 first_as_label 
Php :: laravel livewire refresh computed property 
Php :: Fibers - PHP 8.1 
Php :: how to give dynamic value in onlick in php 
Php :: Laravel function to check if image exist or not 
Php :: css dynamique avec php dans page http<style 
Php :: PHP nl2br — Inserts HTML line breaks before all newlines in a string 
Php :: Type cast using int php 
Php :: how check word is in sentence php 
Php :: How to display limited post content in WordPress 
Php :: upload video file using ajax php 
Php :: learnpress wordpress plugin shortcode 
Php :: PHPMailer/SMTP.php line 467 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =