Plugin Directory

Changeset 2799752


Ignore:
Timestamp:
10/17/2022 03:50:03 AM (3 years ago)
Author:
reynaldiarya
Message:

Add Setting and Donate Button

Location:
toko-ibest-bank-indonesia-for-woocommerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • toko-ibest-bank-indonesia-for-woocommerce/trunk/beipgw.php

    r2799329 r2799752  
    11<?php
    22// Prevent direct access
    3 if ( ! defined( 'ABSPATH' ) ) { 
     3if ( ! defined( 'ABSPATH' ) ) {
    44    exit; // Exit if accessed directly
    55}
     
    99 * Plugin URI:              https://wordpress.org/plugins/toko-ibest-bank-indonesia-for-woocommerce
    1010 * Description:             The WooCommerce Bank and e-Money Indonesia Payment Gateway plugin consists of several collections of banks and e-Money in Indonesia for WooCommerce payments.
    11  * Version:                 3.0.1
    12  * Author:              Reynaldi Arya
     11 * Version:                 3.0.2
     12 * Author:                  Reynaldi Arya
    1313 * Author URI:              https://reynaldiab.com
    14  * Requires at least:           4.1
     14 * Requires at least:       4.1
    1515 * Tested up to:            6.0.2
    16  * WC requires at least:        3.0.0
    17  * WC tested up to:             7.0.0
     16 * WC requires at least:    3.0.0
     17 * WC tested up to:         7.0.0
    1818 * License:                 GNU General Public License v3.0
    1919 * License URI:             http://www.gnu.org/licenses/gpl-3.0.html
     
    2222add_action( 'plugins_loaded', 'beipgw_init', 0 );
    2323add_filter ( 'woocommerce_payment_gateways', 'add_beipgw_gateway' );
     24add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'beipgw_plugin_action_links' );
     25
     26function beipgw_plugin_action_links( $actions ) {
     27   $actions[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=wc-settings&tab=checkout') ) .'">Settings</a>';
     28   $actions[] = '<a href="https://trakteer.id/reynaldiarya/tip" target="_blank" style="color:#3db634;">Donate</a>';
     29   return $actions;
     30};
    2431
    2532function beipgw_init() {
     
    8592    $methods[] = 'WC_Gateway_Allo_Bank';
    8693    $methods[] = 'WC_Gateway_GoPay';
    87     $methods[] = 'WC_Gateway_OVO'; 
     94    $methods[] = 'WC_Gateway_OVO';
    8895    $methods[] = 'WC_Gateway_Dana';
    8996    $methods[] = 'WC_Gateway_LinkAja';
    9097    $methods[] = 'WC_Gateway_ShopeePay';
    9198    $methods[] = 'WC_Gateway_QRIS';
    92    
     99
    93100    return $methods;
    94101}
     
    100107add_filter( 'woocommerce_get_sections_advanced', 'pcpgw_add_section' );
    101108function pcpgw_add_section( $sections ) {
    102    
     109
    103110    $sections['puc'] = __( 'Kode Pembayaran', 'pcpgw' );
    104     return $sections;   
     111    return $sections;
    105112}
    106113
     
    111118add_filter( 'woocommerce_get_settings_advanced', 'puc_all_settings', 10, 2 );
    112119function puc_all_settings( $settings, $current_section ) {
    113    
     120
    114121    /**
    115122     * Check the current section is what we want
     
    142149            'placeholder'   => 'Kode Pembayaran',
    143150        );
    144        
     151
    145152        $settings_puc[] = array(
    146153            'name'          => __( 'Angka Minimal', 'pcpgw' ),
     
    149156            'id'            => 'woocommerce_puc_min',
    150157            'default'       => '1',
    151         );   
     158        );
    152159        $settings_puc[] = array(
    153160            'name'          => __( 'Angka Maksimal', 'pcpgw' ),
     
    155162            'desc'          => __( 'Jumlah maximal penambahan kode pembayaran', 'pcpgw' ),
    156163            'id'            => 'woocommerce_puc_max',
    157             'default'       => '999', 
    158         ); 
    159        
     164            'default'       => '999',
     165        );
     166
    160167        $settings_puc[] = array( 'type' => 'sectionend', 'id' => 'puc' );
    161168        return $settings_puc;
    162        
     169
    163170    /**
    164171     * If not, return the standard settings
     
    171178/**
    172179 * Register Payment Code Function
    173  * 
     180 *
    174181 * To easily identify customers' payments
    175182 *
    176183 * @return void
    177184 */
    178 if ( 'yes' == get_option( 'woocommerce_puc_enabled' ) ) {   
     185if ( 'yes' == get_option( 'woocommerce_puc_enabled' ) ) {
    179186    add_action( 'woocommerce_cart_calculate_fees', 'add_puc' );
    180187    function add_puc(){
    181188        global $woocommerce;
    182189
    183 $enable = 1; 
    184 $min = get_option('woocommerce_puc_min') ;     
    185 $max = get_option('woocommerce_puc_max');   
     190$enable = 1;
     191$min = get_option('woocommerce_puc_min') ;
     192$max = get_option('woocommerce_puc_max');
    186193$title = '';
    187194        if(get_option( 'woocommerce_puc_title' )){
  • toko-ibest-bank-indonesia-for-woocommerce/trunk/readme.txt

    r2799329 r2799752  
    55Requires at least: 4.1
    66Tested up to: 6.0.2
    7 Stable tag: 3.0.1
     7Stable tag: 3.0.2
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4949
    5050== Changelog ==
     51= 3.0.2 - October 16, 2022 =
     52* Add Setting and Donate Button
     53
    5154= 3.0.1 - October 16, 2022 =
    5255* Fixed Bug
Note: See TracChangeset for help on using the changeset viewer.