Plugin Directory

Changeset 3251383


Ignore:
Timestamp:
03/05/2025 11:55:18 PM (13 months ago)
Author:
oaron
Message:

fix: gateway load issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pay-via-barion-for-woocommerce/trunk/index.php

    r3250177 r3251383  
    44Plugin URI: http://github.com/szelpe/woocommerce-barion
    55Description: Adds the ability to WooCommerce to pay via Barion
    6 Version: 3.8.2
     6Version: 3.8.3
    77Author: Aron Ocsvari <ugyfelszolgalat@bitron.hu>
    88Author URI: https://bitron.hu
     
    2828
    2929    public function __construct() {
    30         add_action('init', [$this, 'translation_load'], 5);
    31         add_action('init', [$this, 'init'], 10);
    32             add_action('before_woocommerce_init', [$this, 'declare_woocommerce_compatibility']);
    33         add_action('woocommerce_blocks_loaded', [$this, 'register_checkout_blocks']);
    34     }
    35 function translation_load() {
     30        add_action('init', [$this, 'init']);
     31        add_action('plugins_loaded', [$this, 'plugin_loaded']);
     32        add_action('before_woocommerce_init', [$this, 'declare_woocommerce_compatibility']);
     33add_action('woocommerce_blocks_loaded', [$this, 'register_checkout_blocks']);
     34
     35    }
     36   
     37   public function init() {
    3638    load_plugin_textdomain('pay-via-barion-for-woocommerce', false, plugin_basename(dirname(__FILE__)) . "/languages");
    37 }
    38     function init() {
    39    
     39   }
     40   public function plugin_loaded () {
    4041        if (!class_exists('WC_Payment_Gateway'))
    4142            return;
     
    4950
    5051        require_once 'class-wc-gateway-barion.php';
    51         $this->wc_gateway_barion = new WC_Gateway_Barion($this->profile_monitor);
     52       
    5253
    5354        require_once 'includes/class-wc-gateway-barion-pixel.php';
    54         $barion_pixel = new WC_Gateway_Barion_Pixel($this->wc_gateway_barion->get_barion_pixel_id());
     55       
    5556
    56         add_filter('woocommerce_payment_gateways', [$this, 'woocommerce_add_gateway_barion_gateway']);
    57 
     57   add_filter('woocommerce_payment_gateways', [$this, 'woocommerce_add_gateway_barion_gateway']);
    5858               //Adds notification to dashboard
    5959        add_action('admin_notices', array($this, 'custom_admin_ad_notice'));
     
    119119     **/
    120120    function woocommerce_add_gateway_barion_gateway($methods) {
     121        $this->wc_gateway_barion = new WC_Gateway_Barion($this->profile_monitor);
     122$barion_pixel = new WC_Gateway_Barion_Pixel($this->wc_gateway_barion->get_barion_pixel_id());       
    121123        $methods[] = $this->wc_gateway_barion;
    122124        return $methods;
Note: See TracChangeset for help on using the changeset viewer.