mirror of
https://github.com/10h30/woo-viet.git
synced 2026-07-11 18:56:13 +09:00
Open OnePay for VND only
This commit is contained in:
@@ -101,7 +101,16 @@ class WooViet_Admin_Page {
|
|||||||
<br/>
|
<br/>
|
||||||
<label for="">
|
<label for="">
|
||||||
<?php
|
<?php
|
||||||
echo sprintf( __( 'Please configure this gateway under <a href="%s">WooCommerce -> Settings -> Checkout</a>', 'woo-viet' ), admin_url( 'admin.php?page=wc-settings&tab=checkout' ) );
|
echo sprintf( __( 'Your store currency is <code>%s</code>. ', 'woo-viet' ), get_woocommerce_currency() );
|
||||||
|
// Handle whether or not the store current is VND
|
||||||
|
if ( 'VND' == get_woocommerce_currency() ) {
|
||||||
|
_e( 'OnePay can work on your site.', 'woo-viet' );
|
||||||
|
echo '<br/>';
|
||||||
|
echo sprintf( __( 'Please configure this gateway under <a href="%s">WooCommerce -> Settings -> Checkout</a>.', 'woo-viet' ), admin_url( 'admin.php?page=wc-settings&tab=checkout' ) );
|
||||||
|
} else {
|
||||||
|
_e( '<span style="color: red" ">This gateway is not active on your site. Because OnePay supports VND only.</span>', 'woo-viet' );
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
+3
-1
@@ -138,7 +138,9 @@ class WooViet {
|
|||||||
$settings = self::get_settings();
|
$settings = self::get_settings();
|
||||||
|
|
||||||
// Check if "Add the OnePay Domestic Gateway" is enabled
|
// Check if "Add the OnePay Domestic Gateway" is enabled
|
||||||
if ( 'yes' == $settings['add_onepay_domestic']['enabled'] ) {
|
if ( 'yes' == $settings['add_onepay_domestic']['enabled']
|
||||||
|
AND 'VND' == get_woocommerce_currency()
|
||||||
|
) {
|
||||||
include( 'inc/class-wooviet-onepay-domestic.php' );
|
include( 'inc/class-wooviet-onepay-domestic.php' );
|
||||||
|
|
||||||
add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateway_class' ) );
|
add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateway_class' ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user