Woocommerce custom Flat Rate charges (by ID) Function
function wc_ninja_change_flat_rates_cost( $rates, $package ) {
// Make sure flat rate is available
// '13' is Flat Rate ID (What you Define)
if ( isset( $rates['flat_rate:13'] ) ) {
// Set the cost to $100
$rates['flat_rate:13']->cost = 60;
}
return $rates;
}
add_filter( 'woocommerce_package_rates', 'wc_ninja_change_flat_rates_cost', 10, 2 );
Also in PHP:
- composer set php version
- fetch today data in php
- Laravel Eloquent, group by month/year
- array_unique
- creating a laravel project with composer
- adding header function to href php
- date format php datetime
- codeigniter get num_rows
- artisan clear cache command
- clear cache manually laravel
- chow to check which php version running wordpress
- display error reporting php
- count characters php
- ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in
- Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:cer
- clear all laravel caches
- determine length of stirng php
- add one day to date in php
- Dynamic title on every page laravel blade
- $headder in php
- date to timestamp php
- array_column in php
- create laravel project in laravel/laravel
- 12th December 2020 date format in php