Kadence WooCommerce Email Designer - Version 1.5.5

Version Description

  • Fix: Possible bug with placeholders and WPML
Download this release

Release Info

Developer britner
Plugin Icon 128x128 Kadence WooCommerce Email Designer
Version 1.5.5
Comparing to
See all releases

Code changes from version 1.5.4 to 1.5.5

kadence-woocommerce-email-designer.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Kadence WooCommerce Email Designer
4
  * Plugin URI: http://kadencewp.com/products/woocommerce-email-designer/
5
  * Description: Customize the default woocommerce email templates design and text through the native WordPress customizer. Preview emails and send test emails.
6
- * Version: 1.5.4
7
  * Author: Kadence WP
8
  * Author URI: http://kadencewp.com/
9
  * License: GPLv2 or later
@@ -59,7 +59,7 @@ class Kadence_Woomail_Designer {
59
 
60
  define( 'KT_WOOMAIL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
61
  define( 'KT_WOOMAIL_URL', plugin_dir_url( __FILE__ ) );
62
- define( 'KT_WOOMAIL_VERSION', '1.5.3' );
63
 
64
  if ( ! kadence_woomail_is_woo_active() ) {
65
  add_action( 'admin_notices', array( $this, 'admin_notice_need_woocommerce' ) );
@@ -382,6 +382,14 @@ class Kadence_Woomail_Designer {
382
  if ( 0 === ( $user_id = (int) get_post_meta( $order->get_id(), '_customer_user', true ) ) ) {
383
  $user_id = 'guest';
384
  }
 
 
 
 
 
 
 
 
385
  // Check for placeholders.
386
  $body_text = str_replace( '{order_date}', wc_format_datetime( $order->get_date_created() ), $body_text );
387
  $body_text = str_replace( '{order_number}', $order->get_order_number(), $body_text );
@@ -391,14 +399,6 @@ class Kadence_Woomail_Designer {
391
  $body_text = str_replace( '{customer_company}', $order->get_billing_company(), $body_text );
392
  $body_text = str_replace( '{customer_email}', $order->get_billing_email(), $body_text );
393
  $body_text = str_replace( '{customer_username}', self::get_username_from_id( $user_id ), $body_text );
394
- if ( class_exists( 'WCML_Orders' ) ) {
395
- $order_language = WCML_Orders::getLanguage( $order->get_id() );
396
- if ( $order_language ) {
397
- $language_code = $order_language;
398
- $name = '[kt_woomail]' . $setting_key;
399
- $body_text = apply_filters( 'wpml_translate_single_string', $body_text, 'admin_texts_kt_woomail', $name, $order_language );
400
- }
401
- }
402
  }
403
 
404
  $body_text = apply_filters( 'kadence_woomail_order_body_text', $body_text, $order, $sent_to_admin, $plain_text, $email );
@@ -469,14 +469,6 @@ class Kadence_Woomail_Designer {
469
  if ( 0 === ( $user_id = (int) get_post_meta( $email->object->get_id(), '_customer_user', true ) ) ) {
470
  $user_id = 'guest';
471
  }
472
- $subtitle = str_replace( '{order_date}', wc_format_datetime( $email->object->get_date_created() ), $subtitle );
473
- $subtitle = str_replace( '{order_number}', $email->object->get_order_number(), $subtitle );
474
- $subtitle = str_replace( '{customer_first_name}', $email->object->get_billing_first_name(), $subtitle );
475
- $subtitle = str_replace( '{customer_last_name}', $email->object->get_billing_last_name(), $subtitle );
476
- $subtitle = str_replace( '{customer_full_name}', $email->object->get_formatted_billing_full_name(), $subtitle );
477
- $subtitle = str_replace( '{customer_company}', $email->object->get_billing_company(), $subtitle );
478
- $subtitle = str_replace( '{customer_email}', $email->object->get_billing_email(), $subtitle );
479
- $subtitle = str_replace( '{customer_username}', self::get_username_from_id( $user_id ), $subtitle );
480
  if ( class_exists( 'WCML_Orders' ) ) {
481
  $order_id = ( method_exists( $email->object, 'get_id' ) ? $email->object->get_id() : '' );
482
  $order_language = WCML_Orders::getLanguage( $order_id );
@@ -488,7 +480,14 @@ class Kadence_Woomail_Designer {
488
  }
489
  }
490
  }
491
-
 
 
 
 
 
 
 
492
  } elseif ( is_a( $email->object, 'WC_Product' ) ) {
493
  $subtitle = str_replace( '{product_title}', $email->object->get_title(), $subtitle );
494
  }
3
  * Plugin Name: Kadence WooCommerce Email Designer
4
  * Plugin URI: http://kadencewp.com/products/woocommerce-email-designer/
5
  * Description: Customize the default woocommerce email templates design and text through the native WordPress customizer. Preview emails and send test emails.
6
+ * Version: 1.5.5
7
  * Author: Kadence WP
8
  * Author URI: http://kadencewp.com/
9
  * License: GPLv2 or later
59
 
60
  define( 'KT_WOOMAIL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
61
  define( 'KT_WOOMAIL_URL', plugin_dir_url( __FILE__ ) );
62
+ define( 'KT_WOOMAIL_VERSION', '1.5.5' );
63
 
64
  if ( ! kadence_woomail_is_woo_active() ) {
65
  add_action( 'admin_notices', array( $this, 'admin_notice_need_woocommerce' ) );
382
  if ( 0 === ( $user_id = (int) get_post_meta( $order->get_id(), '_customer_user', true ) ) ) {
383
  $user_id = 'guest';
384
  }
385
+ if ( class_exists( 'WCML_Orders' ) ) {
386
+ $order_language = WCML_Orders::getLanguage( $order->get_id() );
387
+ if ( $order_language ) {
388
+ $language_code = $order_language;
389
+ $name = '[kt_woomail]' . $setting_key;
390
+ $body_text = apply_filters( 'wpml_translate_single_string', $body_text, 'admin_texts_kt_woomail', $name, $order_language );
391
+ }
392
+ }
393
  // Check for placeholders.
394
  $body_text = str_replace( '{order_date}', wc_format_datetime( $order->get_date_created() ), $body_text );
395
  $body_text = str_replace( '{order_number}', $order->get_order_number(), $body_text );
399
  $body_text = str_replace( '{customer_company}', $order->get_billing_company(), $body_text );
400
  $body_text = str_replace( '{customer_email}', $order->get_billing_email(), $body_text );
401
  $body_text = str_replace( '{customer_username}', self::get_username_from_id( $user_id ), $body_text );
 
 
 
 
 
 
 
 
402
  }
403
 
404
  $body_text = apply_filters( 'kadence_woomail_order_body_text', $body_text, $order, $sent_to_admin, $plain_text, $email );
469
  if ( 0 === ( $user_id = (int) get_post_meta( $email->object->get_id(), '_customer_user', true ) ) ) {
470
  $user_id = 'guest';
471
  }
 
 
 
 
 
 
 
 
472
  if ( class_exists( 'WCML_Orders' ) ) {
473
  $order_id = ( method_exists( $email->object, 'get_id' ) ? $email->object->get_id() : '' );
474
  $order_language = WCML_Orders::getLanguage( $order_id );
480
  }
481
  }
482
  }
483
+ $subtitle = str_replace( '{order_date}', wc_format_datetime( $email->object->get_date_created() ), $subtitle );
484
+ $subtitle = str_replace( '{order_number}', $email->object->get_order_number(), $subtitle );
485
+ $subtitle = str_replace( '{customer_first_name}', $email->object->get_billing_first_name(), $subtitle );
486
+ $subtitle = str_replace( '{customer_last_name}', $email->object->get_billing_last_name(), $subtitle );
487
+ $subtitle = str_replace( '{customer_full_name}', $email->object->get_formatted_billing_full_name(), $subtitle );
488
+ $subtitle = str_replace( '{customer_company}', $email->object->get_billing_company(), $subtitle );
489
+ $subtitle = str_replace( '{customer_email}', $email->object->get_billing_email(), $subtitle );
490
+ $subtitle = str_replace( '{customer_username}', self::get_username_from_id( $user_id ), $subtitle );
491
  } elseif ( is_a( $email->object, 'WC_Product' ) ) {
492
  $subtitle = str_replace( '{product_title}', $email->object->get_title(), $subtitle );
493
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.kadencewp.com/about-us/
5
  Requires PHP: 5.2.4
6
  Requires at least: 5.3
7
  Tested up to: 6.0
8
- Stable tag: 1.5.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -81,6 +81,9 @@ After you create your translations make sure to clear your server cache from any
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 1.5.4 =
85
  * Fix: Possible bug with get_id for WPML filter.
86
 
5
  Requires PHP: 5.2.4
6
  Requires at least: 5.3
7
  Tested up to: 6.0
8
+ Stable tag: 1.5.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
81
 
82
  == Changelog ==
83
 
84
+ = 1.5.5 =
85
+ * Fix: Possible bug with placeholders and WPML
86
+
87
  = 1.5.4 =
88
  * Fix: Possible bug with get_id for WPML filter.
89