Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Save custom input field value into cart item

// 3,5. Add fee ;)
 
add_action( 'woocommerce_cart_calculate_fees', 'bbloomer_add_checkout_fee' );
   
function bbloomer_add_checkout_fee() {
   foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
        if (!empty( $cart_item['custom_text_add_on'] ) ) {
           WC()->cart->add_fee( 'Product Add-on fee', 55 );
            break;
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: artisan call composer dump in controller 
Php :: set session expire time in php 
Php :: advanced custom fields echo string replace 
Php :: PHP include causes white space at the top of the page 
Php :: Laravel polimorfic faker 
Php :: get row ezSql | select on ezSql 
Php :: how to change laravel logo image 
Php :: laravel-websockets 403 forbidden error 
Php :: how to superscript th in php date 
Php :: php print keys of array 
Php :: laravel cors 
Php :: php artisan make:auth is not working in laravel 8 
Php :: carbon 
Php :: Allow mass assignment in Laravel 
Php :: php Prefix Sum of Matrix (Or 2D Array) 
Php :: wordpress production mode wp-config 
Php :: Database connection use for validation in laravel 8 
Php :: call node js jquery http php 
Php :: wordpress not recognizing function during plugin activation 
Php :: php eval base64_decode 
Php :: php array_diff vs array_diff_assoc 
Php :: installing php storm version 20 in ubuntu 
Php :: numeros positivos input laravel 
Php :: import csv file in laravel 
Php :: describe request php-salesforce-rest-api 
Php :: laravel-filemanager showing blank page 
Php :: how to pass javascript variable to php 
Php :: downgrade php PHP 8.0.11 to 7.4 on windows 
Php :: How to on auto_recording using zoom api in php 
Php :: yii2 gridview get selected rows 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =