WC Vendors - Version 2.1.8

Version Description

Download this release

Release Info

Developer digitalchild
Plugin Icon 128x128 WC Vendors
Version 2.1.8
Comparing to
See all releases

Code changes from version 2.1.7 to 2.1.8

changelog.txt CHANGED
@@ -1,5 +1,14 @@
1
  Changelog for WC Vendors Marketplace
2
 
 
 
 
 
 
 
 
 
 
3
  Version 2.1.7
4
 
5
  * Added: sold_by shortcode #542
1
  Changelog for WC Vendors Marketplace
2
 
3
+ Version 2.1.8 - 18th April 2019
4
+
5
+ * Fixed: Vendor featured product shortcode display the same products for every vendor #553
6
+ * Fixed: Incorrect use of woocommerce_email_order_meta #555
7
+ * Fixed: Deny vendor application email not firing
8
+ * Fixed: Approve/deny emails not firing when Pro is enabled.
9
+ * Fixed: Billing address showing in emails when hidden
10
+ * Fixed: Shortcode not showing in container when used in page builders #544
11
+
12
  Version 2.1.7
13
 
14
  * Added: sold_by shortcode #542
class-wc-vendors.php CHANGED
@@ -7,11 +7,11 @@
7
  * Author URI: https://www.wcvendors.com
8
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
  *
10
- * Version: 2.1.7
11
  * Requires at least: 4.4.0
12
  * Tested up to: 5.1
13
  * WC requires at least: 3.3.0
14
- * WC tested up to: 3.5.7
15
  *
16
  * Text Domain: wc-vendors
17
  * Domain Path: /languages/
