簡體   English   中英

Woocommerce 不讀取地址

[英]Woocommerce does not read the address

我的 woocommerce 結帳頁面開始出現錯誤。 我添加了所有必要的數據(姓名、地址、手機、電子郵件……),當我點擊完成時,網站沒有假定我的地址,就好像它不存在一樣。 我激活了調試模式,它返回了兩個錯誤。 這些錯誤是否與我的問題有關? 我將在下面留下錯誤以及相應的代碼行。 並提前感謝任何試圖幫助我的人。

錯誤一:

PHP Warning:  mysqli::__construct(): (HY000/1045): Access denied for user 'my_user'@'localhost' (using password: YES) in /home/aplako/contas/plako/combperelhal.com/www/wp-content/themes/divi-business-pro/functions.php on line 7

php 函數的第 7 行(第一行):

$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

錯誤二:

PHP Warning:  session_start(): Cannot start session when headers already sent in /home/aplako/contas/plako/combperelhal.com/www/wp-content/plugins/sibs-woocommerce/class-sibs-payment-gateway.php on line 236

第 236 行是該函數的最后一行,但我認為最好將整個函數留在這里。

function sibs_init_payment_gateway() {

    /**
     * Loads the Sibs language translation strings
     */
    load_plugin_textdomain( 'wc-sibs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
        add_action( 'admin_notices', 'sibs_get_notice_woocommerce_activation' );
        return;
    } else {
        add_action( 'admin_notices', 'validate_sibs_term' );
    }

    include_once dirname( __FILE__ ) . '/includes/class-general-functions.php';
    include_once dirname( __FILE__ ) . '/includes/class-general-models.php';
    include_once dirname( __FILE__ ) . '/includes/admin/class-sibs-general-settings.php';
    include_once dirname( __FILE__ ) . '/includes/admin/class-sibs-backend-settings.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibspaymentcore.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibserrorhandler.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibsversiontracker.php';

    if ( ! class_exists( 'Sibs_Payment_Gateway' ) ) {

        
        class Sibs_Payment_Gateway extends WC_Payment_Gateway {
            
            protected $payment_id;
        
            protected $payment_type;
        
            protected $payment_brand;
            
            protected $language;
            
            protected $payment_group;
            
            protected $payment_display = 'form';
            
            private static $saved_meta_boxes = false;
            
            private static $added_meta_boxes = false;
            
            private static $added_payment_method = false;
            
            private static $updated_meta_boxes = false;
            
            protected $wc_order;

            
            public function __construct() {
                $this->payment_id    = $this->id;
                $payment_gateway     = Sibs_General_Functions::sibs_get_payment_gateway_variable( $this->payment_id );
                $this->payment_type  = $payment_gateway['payment_type'];
                $this->payment_brand = $payment_gateway['payment_brand'];
                $this->payment_group = $payment_gateway['payment_group'];
                $this->language      = $payment_gateway['language'];
                $this->plugins_url   = Sibs_General_Functions::sibs_get_plugin_url();

                $this->form_fields  = Sibs_Backend_Settings::sibs_create_backend_payment_settings( $this->payment_id );
                $this->method_title = Sibs_Backend_Settings::sibs_backend_payment_title( $this->payment_id );
                $this->method_description = Sibs_Backend_Settings::sibs_backend_payment_desc( $this->payment_id );
                
                $this->init_settings();

                // Save admin configuration from woocomerce checkout tab.
                add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
                // Frontend hook.
                add_action( 'woocommerce_receipt_' . $this->payment_id, array( &$this, 'sibs_receipt_page' ) );

                add_action( 'woocommerce_thankyou_' . $this->payment_id, array( &$this, 'thankyou_page' ) );
                // Backend hook.
                add_action( 'woocommerce_process_shop_order_meta', array( &$this, 'sibs_save_order_meta' ) );
                add_action( 'woocommerce_admin_order_data_after_order_details', array( &$this, 'sibs_update_order_status' ) );
                add_action( 'woocommerce_admin_order_data_after_billing_address', array( &$this, 'add_payment_method' ) );
                add_action( 'woocommerce_admin_order_data_after_shipping_address', array( &$this, 'sibs_add_additional_information' ) );

                // Added for Capture
                
                /**
                 * hook to add the ajax callback
                 */
                global $action_addded_my_function_to_add_the_product;
                if (!$action_addded_my_function_to_add_the_product) {
                    add_action( 'wp_ajax_add_my_product_to_order', array( &$this,'sibs_my_function_to_add_the_product') );
                    $action_addded_my_function_to_add_the_product = true;
                }

                //custom email  
                add_action( 'woocommerce_email_order_meta', array( &$this, 'sibs_add_multibanco_data_to_order_email'), 10, 4 );

                // Add a custom metabox only for shop_order post type (order edit pages)
                add_action( 'add_meta_boxes', array( &$this, 'sibs_add_meta_boxesws' ) );
                
                //WebHook
                add_action( 'rest_api_init', function(){
                    register_rest_route(
                        'sibs-api/v1',
                        '/callback_hook',
                        array(
                            'methods'  => 'POST',
                            'permission_callback' => '__return_true',
                            'callback' => array( &$this,'callback_hook'),
                            )
                    );
                } );


                // Enable woocommerce refund for {payment gateway}.
                $this->supports = array( 'refunds' );

                if ( isset( WC()->session->sibs_thankyou_page ) ) {
                    unset( WC()->session->sibs_thankyou_page );
                }
                if ( isset( WC()->session->pmtRef ) ) {
                    unset( WC()->session->pmtRef );
                }

                if ( isset( WC()->session->ptmntEntty ) ) {
                    unset( WC()->session->ptmntEntty );
                }

                if ( isset( WC()->session->refIntlDtTm ) ) {
                    unset( WC()->session->refIntlDtTm );
                }

                if ( isset( WC()->session->RefLmtDtTm ) ) {
                    unset( WC()->session->RefLmtDtTm );
                }

                if ( isset( WC()->session->sibs_receipt_page ) ) {
                    unset( WC()->session->sibs_receipt_page );
                }
                if ( isset( WC()->session->sibs_confirmation_page ) ) {
                    unset( WC()->session->sibs_confirmation_page );
                }
                if ( !session_id()  && empty(session_id())) {
                    session_start( [
                        'read_and_close' => true,
                    ] );
                }
            }

Access denied for user 'my_user'@'localhost' (using password: YES)

第一個錯誤表示您的 PHP 腳本無法訪問 MySQL 數據庫。

您是否已驗證數據庫的用戶/密碼/主機名是否正確?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM