• Resolved Carlos Faria

    (@frendeliko)


    Hi,

    just to let you know there is a Notice here:

    includes/class-alg-wc-eu-vat-core.php on line 95

    On dev environments that $_SERVER[“HTTPS”] is not set ;D

    Do you have a Github Repo to make a PRs? It would be great to help you out in some way ;D

    Thank you!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Carlos Faria

    (@frendeliko)

    Also, the variable $_SERVER doesn’t have HTTPS, SERVER_NAME or SERVER_PORT if using WP CLI. Would you mind fixing that? I would help with a PR…

    Thread Starter Carlos Faria

    (@frendeliko)

    // Unhook and redo eu_vat to fix current_url Errors and WP_CLI
    if(class_exists('Alg_WC_EU_VAT')){
        remove_action( 'init', array( \Alg_WC_EU_VAT::instance()->core, 'start_session' ) );
        add_action( 'init', function(){
            // Redo start_session function to fix current_url function errors
            // site/web/app/plugins/eu-vat-for-woocommerce/includes/class-alg-wc-eu-vat-core.php
            if( ! defined('WP_CLI') ){
                $current_url  = ( !isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on' ) ? 'https://'.$_SERVER["SERVER_NAME"] :  'https://'.$_SERVER["SERVER_NAME"];
                $current_url .= ( $_SERVER["SERVER_PORT"] != 80 ) ? ":".$_SERVER["SERVER_PORT"] : "";
                $current_url .= $_SERVER["REQUEST_URI"];
    
                $curl = rtrim($current_url,'/');
                $home = rtrim(home_url(),'/');
                if(!( $curl == $home )){
                    alg_wc_eu_vat_session_start();
                    $args = array();
                    if ( isset( $_POST['post_data'] ) ) {
                        parse_str( $_POST['post_data'], $args );
                        if ( isset( $args[ alg_wc_eu_vat_get_field_id() ] ) && alg_wc_eu_vat_session_get( 'alg_wc_eu_vat_to_check' ) != $args[ alg_wc_eu_vat_get_field_id() ] ) {
                            alg_wc_eu_vat_session_set( 'alg_wc_eu_vat_valid', null );
                            alg_wc_eu_vat_session_set( 'alg_wc_eu_vat_to_check', null );
                        }
                    }
                }
            }
        } );
    }
    Plugin Author Omar AlDabbas

    (@omardabbas)

    Hi @frendeliko

    I apologize for not responding to this post before, we had many projects going on that minimized time available for generic support.

    Thanks for the feedback on this, we don’t have a public repo for the plugin, I will be glad to fix this in the next update.

    Omar

    Plugin Author Omar AlDabbas

    (@omardabbas)

    Hi @frendeliko
    I’ve just released a new version 2.4.1 where I addressed this issue. Please give it a try and let me know if you still see the notice message.
    Omar

    Thread Starter Carlos Faria

    (@frendeliko)

    Fixed!! Thank you very much Omar

    • This reply was modified 3 years, 4 months ago by Carlos Faria.
    Plugin Author Omar AlDabbas

    (@omardabbas)

    Awsome @frendeliko
    If you enjoy the plugin & support, consider reviewing it please.
    Omar

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Undefined index: HTTPS in includes/class-alg-wc-eu-vat-core.php on line 95’ is closed to new replies.