Plugin Directory

Changeset 2911632


Ignore:
Timestamp:
05/12/2023 01:52:23 PM (3 years ago)
Author:
asofantzis
Message:

1.7.1 Fix

Location:
simple-cod-fee-for-woocommerce
Files:
10 added
2 edited

Legend:

Unmodified
Added
Removed
  • simple-cod-fee-for-woocommerce/trunk/readme.txt

    r2911263 r2911632  
    55Tested up to: 6.2
    66Requires PHP: 7.0
    7 Stable tag: 1.7
     7Stable tag: 1.7.1
    88License: GPLv2 or later
    99
     
    3131Yes, you can configure this plugin to disable either COD or COD Fee depending on user's total amount in cart
    3232== Changelog ==
     33
     34= 1.7.1 =
     35* Fix error when sometimes cod fee was never added
    3336
    3437= 1.7 =
  • simple-cod-fee-for-woocommerce/trunk/simple-cod-fee-for-woocommerce.php

    r2911261 r2911632  
    33Plugin Name: Simple COD Fee for WooCommerce
    44Description: Simply add extra fee for WooCommerce Cash On Delivery payment method
    5 Version: 1.7
     5Version: 1.7.1
    66Author: Andreas Sofantzis
    77Author URI: https://83pixel.com
     
    9595    $chosen_shipping_method = WC()->session->get( 'chosen_shipping_methods' );
    9696    $enabled_cod_shipping_methods = $payment_gateway->settings['enable_for_methods'];
    97 
     97   
    9898    // if COD is enabled for some shipping methods
    99     if ( !empty( $enabled_cod_shipping_methods ) ) {
     99    if ( !empty( $enabled_cod_shipping_methods ) && !empty($chosen_shipping_method) ) {
    100100        if (!empty( array_intersect($chosen_shipping_method, $enabled_cod_shipping_methods) ) ) {
    101101
     
    190190    $cod = WC()->payment_gateways->payment_gateways()['cod'];
    191191    $settings = get_option( 'woocommerce_' . $shipping_method_id . '_' . $index . '_settings' );
     192    $fee = $cod->settings['fee'];
    192193
    193194    // if wpml multicurrency is enabled
     
    217218    }
    218219   
    219     if ( $cod->settings['scffw_cod_fee_tax_status'] == 'taxable' && is_checkout() ) {
     220    if ( array_key_exists('scffw_cod_fee_tax_status', $cod->settings) && $cod->settings['scffw_cod_fee_tax_status'] == 'taxable' && is_checkout() ) {
    220221       
    221222        $tax_percentage = $cod->settings['scffw_cod_fee_tax_rates'];
Note: See TracChangeset for help on using the changeset viewer.