diff --git a/core/library/Moka_Init.php b/core/library/Moka_Init.php index a96e751..bff14c2 100644 --- a/core/library/Moka_Init.php +++ b/core/library/Moka_Init.php @@ -3,7 +3,7 @@ exit; } -define('OPTIMISTHUB_MOKA_PAY_VERSION', '3.7.0'); +define('OPTIMISTHUB_MOKA_PAY_VERSION', '3.7.1'); global $mokaVersion; $mokaVersion = OPTIMISTHUB_MOKA_PAY_VERSION; @@ -189,8 +189,13 @@ public function renderMinInstallmentMessage($price) $options = get_option( 'woocommerce_mokapay_settings' ); $isavaliable = data_get($options, 'installment_message'); + $stock = $product->get_stock_quantity(); - if($isavaliable == 'yes' && !is_shop() && $woocommerce_loop['name'] == '' && $product->is_type( 'simple' )) + if( + + $stock>0 && $isavaliable == 'yes' && !is_shop() && $woocommerce_loop['name'] == '' && $product->is_type( 'simple' ) || + $stock>0 && $isavaliable == 'yes' && !is_shop() && $woocommerce_loop['name'] == '' && $product->is_type( 'variable' ) + ) { $installments = get_option( 'woocommerce_mokapay-installments' ); $minRate = data_get(current($installments), 'rates.12.value'); diff --git a/core/library/Optimisthub_Ajax.php b/core/library/Optimisthub_Ajax.php index 16c8658..4711f60 100644 --- a/core/library/Optimisthub_Ajax.php +++ b/core/library/Optimisthub_Ajax.php @@ -227,17 +227,36 @@ private function renderedHtml( $params ) { $formHtml .='
'; } diff --git a/index.php b/index.php index 23b7774..011d309 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: Moka Payment Gateway for WooCommerce * Plugin URI: https://github.com/optimisthub/moka-woocommerce * Description: Moka Payment gateway for woocommerce - * Version: 3.7.0 + * Version: 3.7.1 * Author: Optimist Hub * Author URI: https://optimisthub.com?ref=mokaPayment * Domain Path: /languages/