From c5aad23b6a87f80813b32ce8d4a3716dac1b8042 Mon Sep 17 00:00:00 2001 From: EclipseSrl Date: Thu, 17 Dec 2020 10:23:34 +0100 Subject: [PATCH] release 2.0.19 --- README.txt | 2 +- includes/misc/woocommerce.php | 20 ++++++++++++++++++++ udesly-adapter-plugin.php | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index f10df1e..c0c2c25 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: https://www.udesly.com/ Tags: webflow to wordpress, editor, page builder, layout design, udesly, webflow Requires at least: 5.0 Tested up to: 5.2.3 -Stable tag: 2.0.18 +Stable tag: 2.0.19 License: GPLv3 or later License URI: https://www.udesly.com/terms-conditions-of-use/#udesly-wordpress-plugin Requires PHP: 7.0.0 diff --git a/includes/misc/woocommerce.php b/includes/misc/woocommerce.php index 720da9d..669f716 100644 --- a/includes/misc/woocommerce.php +++ b/includes/misc/woocommerce.php @@ -615,6 +615,26 @@ function udesly_wc_webflow_checkout($classes = '{}') } +function udesly_wc_before_cart() { + wc_maybe_define_constant( 'WOOCOMMERCE_CART', true ); + + $nonce_value = wc_get_var( $_REQUEST['woocommerce-shipping-calculator-nonce'], wc_get_var( $_REQUEST['_wpnonce'], '' ) ); // @codingStandardsIgnoreLine. + + // Update Shipping. Nonce check uses new value and old value (woocommerce-cart). @todo remove in 4.0. + if ( ! empty( $_POST['calc_shipping'] ) && ( wp_verify_nonce( $nonce_value, 'woocommerce-shipping-calculator' ) || wp_verify_nonce( $nonce_value, 'woocommerce-cart' ) ) ) { // WPCS: input var ok. + self::calculate_shipping(); + + // Also calc totals before we check items so subtotals etc are up to date. + WC()->cart->calculate_totals(); + } + + // Check cart items are valid. + do_action( 'woocommerce_check_cart_items' ); + + // Calc totals. + WC()->cart->calculate_totals(); +} + function udesly_wc_alternative_template($located, $template_name, $args, $template_path, $default_path) { diff --git a/udesly-adapter-plugin.php b/udesly-adapter-plugin.php index 907db35..41a4be5 100644 --- a/udesly-adapter-plugin.php +++ b/udesly-adapter-plugin.php @@ -11,7 +11,7 @@ * Plugin Name: Udesly Adapter * Plugin URI: https://www.udesly.com * Description: This is a support plugin for Udesly (Webflow to WordPress converter) that allows you to enable additional features for your theme. - * Version: 2.0.18 + * Version: 2.0.19 * Author: Udesly * Author URI: https://www.udesly.com * License: GPL-2.0+ @@ -29,7 +29,7 @@ // Constants defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH', plugin_dir_path(__FILE__)); defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL', plugin_dir_url(__FILE__)); -defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.18"); +defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.19"); defined('UDESLY_TEXT_DOMAIN') ?: define('UDESLY_TEXT_DOMAIN', "udesly-adapter-plugin"); defined('UDESLY_ADAPTER_PLUGIN_MISC_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_MISC_PATH', plugin_dir_path(__FILE__) . 'includes/misc/');