I have created a plugin in WooCommerce and in the front end I save a businesssID and password. How do I retrieve those settings in the backend? I have tried this.enter image description here

$this->form_fields = array(
    'enabled' => array(
        'title'       => 'Enable/Disable',
        'label'       => 'Enable Fevertree Gateway',
        'type'        => 'checkbox',
        'description' => '',
        'default'     => 'no'
    ),
    'title' => array(
        'title'       => 'Title',
        'type'        => 'text',
        'description' => 'This controls the title which the user sees during checkout.',
        'default'     => 'Account Payment',
        'desc_tip'    => true,
    ),
    'description' => array(
        'title'       => 'Description',
        'type'        => 'textarea',
        'description' => 'This controls the description which the user sees during checkout.',
        'default'     => 'Please enter your ID Number and click send OTP to continue the process, This helps us confirm your identity and secure your transaction.',
    ),

    'publishable_key' => array(
        'title'       => 'Business ID',
        'type'        => 'text'
    ),
    'private_key' => array(
        'title'       => 'Password',
        'type'        => 'password'
    )
);

Try to retrieve it below,

$password= array('private_key' => $this->private_key);
$username = $this->publishable_key = $this->settings['publishable_key'];

Could anyone assist please.

Thank you in advance.

New contributor
Radhiyah Williams is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Radhiyah Williams is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.