Plugin Directory

Changeset 2968699


Ignore:
Timestamp:
09/19/2023 11:26:29 AM (3 years ago)
Author:
mslsantos
Message:

Version: 1.2.1

Location:
woo-masterway/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woo-masterway/trunk/readme.txt

    r2968676 r2968699  
    2828
    2929== Changelog ==
     30
     31= 1.2.1 =
     32* Fix: Compatibility with PHP version 8.2
    3033
    3134= 1.2 =
  • woo-masterway/trunk/woocommerce-masterway.php

    r2968676 r2968699  
    44Plugin URI: http://woothemes.com/woocommerce
    55Description:  Allows you to invoice your clients using Masterway
    6 Version: 1.2
     6Version: 1.2.1
    77Author: Masterway
    88Author URI: http://masterway.net
     
    4242
    4343    class woocommerce_masterway {
     44                       
     45                public $APIKey;
     46                public $APISecret;
     47                public $Serie;
     48                public $CompanyCode;
     49               
    4450        function __construct() {
    4551                    require_once('MasterwayRequest-PHP-API/lib/MasterwayRequest.php');
     
    9941000        }
    9951001
    996         //Add field to order admin panel
    997         function wc_ie_nif_admin($order){
    998             if (@is_array($order->order_custom_fields['_billing_country'])) {
    999                 //Old WooCommerce versions
    1000                 if(@in_array('PT', $order->order_custom_fields['_billing_country']) ) {
    1001                     echo "<p><strong>".__('NIF / NIPC', 'wc_masterway').":</strong> " . $order->order_custom_fields['_billing_nif'][0] . "</p>";
    1002                 }
    1003             } else {
    1004                 //New WooCommerce versions
    1005                 if ($order->billing_country=='PT') {
    1006                     $order_custom_fields=get_post_custom($order->ID);
    1007                     echo "<p><strong>".__('NIF / NIPC', 'wc_masterway').":</strong> " . $order_custom_fields['_billing_nif'][0] . "</p>";
    1008                 }
    1009             }
    1010         }
     1002        // Add field to order admin panel
     1003                function wc_ie_nif_admin($order){
     1004                    if (isset($order->order_custom_fields['_billing_country'])) {
     1005                        if (is_array($order->order_custom_fields['_billing_country'])) {
     1006                            // Old WooCommerce versions
     1007                            if (in_array('PT', $order->order_custom_fields['_billing_country'])) {
     1008                                echo "<p><strong>".__('NIF / NIPC', 'wc_masterway').":</strong> " . $order->order_custom_fields['_billing_nif'][0] . "</p>";
     1009                            }
     1010                        } else {
     1011                            // New WooCommerce versions
     1012                            if ($order->order_custom_fields['_billing_country'] == 'PT') {
     1013                                $order_custom_fields = get_post_custom($order->ID);
     1014                                echo "<p><strong>".__('NIF / NIPC', 'wc_masterway').":</strong> " . $order_custom_fields['_billing_nif'][0] . "</p>";
     1015                            }
     1016                        }
     1017                    } else {
     1018                        // Handle the case where '_billing_country' is not set in the custom fields
     1019                    }
     1020                }
     1021
    10111022
    10121023        function wc_ie_nif_validation() {
Note: See TracChangeset for help on using the changeset viewer.