Skip to content

Commit

Permalink
version 2.0.0.43
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipsesrl committed Jan 8, 2020
1 parent 116370a commit aed330b
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 112 deletions.
7 changes: 6 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.42
Stable tag: 2.0.0.43
License: GPLv3 or later
License URI: https://www.udesly.com/terms-conditions-of-use/#udesly-wordpress-plugin
Requires PHP: 5.6.0
Expand Down Expand Up @@ -80,6 +80,11 @@ That's all!

Absolutely! You can use the Udesly Adapter to create more than one website.
== Changelog ==

= 2.0.0.43 =
* Added Custom thank you page redirect
* Fixed product images for product with only 1 image

= 2.0.0.42 =
* Fixed minor wc js bug

Expand Down
7 changes: 5 additions & 2 deletions includes/WC/WC.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function public_hooks()
add_action('wp_ajax_nopriv_udesly_wc_get_notices', array(self::class, "udesly_wc_get_notices"));
add_filter('woocommerce_gallery_image_size', array(self::class, "product_images_size"), 99);

// TODO: re add this filter add_filter('template_include', [self::class, 'udesly_redirect_order_confirmation'], 99);
add_filter('template_include', [self::class, 'udesly_redirect_order_confirmation'], 99);
}

public static function udesly_redirect_order_confirmation($template)
Expand All @@ -40,8 +40,11 @@ public static function udesly_redirect_order_confirmation($template)
if (file_exists(get_template_directory() . '/wc-order-confirmation.php')) {
global $wc_order;
$wc_order = wc_get_order($wp->query_vars['order-received']);
if ($wc_order) {
if ($wc_order && $wc_order->get_user_id() == get_current_user_id()) {
return get_template_directory() . '/wc-order-confirmation.php';
} else {
wp_redirect(wc_get_checkout_url());
exit;
}
}

Expand Down
Loading

0 comments on commit aed330b

Please sign in to comment.