@@ -97,7 +97,7 @@ if ( wcv_is_woocommerce_activated() ) {
97
  */
98
  class WC_Vendors {
99
 
100
- public $version = '2.1.7';
101
 
102
  /**
103
  * @var
7
  * Author URI: https://www.wcvendors.com
8
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
  *
10
+ * Version: 2.1.8
11
  * Requires at least: 4.4.0
12
  * Tested up to: 5.1
13
  * WC requires at least: 3.3.0
14
+ * WC tested up to: 3.5.8
15
  *
16
  * Text Domain: wc-vendors
17
  * Domain Path: /languages/
97
  */
98
  class WC_Vendors {
99
 
100
+ public $version = '2.1.8';
101
 
102
  /**
103
  * @var
classes/admin/emails/class-emails.php CHANGED
@@ -37,16 +37,9 @@ class WCV_Emails {
37
  add_action( 'wcvendors_email_order_details' , array( $this, 'vendor_order_details' ) , 10, 8 );
38
  add_action( 'wcvendors_email_customer_details', array( $this, 'vendor_customer_details' ), 10, 4 );
39
 
40
- if ( is_wcv_pro_active() ) {
41
- $manual = wc_string_to_bool( get_option( 'wcvendors_vendor_approve_registration', 'no' ) );
42
- if ( $manual ){
43
- add_action( 'wcv_pro_store_settings_saved', array( $this, 'vendor_application' ), 10, 2 );
44
- } else {
45
- add_action( 'add_user_role', array( $this, 'vendor_application' ), 10, 2 );
46
- }
47
- } else {
48
- add_action( 'add_user_role', array( $this, 'vendor_application' ), 10, 2 );
49
- }
50
 
51
  // WooCommerce Product Enquiry Compatibility
52
  add_filter( 'product_enquiry_send_to', array( $this, 'product_enquiry_compatibility' ), 10, 2 );
@@ -222,6 +215,17 @@ class WCV_Emails {
222
 
223
  }
224
 
 
 
 
 
 
 
 
 
 
 
 
225
  /*
226
  * Show the order details table filtered for each vendor
227
  */
@@ -274,7 +278,7 @@ class WCV_Emails {
274
  $show_customer_shipping_name = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_shipping_name', 'no' ) );
275
  $show_customer_email = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_email', 'no' ) );
276
  $show_customer_phone = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_phone', 'no' ) );
277
- $show_billing_address = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_shipping', 'no' ) );
278
  $show_shipping_address = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_shipping', 'no' ) );
279
  $customer_billing_name = $show_customer_billing_name ? $order->get_formatted_billing_full_name() : '';
280
  $customer_shipping_name = $show_customer_shipping_name ? $order->get_formatted_shipping_full_name() : '';
37
  add_action( 'wcvendors_email_order_details' , array( $this, 'vendor_order_details' ) , 10, 8 );
38
  add_action( 'wcvendors_email_customer_details', array( $this, 'vendor_customer_details' ), 10, 4 );
39
 
40
+ // Trigger application emails as required.
41
+ add_action( 'add_user_role', array( $this, 'vendor_application' ), 10, 2 );
42
+ add_action( 'wcvendors_deny_vendor' , array( $this, 'deny_application' ) );
 
 
 
 
 
 
 
43
 
44
  // WooCommerce Product Enquiry Compatibility
45
  add_filter( 'product_enquiry_send_to', array( $this, 'product_enquiry_compatibility' ), 10, 2 );
215
 
216
  }
217
 
218
+ /**
219
+ * Trigger the deny application email
220
+ *
221
+ * @since 2.1.8
222
+ *
223
+ */
224
+ public function deny_application( $user ){
225
+ $user_id = $user->ID;
226
+ WC()->mailer()->emails['WCVendors_Vendor_Notify_Denied']->trigger( $user_id );
227
+ }
228
+
229
  /*
230
  * Show the order details table filtered for each vendor
231
  */
278
  $show_customer_shipping_name = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_shipping_name', 'no' ) );
279
  $show_customer_email = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_email', 'no' ) );
280
  $show_customer_phone = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_phone', 'no' ) );
281
+ $show_billing_address = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_billing', 'no' ) );
282
  $show_shipping_address = wc_string_to_bool( get_option( 'wcvendors_capability_order_customer_shipping', 'no' ) );
283
  $customer_billing_name = $show_customer_billing_name ? $order->get_formatted_billing_full_name() : '';
284
  $customer_shipping_name = $show_customer_shipping_name ? $order->get_formatted_shipping_full_name() : '';
classes/includes/class-wcv-shortcodes.php CHANGED
@@ -240,7 +240,7 @@ class WCV_Shortcodes {
240
 
241
  $args = array(
242
  'post_type' => 'product',
243
- 'post_author' => self::get_vendor( $vendor ),
244
  'post_status' => 'publish',
245
  'ignore_sticky_posts' => 1,
246
  'posts_per_page' => $per_page,
@@ -274,10 +274,10 @@ class WCV_Shortcodes {
274
 
275
  <?php woocommerce_product_loop_end(); ?>
276
 
277
- <?php
278
- endif;
279
 
280
- wp_reset_postdata();
281
 
282
  return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
283
  }
@@ -388,7 +388,7 @@ class WCV_Shortcodes {
388
 
389
  $args = array(
390
  'post_type' => 'product',
391
- 'post_author' => self::get_vendor( $vendor ),
392
  'post_status' => 'publish',
393
  'ignore_sticky_posts' => 1,
394
  'orderby' => $orderby,
@@ -425,11 +425,10 @@ class WCV_Shortcodes {
425
 
426
  <?php woocommerce_product_loop_end(); ?>
427
 
428
- <?php
 
429
  endif;
430
 
431
- wp_reset_postdata();
432
-
433
  return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
434
  }
435
 
@@ -739,16 +738,22 @@ class WCV_Shortcodes {
739
 
740
  if ( ! is_product() ) return;
741
 
742
- $vendor_id = get_the_author_meta( 'ID' );
743
- $sold_by_label = get_option( 'wcvendors_label_sold_by' );
744
- $sold_by_separator = get_option( 'wcvendors_label_sold_by_separator' );
 
 
 
 
 
 
 
 
745
  $sold_by = WCV_Vendors::is_vendor( $vendor_id )
746
  ? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
747
  : get_bloginfo( 'name' );
748
 
749
- echo apply_filters( 'wcvendors_cart_sold_by_meta', $sold_by_label, get_the_ID(), $vendor_id ) . '&nbsp;' . apply_filters( 'wcvendors_cart_sold_by_meta_separator', $sold_by_separator, get_the_ID(), $vendor_id ) . '&nbsp;' . $sold_by . '<br/>';
750
-
751
-
752
  }
753
 
754
  }
240
 
241
  $args = array(
242
  'post_type' => 'product',
243
+ 'author' => self::get_vendor( $vendor ),
244
  'post_status' => 'publish',
245
  'ignore_sticky_posts' => 1,
246
  'posts_per_page' => $per_page,
274
 
275
  <?php woocommerce_product_loop_end(); ?>
276
 
277
+ <?php
278
+ wp_reset_postdata();
279
 
280
+ endif;
281
 
282
  return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
283
  }
388
 
389
  $args = array(
390
  'post_type' => 'product',
391
+ 'author' => self::get_vendor( $vendor ),
392
  'post_status' => 'publish',
393
  'ignore_sticky_posts' => 1,
394
  'orderby' => $orderby,
425
 
426
  <?php woocommerce_product_loop_end(); ?>
427
 
428
+ <?php
429
+ wp_reset_postdata();
430
  endif;
431
 
 
 
432
  return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
433
  }
434
 
738
 
739
  if ( ! is_product() ) return;
740
 
741
+ $atts = shortcode_atts(
742
+ array(
743
+ 'vendor_id' => get_the_author_meta( 'ID' ),
744
+ 'sold_by_label' => get_option( 'wcvendors_label_sold_by' ),
745
+ 'sold_by_separator' => get_option( 'wcvendors_label_sold_by_separator' ),
746
+ ),
747
+ $atts,
748
+ 'wcv_sold_by'
749
+ );
750
+ extract( $atts );
751
+
752
  $sold_by = WCV_Vendors::is_vendor( $vendor_id )
753
  ? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
754
  : get_bloginfo( 'name' );
755
 
756
+ return apply_filters( 'wcvendors_cart_sold_by_meta', $sold_by_label, get_the_ID(), $vendor_id ) . '&nbsp;' . apply_filters( 'wcvendors_cart_sold_by_meta_separator', $sold_by_separator, get_the_ID(), $vendor_id ) . '&nbsp;' . $sold_by . '<br/>';
 
 
757
  }
758
 
759
  }
languages/wc-vendors.pot CHANGED
@@ -1055,19 +1055,19 @@ msgstr ""
1055
  msgid "Quantity: %d"
1056
  msgstr ""
1057
 
1058
- #: classes/admin/emails/class-emails.php:81, classes/admin/emails/class-emails.php:214, classes/admin/emails/class-wc-approve-vendor.php:72
1059
  msgid "pending"
1060
  msgstr ""
1061
 
1062
- #: classes/admin/emails/class-emails.php:83, classes/admin/emails/class-emails.php:218
1063
  msgid "approved"
1064
  msgstr ""
1065
 
1066
- #: classes/admin/emails/class-emails.php:85
1067
  msgid "denied"
1068
  msgstr ""
1069
 
1070
- #: classes/admin/emails/class-emails.php:166
1071
  msgid "Resend %s new order notification"
1072
  msgstr ""
1073
 
1055
  msgid "Quantity: %d"
1056
  msgstr ""
1057
 
1058
+ #: classes/admin/emails/class-emails.php:74, classes/admin/emails/class-emails.php:207, classes/admin/emails/class-wc-approve-vendor.php:72
1059
  msgid "pending"
1060
  msgstr ""
1061
 
1062
+ #: classes/admin/emails/class-emails.php:76, classes/admin/emails/class-emails.php:211
1063
  msgid "approved"
1064
  msgstr ""
1065
 
1066
+ #: classes/admin/emails/class-emails.php:78
1067
  msgid "denied"
1068
  msgstr ""
1069
 
1070
+ #: classes/admin/emails/class-emails.php:159
1071
  msgid "Resend %s new order notification"
1072
  msgstr ""
1073
 
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "wc-vendors",
3
- "version": "2.1.7",
4
  "private": true,
5
  "dependencies": {},
6
  "devDependencies": {
1
  {
2
  "name": "wc-vendors",
3
+ "version": "2.1.8",
4
  "private": true,
5
  "dependencies": {},
6
  "devDependencies": {
readme.txt CHANGED
@@ -7,7 +7,7 @@ Plugin URI: https://www.wcvendors.com/
7
  Requires at least: 4.4.0
8
  Requires PHP: 5.6
9
  Tested up to: 5.1
10
- Stable tag: 2.1.7
11
  License: GPLv2 or later
12
 
13
  The number one most downloaded marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
@@ -157,6 +157,15 @@ WC Vendors Marketplace does not work with multisite WordPress. There are no plan
157
 
158
  == Changelog ==
159
 
 
 
 
 
 
 
 
 
 
160
  = Version 2.1.7 - 20th March 2019 =
161
 
162
  * Added: sold_by shortcode #542
7
  Requires at least: 4.4.0
8
  Requires PHP: 5.6
9
  Tested up to: 5.1
10
+ Stable tag: 2.1.8
11
  License: GPLv2 or later
12
 
13
  The number one most downloaded marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
157
 
158
  == Changelog ==
159
 
160
+ = Version 2.1.8 - 18th April 2019 =
161
+
162
+ * Fixed: Vendor featured product shortcode display the same products for every vendor #553
163
+ * Fixed: Incorrect use of woocommerce_email_order_meta #555
164
+ * Fixed: Deny vendor application email not firing
165
+ * Fixed: Approve/deny emails not firing when Pro is enabled.
166
+ * Fixed: Billing address showing in emails when hidden
167
+ * Fixed: Shortcode not showing in container when used in page builders #544
168
+
169
  = Version 2.1.7 - 20th March 2019 =
170
 
171
  * Added: sold_by shortcode #542
templates/emails/notify-vendor-shipped.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author WooThemes
6
  * @package WooCommerce/Templates/Emails/HTML
7
- * @version 2.0.0
8
  */
9
  if ( ! defined( 'ABSPATH' ) ) {
10
  exit;
@@ -77,7 +77,7 @@ $order_date = $order->get_date_created();
77
 
78
  <?php do_action( 'woocommerce_email_after_order_table', $order, true ); ?>
79
 
80
- <?php do_action( 'woocommerce_email_order_meta', $order, true ); ?>
81
 
82
  <h2><?php _e( 'Customer details', 'wc-vendors' ); ?></h2>
83
 
4
  *
5
  * @author WooThemes
6
  * @package WooCommerce/Templates/Emails/HTML
7
+ * @version 2.1.8
8
  */
9
  if ( ! defined( 'ABSPATH' ) ) {
10
  exit;
77
 
78
  <?php do_action( 'woocommerce_email_after_order_table', $order, true ); ?>
79
 
80
+ <?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); ?>
81
 
82
  <h2><?php _e( 'Customer details', 'wc-vendors' ); ?></h2>
83
 
templates/emails/vendor-new-order.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @author WC Vendors
7
  * @package WooCommerce/Templates/Emails/HTML
8
- * @version 1.9.9
9
  */
10
  if ( ! defined( 'ABSPATH' ) ) {
11
  exit;
@@ -84,7 +84,7 @@ $order_date = $order->get_date_created();
84
 
85
  <?php do_action( 'woocommerce_email_after_order_table', $order, true ); ?>
86
 
87
- <?php do_action( 'woocommerce_email_order_meta', $order, true ); ?>
88
 
89
  <h2><?php _e( 'Customer details', 'wc-vendors' ); ?></h2>
90
 
5
  *
6
  * @author WC Vendors
7
  * @package WooCommerce/Templates/Emails/HTML
8
+ * @version 2.1.8
9
  */
10
  if ( ! defined( 'ABSPATH' ) ) {
11
  exit;
84
 
85
  <?php do_action( 'woocommerce_email_after_order_table', $order, true ); ?>
86
 
87
+ <?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); ?>
88
 
89
  <h2><?php _e( 'Customer details', 'wc-vendors' ); ?></h2>
90