From 769d7bb8cf35aca56bc8381125efce1469edc643 Mon Sep 17 00:00:00 2001 From: Marcus Dahl Date: Fri, 4 Feb 2022 16:05:32 +0100 Subject: [PATCH] fix: no longer use default context for product names --- README.txt | 5 ++++- includes/wc-vipps-recurring-helper.php | 2 +- woo-vipps-recurring.php | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index df59c1e..403defc 100755 --- a/README.txt +++ b/README.txt @@ -2,7 +2,7 @@ Contributors: Vipps, EverydayAS Tags: vipps, recurring payments, subscriptions, woocommerce, woocommerce subscriptions Requires at least: 5.0 -Tested up to: 5.8 +Tested up to: 5.9 Stable tag: trunk Requires PHP: 7.0 License: AGPLv3.0 or later @@ -158,6 +158,9 @@ Alternatively you could look into using WooCommerce "Early renewals": [https://d ==== End Log ==== += 1.12.4 = +* Fixed: Product names no longer use the default context, meaning it will no longer get overridden by themes or plugins and show HTML in the Vipps app or app-switch screen. + = 1.12.3 = * Fixed: Initial charge description no longer contains " + " when no extra products are purchased. * Fixed: Filling in 0 in the trial field tricking us into adding a campaign to the product, also resulting in an empty `initialCharge.description` and being unable to check out. diff --git a/includes/wc-vipps-recurring-helper.php b/includes/wc-vipps-recurring-helper.php index a184200..4527e47 100755 --- a/includes/wc-vipps-recurring-helper.php +++ b/includes/wc-vipps-recurring-helper.php @@ -385,7 +385,7 @@ public static function get_failure_description_for_order( $order ) { public static function get_product_description( WC_Product $product ): string { $source = self::get_meta( $product, self::META_PRODUCT_DESCRIPTION_SOURCE ); - $description = $product->get_name(); + $description = $product->get_name( 'original' ); if ( $source === 'short_description' ) { $description = $product->get_short_description(); } diff --git a/woo-vipps-recurring.php b/woo-vipps-recurring.php index 6612b30..a30dc11 100755 --- a/woo-vipps-recurring.php +++ b/woo-vipps-recurring.php @@ -5,10 +5,10 @@ * Description: Offer recurring payments with Vipps for WooCommerce Subscriptions * Author: Everyday AS * Author URI: https://everyday.no - * Version: 1.12.3 + * Version: 1.12.4 * Requires at least: 4.4 - * Tested up to: 5.8 - * WC tested up to: 6.0 + * Tested up to: 5.9 + * WC tested up to: 6.1 * Text Domain: woo-vipps-recurring * Domain Path: /languages */ @@ -17,7 +17,7 @@ // phpcs:disable WordPress.Files.FileName -define( 'WC_VIPPS_RECURRING_VERSION', '1.12.3' ); +define( 'WC_VIPPS_RECURRING_VERSION', '1.12.4' ); add_action( 'plugins_loaded', 'woocommerce_gateway_vipps_recurring_init' );