Ecommerce Shopify WordPress Discussion

WooCommerce custom payment gateway is not showing in checkout

I am trying to use a WooCommerce Custom payment gateway plugin. I added the details needed to show the plugin in the dashboard. I have tried another plugin https://wordpress.org/plugins/wc-gateway-cib, but it is not showing in checkout page either. <?php /** * Plugin Name: Noob Payment for Woocommerce * Plugin URI: https://omukiguy.com * Author Name: Laurence Bahiirwa * Author URI: https://omukiguy.com * Description: This plugin allows for local content payment systems. * Version: 0.1.0 * License: 0.1.0 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt * text-domain: noob-pay-woo */ if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) return; add_action( 'plugins_loaded', 'noob_payment_init', 11 ); function noob_payment_init() { if( class_exists( 'WC_Payment_Gateway' ) ) { class WC_Noob_pay_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = 'noob_payment'; $this->icon = apply_filters( 'woocommerce_noob_icon', plugins_url('/assets/icon.png', __FILE__ ) ); $this->has_fields = false; $this->method_title = __( 'Noob Payment', 'noob-pay-woo'); $this->method_description = __( 'Noob local content payment systems.', 'noob-pay-woo'); $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->instructions = $this->get_option( 'instructions', $this->description ); $this->init_form_fields(); $this->init_settings(); add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); } public function init_form_fields() { $this->form_fields = apply_filters( 'woo_noob_pay_fields', array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'noob-pay-woo'), 'type' => 'checkbox', 'label' => __( 'Enable or Disable Noob Payments', 'noob-pay-woo'), 'default' => 'no' ), 'title' => array( 'title' => __( 'Noob Payments Gateway', 'noob-pay-woo'), 'type' => 'text', 'default' => __( 'Noob Payments Gateway', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Noob Payments Gateway that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'description' => array( 'title' => __( 'Noob Payments Gateway Description', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Please remit your payment to the shop to allow for the delivery to be made', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Noob Payments Gateway that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'instructions' => array( 'title' => __( 'Instructions', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Default instructions', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Instructions that will be added to the thank you page and odrer email', 'noob-pay-woo') ), )); } public function process_payments( $order_id ) { } } } } add_filter( 'woocommerce_payment_gateways', 'add_to_woo_noob_payment_gateway'); function add_to_woo_noob_payment_gateway( $gateways ) { $gateways[] = 'WC_Noob_pay_Gateway'; return $gateways; } I already enabled the payment in woo-commerce setting-> payment, however it not showing in the checkout out page WordPress version is 4.6.2
There are some mistakes and missing things in your code. Try the following revised code: <?php /** * Plugin Name: Noob Payment for Woocommerce * Plugin URI: https://omukiguy.com * Author Name: Laurence Bahiirwa * Author URI: https://omukiguy.com * Description: This plugin allows for local content payment systems. * Version: 0.1.0 * License: 0.1.0 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt * text-domain: noob-pay-woo */ defined( 'ABSPATH' ) or exit; if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { return; } add_action( 'plugins_loaded', 'noob_payment_init', 11 ); function noob_payment_init() { if( class_exists( 'WC_Payment_Gateway' ) ) { class WC_Noob_pay_Gateway extends WC_Payment_Gateway { public $instructions; public function __construct() { $this->id = 'noob_payment'; $this->icon = apply_filters( 'woocommerce_noob_icon', plugins_url('/assets/icon.png', __FILE__ ) ); $this->has_fields = false; $this->method_title = __( 'Noob Payment', 'noob-pay-woo'); $this->method_description = __( 'Noob local content payment systems.', 'noob-pay-woo'); $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->instructions = $this->get_option( 'instructions' ); $this->init_form_fields(); $this->init_settings(); add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); } public function init_form_fields() { $this->form_fields = apply_filters( 'woo_noob_pay_fields', array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'noob-pay-woo'), 'type' => 'checkbox', 'label' => __( 'Enable or Disable Noob Payments', 'noob-pay-woo'), 'default' => 'no' ), 'title' => array( 'title' => __( 'Noob Payments Gateway', 'noob-pay-woo'), 'type' => 'text', 'default' => __( 'Noob Payments Gateway', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Noob Payments Gateway that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'description' => array( 'title' => __( 'Noob Payments Gateway Description', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Please remit your payment to the shop to allow for the delivery to be made', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Add a new title for the Noob Payments Gateway that customers will see when they are in the checkout page.', 'noob-pay-woo') ), 'instructions' => array( 'title' => __( 'Instructions', 'noob-pay-woo'), 'type' => 'textarea', 'default' => __( 'Default instructions', 'noob-pay-woo'), 'desc_tip' => true, 'description' => __( 'Instructions that will be added to the thank you page and odrer email', 'noob-pay-woo') ), ) ); } public function process_payments( $order_id ) { $order = wc_get_order( $order_id ); // Some other code } } } } add_filter( 'woocommerce_payment_gateways', 'add_to_woo_noob_payment_gateway'); function add_to_woo_noob_payment_gateway( $gateways ) { $gateways[] = 'WC_Noob_pay_Gateway'; return $gateways; } add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'woo_noob_payment_gateway_plugin_links' ); function woo_noob_payment_gateway_plugin_links( $links ) { $plugin_links = array( '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout&section=noob_payment' ) . '">' . __( 'Configure', 'noob-pay-woo' ) . '</a>' ); return array_merge( $plugin_links, $links ); } Now it should be displayed in checkout, when enabled…

December 29, 2023

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.