From 6f3e7941a0314f4a065e3d8c8939a192b3c7e66a Mon Sep 17 00:00:00 2001 From: trgino Date: Sat, 28 Oct 2023 10:10:39 +0300 Subject: [PATCH] v3.8.2 released --- changelog.md | 3 +++ core/library/Optimisthub_Ajax.php | 12 ++++++++++-- index.php | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 9279f48..1ba6da5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +#### Version 3.8.2 +- Issue : Order total at pay for order state + #### Version 3.8.1 - Issue : Installments Rate Save diff --git a/core/library/Optimisthub_Ajax.php b/core/library/Optimisthub_Ajax.php index 725b932..a675318 100644 --- a/core/library/Optimisthub_Ajax.php +++ b/core/library/Optimisthub_Ajax.php @@ -281,8 +281,16 @@ private function renderedHtml( $response, $params ) if($orderState == 'cart'){ $orderTotal = data_get($woocommerce, 'cart.total'); }elseif($orderState == 'order'){ - $order = wc_get_order(get_query_var('order-pay')); - $orderTotal = $order->get_total(); + if(get_query_var('order-pay')){ + $order = wc_get_order(get_query_var('order-pay')); + if($order){ + $orderTotal = $order->get_total(); + }else{ + $orderTotal = data_get($woocommerce, 'cart.total'); + } + }else{ + $orderTotal = data_get($woocommerce, 'cart.total'); + } } $installmentRates = data_get($params, 'installments.rates'); diff --git a/index.php b/index.php index 631956b..4ebfb3c 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.8.1 + * Version: 3.8.2 * Author: Optimist Hub * Author URI: https://optimisthub.com/?utm_source=moka-woocommerce&utm_campaign=moka-woocommerce&utm_content=plugins * Domain Path: /languages/ @@ -14,7 +14,7 @@ exit; } -define( 'OPTIMISTHUB_MOKA_PAY_VERSION', '3.8.1' ); +define( 'OPTIMISTHUB_MOKA_PAY_VERSION', '3.8.2' ); define( 'OPTIMISTHUB_MOKA_BASENAME', plugin_basename( __FILE__ ) ); define( 'OPTIMISTHUB_MOKA_DIR', plugin_dir_path( __FILE__ ) ); define( 'OPTIMISTHUB_MOKA_URL', plugin_dir_url( __FILE__ ) );