WC Vendors - Version 1.9.9

Version Description

No Upgrade required at this time.

Download this release

Release Info

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

Code changes from version 1.9.8 to 1.9.9

changelog.txt CHANGED
@@ -1,5 +1,25 @@
1
  Changelog for WC Vendors
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Version 1.9.8
4
 
5
  * Fixed: Paypal adaptive payments url changes
1
  Changelog for WC Vendors
2
 
3
+ Version 1.9.9
4
+
5
+ * Added: Filters to vendor admin dashboard class for custom columns #339
6
+ * Added: Vendor shop name to the <title> tag on products archive page
7
+ * Updated Woocommerce 2.7 compatibility
8
+ * Updated: i18n text domain loading for proper translations #341
9
+ * Fixed: Class logger when called via includes files
10
+ * Fixed: Bug in how admin notices are displayed when saving shop settings
11
+ * Fixed: 2.7 compatibility bugs
12
+ * Fixed: Commissions Subtotal showing Full Product Price in vendor email #330
13
+ * Fixed: Capabilities Fix for Resetting Roles #329
14
+ * Fixed: HTML title attribute doesn't change for store pages #328
15
+ * Fixed: Login form not displayed if get variable set
16
+ * Fixed: Depreciated action in product edit screen
17
+
18
+ Templates Updated:
19
+ templates/emails/vendor-new-order.php
20
+ templates/emails/notify-vendor-shipped.php
21
+ templates/order/orders.php
22
+
23
  Version 1.9.8
24
 
25
  * Fixed: Paypal adaptive payments url changes
class-wc-vendors.php CHANGED
@@ -8,7 +8,7 @@
8
  * Author URI: https://www.wcvendors.com
9
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
10
  *
11
- * Version: 1.9.8
12
  * Requires at least: 4.4.0
13
  * Tested up to: 4.7.1
14
  *
@@ -72,7 +72,7 @@ if ( wcv_is_woocommerce_activated() ) {
72
  if ( !defined( 'wcv_plugin_dir_path' ) ) define( 'wcv_plugin_dir_path', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
73
 
74
 
75
- define('WCV_VERSION', '1.9.7' );
76
 
77
  /**
78
  * Main Product Vendor class
@@ -125,7 +125,7 @@ if ( wcv_is_woocommerce_activated() ) {
125
  */
126
  public function invalid_wc_version()
127
  {
128
- echo '<div class="error"><p>' . __( '<b>WC Vendors is disabled</b>. WC Vendors requires a minimum of WooCommerce v2.5.0.', 'wcvendors' ) . '</p></div>';
129
  }
130
 
131
  /**
@@ -159,8 +159,7 @@ if ( wcv_is_woocommerce_activated() ) {
159
  {
160
  global $woocommerce;
161
 
162
- // WC 2.5.0+ is required
163
- if ( version_compare( $woocommerce->version, '2.5', '<' ) ) {
164
  add_action( 'admin_notices', array( $this, 'invalid_wc_version' ) );
165
  deactivate_plugins( plugin_basename( __FILE__ ) );
166
  return false;
@@ -187,13 +186,11 @@ if ( wcv_is_woocommerce_activated() ) {
187
  }
188
 
189
  public function load_il8n() {
190
-
191
- $domain = 'wcvendors';
192
 
193
- $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
194
 
195
  //Place your custom translations into wp-content/languages/wc-vendors to be upgrade safe
196
- load_textdomain($domain, WP_LANG_DIR.'/wc-vendors/'.$domain.'-'.$locale.'.mo');
197
 
198
  load_plugin_textdomain( 'wcvendors', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
199
 
@@ -388,11 +385,34 @@ if ( wcv_is_woocommerce_activated() ) {
388
  if ( isset($_GET['wcv_pl_ignore_notice']) && '0' == $_GET['wcv_pl_ignore_notice'] ) {
389
  add_user_meta( $current_user_id, 'wcv_pl_ignore_notice', 'true' , true);
390
  }
 
391
  }
392
 
 
 
 
 
 
 
 
 
 
393
 
394
- }
 
 
 
 
 
 
 
 
 
 
 
 
395
 
 
396
 
397
  $wc_vendors = new WC_Vendors;
398
 
8
  * Author URI: https://www.wcvendors.com
9
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
10
  *
11
+ * Version: 1.9.9
12
  * Requires at least: 4.4.0
13
  * Tested up to: 4.7.1
14
  *
72
  if ( !defined( 'wcv_plugin_dir_path' ) ) define( 'wcv_plugin_dir_path', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
73
 
74
 
75
+ define('WCV_VERSION', '1.9.9' );
76
 
77
  /**
78
  * Main Product Vendor class
125
  */
126
  public function invalid_wc_version()
127
  {
128
+ echo '<div class="error"><p>' . __( '<b>WC Vendors is inactive</b>. WC Vendors requires a minimum of WooCommerce v2.7.0.', 'wcvendors' ) . '</p></div>';
129
  }
130
 
131
  /**
159
  {
160
  global $woocommerce;
161
 
162
+ if ( version_compare( WC_VERSION, '2.6', '<' ) ) {
 
163
  add_action( 'admin_notices', array( $this, 'invalid_wc_version' ) );
164
  deactivate_plugins( plugin_basename( __FILE__ ) );
165
  return false;
186
  }
187
 
188
  public function load_il8n() {
 
 
189
 
190
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'wcvendors' );
191
 
192
  //Place your custom translations into wp-content/languages/wc-vendors to be upgrade safe
193
+ load_textdomain( 'wcvendors', WP_LANG_DIR.'/wc-vendors/wcvendors-'.$locale.'.mo');
194
 
195
  load_plugin_textdomain( 'wcvendors', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
196
 
385
  if ( isset($_GET['wcv_pl_ignore_notice']) && '0' == $_GET['wcv_pl_ignore_notice'] ) {
386
  add_user_meta( $current_user_id, 'wcv_pl_ignore_notice', 'true' , true);
387
  }
388
+
389
  }
390
 
391
+ /**
392
+ * Class logger so that we can keep our debug and logging information cleaner
393
+ *
394
+ * @since 1.4.0
395
+ * @access public
396
+ *
397
+ * @param mixed - $data the data to go to the error log could be string, array or object
398
+ */
399
+ public static function log( $data = '' ){
400
 
401
+ $trace = debug_backtrace( false, 2 );
402
+ $path_info = pathinfo( $trace[ 0 ][ 'file' ] );
403
+
404
+ // Only display the class file if there is actually a class file
405
+ $caller = ( isset( $trace[ 1 ] ) ) ? array_key_exists( 'class', $trace[ 1 ] ) ? $trace[ 1 ][ 'class' ] : $path_info[ 'basename' ] : '';
406
+
407
+ if ( is_array( $data ) || is_object( $data ) ) {
408
+ error_log( $caller . ' : ' . print_r( $data, true ) );
409
+ } else {
410
+ error_log( $caller . ' : ' . $data );
411
+ }
412
+
413
+ } // log()
414
 
415
+ }
416
 
417
  $wc_vendors = new WC_Vendors;
418
 
classes/admin/class-admin-page.php CHANGED
@@ -36,11 +36,13 @@ class WCV_Admin_Setup
36
  {
37
  global $woocommerce;
38
 
 
 
39
  $authors = WCV_Vendors::get_vendors_from_order( $order );
40
  $authors = $authors ? array_keys( $authors ) : array();
41
  if ( empty( $authors ) ) return false;
42
 
43
- $shipped = (array) get_post_meta( $order->id, 'wc_pv_shipped', true );
44
  $string = '</br></br>';
45
 
46
  foreach ($authors as $author ) {
@@ -354,14 +356,14 @@ class WCV_Admin_Page extends WP_List_Table
354
  $user = get_userdata( $item->vendor_id );
355
  return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
356
  case 'total_due' :
357
- return woocommerce_price( $item->total_due );
358
  case 'total_shipping':
359
- return woocommerce_price($item->total_shipping );
360
  case 'tax':
361
- return woocommerce_price( $item->tax );
362
  case 'totals' :
363
  $totals = ( wc_tax_enabled() ) ? $item->total_due + $item->total_shipping + $item->tax : $item->total_due + $item->total_shipping;
364
- return woocommerce_price( $totals );
365
  case 'product_id' :
366
  $parent = get_post_ancestors( $item->product_id );
367
  $product_id = $parent ? $parent[ 0 ] : $item->product_id;
36
  {
37
  global $woocommerce;
38
 
39
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
40
+
41
  $authors = WCV_Vendors::get_vendors_from_order( $order );
42
  $authors = $authors ? array_keys( $authors ) : array();
43
  if ( empty( $authors ) ) return false;
44
 
45
+ $shipped = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
46
  $string = '</br></br>';
47
 
48
  foreach ($authors as $author ) {
356
  $user = get_userdata( $item->vendor_id );
357
  return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
358
  case 'total_due' :
359
+ return wc_price( $item->total_due );
360
  case 'total_shipping':
361
+ return wc_price($item->total_shipping );
362
  case 'tax':
363
+ return wc_price( $item->tax );
364
  case 'totals' :
365
  $totals = ( wc_tax_enabled() ) ? $item->total_due + $item->total_shipping + $item->tax : $item->total_due + $item->total_shipping;
366
+ return wc_price( $totals );
367
  case 'product_id' :
368
  $parent = get_post_ancestors( $item->product_id );
369
  $product_id = $parent ? $parent[ 0 ] : $item->product_id;
classes/admin/class-admin-reports.php CHANGED
@@ -134,21 +134,21 @@ class WCV_Admin_Reports
134
  <h3><span><?php _e( 'Total paid in range', 'wcvendors' ); ?></span></h3>
135
 
136
  <div class="inside">
137
- <p class="stat"><?php if ( $paid > 0 ) echo woocommerce_price( $paid ); else _e( 'n/a', 'wcvendors' ); ?></p>
138
  </div>
139
  </div>
140
  <div class="postbox">
141
  <h3><span><?php _e( 'Total due in range', 'wcvendors' ); ?></span></h3>
142
 
143
  <div class="inside">
144
- <p class="stat"><?php if ( $commission_due > 0 ) echo woocommerce_price( $commission_due ); else _e( 'n/a', 'wcvendors' ); ?></p>
145
  </div>
146
  </div>
147
  <div class="postbox">
148
  <h3><span><?php _e( 'Total reversed in range', 'wcvendors' ); ?></span></h3>
149
 
150
  <div class="inside">
151
- <p class="stat"><?php if ( $reversed > 0 ) echo woocommerce_price( $reversed ); else _e( 'n/a', 'wcvendors' ); ?></p>
152
  </div>
153
  </div>
154
  </div>
@@ -190,7 +190,7 @@ class WCV_Admin_Reports
190
  </td>
191
  <td><?php echo get_the_title( $row->product_id ); ?></td>
192
  <td><?php echo WCV_Vendors::get_vendor_shop_name( $row->vendor_id ); ?></td>
193
- <td><?php echo woocommerce_price( $row->total_due + $row->total_shipping + $row->tax ) ?></td>
194
  <td><?php echo date_i18n( __( 'D j M Y \a\t h:ia', 'wcvendors' ), strtotime( $row->time ) ) ?></td>
195
  <td><?php echo $commission_status_labels[ $row->status ]; ?></td>
196
  </tr>
@@ -291,7 +291,7 @@ class WCV_Admin_Reports
291
  if ( !empty( $selected_vendor ) || !empty( $products ) ) {
292
 
293
  foreach ($products as $key => $product_id) {
294
- $_product = get_product($product_id);
295
  $childs = $_product->get_children();
296
  $products = array_merge($childs, $products);
297
  }
@@ -377,7 +377,7 @@ class WCV_Admin_Reports
377
  echo '<td>' . __( 'Total', 'wcvendors' ) . '</td>';
378
 
379
  foreach ( $total as $value ) {
380
- echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
381
  }
382
  ?>
383
  </tr>
@@ -390,7 +390,7 @@ class WCV_Admin_Reports
390
  echo '<tr class="' . $alt . '"><td>' . $month . '</td>';
391
 
392
  foreach ( $commission as $value ) {
393
- echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
394
  }
395
 
396
  echo '</tr>';
@@ -474,10 +474,10 @@ class WCV_Admin_Reports
474
 
475
  echo '<tr>';
476
  echo '<td>' . $totals[ 'user_login' ]. '</td>';
477
- echo '<td>' . woocommerce_price( $totals[ 'tax' ] ). '</td>';
478
- echo '<td>' . woocommerce_price( $totals[ 'total_shipping' ] ). '</td>';
479
  echo '<td>' . $totals[ 'status' ] . '</td>';
480
- echo '<td>' . woocommerce_price( $totals[ 'total_due' ] ). '</td>';
481
  echo '</tr>';
482
 
483
  }
134
  <h3><span><?php _e( 'Total paid in range', 'wcvendors' ); ?></span></h3>
135
 
136
  <div class="inside">
137
+ <p class="stat"><?php if ( $paid > 0 ) echo wc_price( $paid ); else _e( 'n/a', 'wcvendors' ); ?></p>
138
  </div>
139
  </div>
140
  <div class="postbox">
141
  <h3><span><?php _e( 'Total due in range', 'wcvendors' ); ?></span></h3>
142
 
143
  <div class="inside">
144
+ <p class="stat"><?php if ( $commission_due > 0 ) echo wc_price( $commission_due ); else _e( 'n/a', 'wcvendors' ); ?></p>
145
  </div>
146
  </div>
147
  <div class="postbox">
148
  <h3><span><?php _e( 'Total reversed in range', 'wcvendors' ); ?></span></h3>
149
 
150
  <div class="inside">
151
+ <p class="stat"><?php if ( $reversed > 0 ) echo wc_price( $reversed ); else _e( 'n/a', 'wcvendors' ); ?></p>
152
  </div>
153
  </div>
154
  </div>
190
  </td>
191
  <td><?php echo get_the_title( $row->product_id ); ?></td>
192
  <td><?php echo WCV_Vendors::get_vendor_shop_name( $row->vendor_id ); ?></td>
193
+ <td><?php echo wc_price( $row->total_due + $row->total_shipping + $row->tax ) ?></td>
194
  <td><?php echo date_i18n( __( 'D j M Y \a\t h:ia', 'wcvendors' ), strtotime( $row->time ) ) ?></td>
195
  <td><?php echo $commission_status_labels[ $row->status ]; ?></td>
196
  </tr>
291
  if ( !empty( $selected_vendor ) || !empty( $products ) ) {
292
 
293
  foreach ($products as $key => $product_id) {
294
+ $_product = wc_get_product($product_id);
295
  $childs = $_product->get_children();
296
  $products = array_merge($childs, $products);
297
  }
377
  echo '<td>' . __( 'Total', 'wcvendors' ) . '</td>';
378
 
379
  foreach ( $total as $value ) {
380
+ echo '<td class="total_row">' . wc_price( $value ) . '</td>';
381
  }
382
  ?>
383
  </tr>
390
  echo '<tr class="' . $alt . '"><td>' . $month . '</td>';
391
 
392
  foreach ( $commission as $value ) {
393
+ echo '<td class="total_row">' . wc_price( $value ) . '</td>';
394
  }
395
 
396
  echo '</tr>';
474
 
475
  echo '<tr>';
476
  echo '<td>' . $totals[ 'user_login' ]. '</td>';
477
+ echo '<td>' . wc_price( $totals[ 'tax' ] ). '</td>';
478
+ echo '<td>' . wc_price( $totals[ 'total_shipping' ] ). '</td>';
479
  echo '<td>' . $totals[ 'status' ] . '</td>';
480
+ echo '<td>' . wc_price( $totals[ 'total_due' ] ). '</td>';
481
  echo '</tr>';
482
 
483
  }
classes/admin/class-admin-users.php CHANGED
@@ -78,30 +78,6 @@ class WCV_Admin_Users
78
  }
79
  }
80
 
81
- // public function get_terms_filter( $terms, $tax, $args )
82
- // {
83
- // if ( $tax[0] != 'product_type' || ( $tax[0] == 'product_type' && ! empty( $args['include'] ) ) ) {
84
- // return $terms;
85
- // }
86
-
87
- // $products = WCV_Vendors::get_vendor_products( get_current_user_id() );
88
- // $ids = array();
89
- // foreach ( $products as $product ) {
90
- // $ids[ ] = ( $product->ID );
91
- // $product = get_product( $product )->product_type;
92
- // var_dump($product);exit;
93
- // }
94
-
95
- // $args['include'] = $ids;
96
-
97
- // var_dump($terms);exit;
98
-
99
- // $terms = get_terms( $tax[0], $args);
100
-
101
-
102
- // return $terms;
103
- // }
104
-
105
  public function csv_import_suite_compatibility( $capability )
106
  {
107
  return 'manage_product';
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  public function csv_import_suite_compatibility( $capability )
82
  {
83
  return 'manage_product';
classes/admin/class-product-meta.php CHANGED
@@ -25,7 +25,7 @@ class WCV_Product_Meta
25
  add_action( 'wp_dropdown_users', array( $this, 'author_vendor_roles' ), 0, 1 );
26
  if ( apply_filters( 'wcv_product_commission_tab', true ) ) {
27
  add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'add_tab' ) );
28
- add_action( 'woocommerce_product_write_panels', array( $this, 'add_panel' ) );
29
  add_action( 'woocommerce_process_product_meta', array( $this, 'save_panel' ) );
30
  }
31
 
25
  add_action( 'wp_dropdown_users', array( $this, 'author_vendor_roles' ), 0, 1 );
26
  if ( apply_filters( 'wcv_product_commission_tab', true ) ) {
27
  add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'add_tab' ) );
28
+ add_action( 'woocommerce_product_data_panels', array( $this, 'add_panel' ) );
29
  add_action( 'woocommerce_process_product_meta', array( $this, 'save_panel' ) );
30
  }
31
 
classes/admin/class-vendor-admin-dashboard.php CHANGED
@@ -8,11 +8,13 @@
8
 
9
  Class WCV_Vendor_Admin_Dashboard {
10
 
 
 
11
  function __construct(){
12
  // Add Shop Settings page
13
  add_action( 'admin_menu', array( $this, 'vendor_dashboard_pages') );
14
  // Hook into init for form processing
15
- add_action( 'init', array( $this, 'save_shop_settings' ) );
16
  add_action( 'admin_head', array( $this, 'admin_enqueue_order_style') );
17
  }
18
 
@@ -90,17 +92,42 @@ Class WCV_Vendor_Admin_Dashboard {
90
  do_action( 'wcvendors_shop_settings_admin_saved', $user_id );
91
 
92
  if ( ! $error ) {
93
- echo '<div class="updated"><p>';
94
- echo __( 'Settings saved.', 'wcvendors' );
95
- echo '</p></div>';
96
  } else {
97
- echo '<div class="error"><p>';
98
- echo $error_msg;
99
- echo '</p></div>';
100
  }
101
  }
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  *
106
  *
@@ -252,6 +279,8 @@ class WCV_Vendor_Order_Page extends WP_List_Table
252
  return $item->date;
253
  case 'status' :
254
  return $item->status;
 
 
255
  }
256
  }
257
 
@@ -298,7 +327,8 @@ class WCV_Vendor_Order_Page extends WP_List_Table
298
 
299
  if ( !$this->can_view_comments ) unset( $columns['comments'] );
300
 
301
- return $columns;
 
302
  }
303
 
304
 
@@ -424,7 +454,8 @@ class WCV_Vendor_Order_Page extends WP_List_Table
424
 
425
  $products = array();
426
 
427
- foreach ($vendor_products as $_product) {
 
428
  $products[] = $_product->ID;
429
  }
430
 
@@ -432,12 +463,14 @@ class WCV_Vendor_Order_Page extends WP_List_Table
432
 
433
  $model_id = 0;
434
 
435
- if (!empty( $_orders ) ) {
 
436
  foreach ( $_orders as $order ) {
437
 
438
- $order = new WC_Order( $order->order_id );
439
- $valid_items = WCV_Queries::get_products_for_order( $order->id );
440
- $valid = array();
 
441
 
442
  $items = $order->get_items();
443
 
@@ -451,12 +484,21 @@ class WCV_Vendor_Order_Page extends WP_List_Table
451
 
452
  foreach ( $valid as $order_item_id => $item ) {
453
 
454
- $wc_product = new WC_Product( $item['product_id'] );
 
 
 
 
 
 
 
 
 
455
 
456
- $products .= '<strong>'. $item['qty'] . ' x ' . $item['name'] . '</strong><br />';
457
 
458
- if ( $metadata = $order->has_meta( $order_item_id ) ) {
459
  $products .= '<table cellspacing="0" class="wcv_display_meta">';
 
460
  foreach ( $metadata as $meta ) {
461
 
462
  // Skip hidden core fields
@@ -497,63 +539,27 @@ class WCV_Vendor_Order_Page extends WP_List_Table
497
 
498
  }
499
 
500
- $shippers = (array) get_post_meta( $order->id, 'wc_pv_shipped', true );
501
- $shipped = in_array($user_id, $shippers) ? __( 'Yes', 'wcvendors' ) : __( 'No', 'wcvendors' ) ;
 
502
 
503
- $sum = WCV_Queries::sum_for_orders( array( $order->id ), array('vendor_id' =>get_current_user_id() ), false );
504
  $sum = reset( $sum );
 
 
 
505
  $total = $sum->line_total;
506
 
507
  $comment_output = '';
508
 
509
- // Need to fix how form is submitted for adding comments if at all possible.
510
-
511
- // if ( $this->can_view_comments) {
512
-
513
- // $order_notes = $order->get_customer_order_notes();
514
-
515
- // $comment_output .= '<a href="#TB_inline?width=600&height=550&inlineId=order-comment-window-'.$model_id.'" class="thickbox">';
516
- // $comment_output .= sprintf( __( 'Comments (%s)', 'wcvendors' ), count( $order_notes ) );
517
- // $comment_output .= '</a>';
518
- // $comment_output .= '<div id="order-comment-window-'.$model_id.'" style="display:none;">';
519
- // $comment_output .= '<h3>'.__('Comments to Customer', 'wcvendors' ). '</h3>';
520
-
521
- // if ( !empty( $order_notes ) ) {
522
-
523
- // foreach ($order_notes as $order_note) {
524
- // $last_added = human_time_diff( strtotime( $order_note->comment_date_gmt ), current_time( 'timestamp', 1 ) );
525
- // $comment_output .= '<p>';
526
- // $comment_output .= $order_note->comment_content;
527
- // $comment_output .= '<br />';
528
- // $comment_output .= sprintf(__( 'added %s ago', 'wcvendors' ), $last_added );
529
- // $comment_output .= '<br />';
530
- // $comment_output .= '</p>';
531
- // }
532
-
533
- // } else {
534
- // $comment_output .= '<p>'.__('No comments currently to customer.', 'wcvendors' ). '</p>';
535
- // }
536
-
537
- // if ( $this->can_add_comments ) {
538
- // $comment_output .= wp_nonce_field( 'add-comment' );
539
- // $comment_output .= '
540
- // <textarea name="comment_text" style="width:97%"></textarea>
541
- // <input type="hidden" name="order_id" value="'. $order->id .'">
542
- // <input type="hidden" name="action" value="add_comment">
543
- // <input class="btn btn-large btn-block" type="submit" name="submit_comment" value="'.__( 'Add comment', 'wcvendors' ).'">';
544
- // }
545
-
546
- // $comment_output .= '</div>';
547
-
548
- // }
549
 
550
  $order_items = array();
551
- $order_items[ 'order_id' ] = $order->id;
552
  $order_items[ 'customer' ] = $order->get_formatted_shipping_address();
553
  $order_items[ 'products' ] = $products;
554
- $order_items[ 'total' ] = woocommerce_price( $total );
555
- $order_items[ 'date' ] = date_i18n( wc_date_format(), strtotime( $order->order_date ) );
556
- // $order_items[ 'comments' ] = $comment_output;
557
  $order_items[ 'status' ] = $shipped;
558
 
559
  $orders[] = (object) $order_items;
8
 
9
  Class WCV_Vendor_Admin_Dashboard {
10
 
11
+ public $dashboard_error_msg;
12
+
13
  function __construct(){
14
  // Add Shop Settings page
15
  add_action( 'admin_menu', array( $this, 'vendor_dashboard_pages') );
16
  // Hook into init for form processing
17
+ add_action( 'admin_init', array( $this, 'save_shop_settings' ) );
18
  add_action( 'admin_head', array( $this, 'admin_enqueue_order_style') );
19
  }
20
 
92
  do_action( 'wcvendors_shop_settings_admin_saved', $user_id );
93
 
94
  if ( ! $error ) {
95
+ add_action( 'admin_notices', array( $this, 'add_admin_notice_success' ) );
 
 
96
  } else {
97
+ $this->dashboard_error_msg = $error_msg;
98
+ add_action( 'admin_notices', array( $this, 'add_admin_notice_error' ) );
 
99
  }
100
  }
101
  }
102
 
103
+ /**
104
+ * Output a sucessful message after saving the shop settings
105
+ *
106
+ * @since 1.9.9
107
+ * @access public
108
+ */
109
+ public function add_admin_notice_success( ){
110
+
111
+ echo '<div class="updated"><p>';
112
+ echo __( 'Settings saved.', 'wcvendors' );
113
+ echo '</p></div>';
114
+
115
+ } // add_admin_notice_success()
116
+
117
+ /**
118
+ * Output an error message
119
+ *
120
+ * @since 1.9.9
121
+ * @access public
122
+ */
123
+ public function add_admin_notice_error( ){
124
+
125
+ echo '<div class="error"><p>';
126
+ echo $this->dashboard_error_msg;
127
+ echo '</p></div>';
128
+
129
+ } // add_admin_notice_error()
130
+
131
  /**
132
  *
133
  *
279
  return $item->date;
280
  case 'status' :
281
  return $item->status;
282
+ default:
283
+ return apply_filters( 'wcvendors_vendor_order_page_column_default', '', $item, $column_name );
284
  }
285
  }
286
 
327
 
328
  if ( !$this->can_view_comments ) unset( $columns['comments'] );
329
 
330
+ return apply_filters( 'wcvendors_vendor_order_page_get_columns', $columns );
331
+
332
  }
333
 
334
 
454
 
455
  $products = array();
456
 
457
+ foreach ( $vendor_products as $_product ) {
458
+
459
  $products[] = $_product->ID;
460
  }
461
 
463
 
464
  $model_id = 0;
465
 
466
+ if ( !empty( $_orders ) ) {
467
+
468
  foreach ( $_orders as $order ) {
469
 
470
+ $order = new WC_Order( $order->order_id );
471
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
472
+ $valid_items = WCV_Queries::get_products_for_order( $order_id );
473
+ $valid = array();
474
 
475
  $items = $order->get_items();
476
 
484
 
485
  foreach ( $valid as $order_item_id => $item ) {
486
 
487
+ $wc_product = new WC_Product( $item['product_id'] );
488
+
489
+ $products .= '<strong>'. $item['qty'] . ' x ' . $item['name'] . '</strong><br />';
490
+
491
+ if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
492
+ $metadata = $order->has_meta( $order_item_id );
493
+ } else {
494
+ $_item = $order->get_item( $order_item_id );
495
+ $meta_data = $_item->get_meta_data();
496
+ }
497
 
498
+ if ( !empty( $metadata ) ) {
499
 
 
500
  $products .= '<table cellspacing="0" class="wcv_display_meta">';
501
+
502
  foreach ( $metadata as $meta ) {
503
 
504
  // Skip hidden core fields
539
 
540
  }
541
 
542
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
543
+ $shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
544
+ $shipped = in_array($user_id, $shippers) ? __( 'Yes', 'wcvendors' ) : __( 'No', 'wcvendors' ) ;
545
 
546
+ $sum = WCV_Queries::sum_for_orders( array( $order_id ), array('vendor_id' =>get_current_user_id() ), false );
547
  $sum = reset( $sum );
548
+
549
+ WC_Vendors::log( $sum );
550
+
551
  $total = $sum->line_total;
552
 
553
  $comment_output = '';
554
 
555
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
 
557
  $order_items = array();
558
+ $order_items[ 'order_id' ] = $order_id;
559
  $order_items[ 'customer' ] = $order->get_formatted_shipping_address();
560
  $order_items[ 'products' ] = $products;
561
+ $order_items[ 'total' ] = wc_price( $total );
562
+ $order_items[ 'date' ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
 
563
  $order_items[ 'status' ] = $shipped;
564
 
565
  $orders[] = (object) $order_items;
classes/admin/emails/class-emails.php CHANGED
@@ -82,13 +82,13 @@ class WCV_Emails
82
  */
83
  function show_vendor_in_email( $name, $_product )
84
  {
85
- $product = get_post( $_product->id );
86
  $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
87
  $sold_by = WCV_Vendors::is_vendor( $product->post_author )
88
  ? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::get_vendor_sold_by( $product->post_author ) )
89
  : get_bloginfo( 'name' );
90
 
91
- $name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', $sold_by_label, $_product->id, $product->post_author ). $sold_by . '</small><br />';
92
 
93
  return $name;
94
  }
82
  */
83
  function show_vendor_in_email( $name, $_product )
84
  {
85
+ $product = get_post( $_product->get_id() );
86
  $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
87
  $sold_by = WCV_Vendors::is_vendor( $product->post_author )
88
  ? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::get_vendor_sold_by( $product->post_author ) )
89
  : get_bloginfo( 'name' );
90
 
91
+ $name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', $sold_by_label, $_product->get_id(), $product->post_author ). $sold_by . '</small><br />';
92
 
93
  return $name;
94
  }
classes/admin/emails/class-wc-notify-shipped.php CHANGED
@@ -52,18 +52,21 @@ class WC_Email_Notify_Shipped extends WC_Email
52
  {
53
  $this->object = new WC_Order( $order_id );
54
  $this->current_vendor = $vendor_id;
 
55
 
56
  $this->find[ ] = '{order_date}';
57
- $this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
58
 
59
  $this->find[ ] = '{order_number}';
60
  $this->replace[ ] = $this->object->get_order_number();
61
 
 
 
62
  if ( !$this->is_enabled() ) return;
63
 
64
  add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
65
  add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
66
- $this->send( $this->object->billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
67
  remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
68
  remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
69
  }
52
  {
53
  $this->object = new WC_Order( $order_id );
54
  $this->current_vendor = $vendor_id;
55
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $this->object->order_date : $this->object->get_date_created();
56
 
57
  $this->find[ ] = '{order_date}';
58
+ $this->replace[ ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
59
 
60
  $this->find[ ] = '{order_number}';
61
  $this->replace[ ] = $this->object->get_order_number();
62
 
63
+ $billing_email = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $this->object->billing_email : $this->object->get_billing_email();
64
+
65
  if ( !$this->is_enabled() ) return;
66
 
67
  add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
68
  add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
69
+ $this->send( $billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
70
  remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
71
  remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
72
  }
classes/admin/emails/class-wc-notify-vendor.php CHANGED
@@ -62,8 +62,10 @@ class WC_Email_Notify_Vendor extends WC_Email
62
  if ( $order_id ) {
63
  $this->object = new WC_Order( $order_id );
64
 
 
 
65
  $this->find[ ] = '{order_date}';
66
- $this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
67
 
68
  $this->find[ ] = '{order_number}';
69
  $this->replace[ ] = $this->object->get_order_number();
@@ -117,7 +119,7 @@ class WC_Email_Notify_Vendor extends WC_Email
117
  if ( $this->current_vendor == $due['vendor_id'] ) {
118
  if (!empty($return[ 'shipping' ])) $return[ 'shipping' ] = $total_rows[ 'shipping' ];
119
  $return[ 'shipping' ]['label'] = __( 'Shipping Subtotal:', 'wcvendors' );
120
- $return[ 'shipping' ][ 'value' ] = woocommerce_price( $due['shipping'] );
121
  if ( WC_Vendors::$pv_options->get_option( 'give_tax' ) ) {
122
  $return[ 'tax_subtotal']['value'] += $due['tax'];
123
  }
@@ -126,7 +128,7 @@ class WC_Email_Notify_Vendor extends WC_Email
126
  }
127
  // Format tax price
128
  if ( WC_Vendors::$pv_options->get_option( 'give_tax' ) ) {
129
- $return[ 'tax_subtotal']['value'] = woocommerce_price( $return[ 'tax_subtotal'] ['value'] );
130
  }
131
 
132
  return $return;
@@ -175,11 +177,13 @@ class WC_Email_Notify_Vendor extends WC_Email
175
 
176
  $settings = get_option( 'woocommerce_vendor_new_order_settings' );
177
 
 
 
178
  foreach ( $items as $key => $product ) {
179
 
180
  // If this is a line item
181
- if ($product['type'] == 'line_item') {
182
-
183
  $author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
184
 
185
  if ( $this->current_vendor != $author) {
@@ -188,8 +192,11 @@ class WC_Email_Notify_Vendor extends WC_Email
188
  } else {
189
 
190
  // If display commission is ticked show this otherwise show the full price.
191
- if ( 'yes' == $settings['commission_display'] ){
192
- $commission_due = WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product[ 'product_id' ], $order, $product[ 'qty' ] );
 
 
 
193
 
194
  $items[ $key ][ 'line_subtotal' ] = $commission_due;
195
  $items[ $key ][ 'line_total' ] = $commission_due;
@@ -203,8 +210,10 @@ class WC_Email_Notify_Vendor extends WC_Email
203
  }
204
 
205
  }
 
206
  return $items;
207
- }
 
208
 
209
 
210
  /**
@@ -299,7 +308,9 @@ class WC_Email_Notify_Vendor extends WC_Email
299
  */
300
  function check_order_formatted_line_subtotal( $subtotal, $item, $order ){
301
 
302
- $subtotal = wc_price( $order->get_line_subtotal( $item ), array( 'currency' => $order->get_order_currency() ) );
 
 
303
 
304
  return $subtotal;
305
 
@@ -311,15 +322,31 @@ class WC_Email_Notify_Vendor extends WC_Email
311
  $new_subtotal = 0;
312
 
313
  foreach ( $order->get_items() as $key => $product ) {
314
-
315
- $new_subtotal += $product[ 'line_subtotal' ];
316
-
317
  }
318
 
319
- return woocommerce_price( $new_subtotal );
320
 
321
 
322
  } // check_order_subtotal_to_display()
323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  }
62
  if ( $order_id ) {
63
  $this->object = new WC_Order( $order_id );
64
 
65
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $this->object->order_date : $this->object->get_date_created();
66
+
67
  $this->find[ ] = '{order_date}';
68
+ $this->replace[ ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
69
 
70
  $this->find[ ] = '{order_number}';
71
  $this->replace[ ] = $this->object->get_order_number();
119
  if ( $this->current_vendor == $due['vendor_id'] ) {
120
  if (!empty($return[ 'shipping' ])) $return[ 'shipping' ] = $total_rows[ 'shipping' ];
121
  $return[ 'shipping' ]['label'] = __( 'Shipping Subtotal:', 'wcvendors' );
122
+ $return[ 'shipping' ][ 'value' ] = wc_price( $due['shipping'] );
123
  if ( WC_Vendors::$pv_options->get_option( 'give_tax' ) ) {
124
  $return[ 'tax_subtotal']['value'] += $due['tax'];
125
  }
128
  }
129
  // Format tax price
130
  if ( WC_Vendors::$pv_options->get_option( 'give_tax' ) ) {
131
+ $return[ 'tax_subtotal']['value'] = wc_price( $return[ 'tax_subtotal'] ['value'] );
132
  }
133
 
134
  return $return;
177
 
178
  $settings = get_option( 'woocommerce_vendor_new_order_settings' );
179
 
180
+ if ( empty( $settings ) ) $settings = $this->get_default_settings();
181
+
182
  foreach ( $items as $key => $product ) {
183
 
184
  // If this is a line item
185
+ if ( $product['type'] == 'line_item' ) {
186
+
187
  $author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
188
 
189
  if ( $this->current_vendor != $author) {
192
  } else {
193
 
194
  // If display commission is ticked show this otherwise show the full price.
195
+ if ( 'yes' == $settings[ 'commission_display' ] ){
196
+
197
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
198
+
199
+ $commission_due = WCV_Commission::get_commission_due( $order_id, $product[ 'product_id' ], $author );
200
 
201
  $items[ $key ][ 'line_subtotal' ] = $commission_due;
202
  $items[ $key ][ 'line_total' ] = $commission_due;
210
  }
211
 
212
  }
213
+
214
  return $items;
215
+
216
+ } // check_items()
217
 
218
 
219
  /**
308
  */
309
  function check_order_formatted_line_subtotal( $subtotal, $item, $order ){
310
 
311
+ $order_currency = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->get_order_currency() : $order->get_currency();
312
+
313
+ $subtotal = wc_price( $order->get_line_subtotal( $item ), array( 'currency' => $order_currency ) );
314
 
315
  return $subtotal;
316
 
322
  $new_subtotal = 0;
323
 
324
  foreach ( $order->get_items() as $key => $product ) {
325
+ $new_subtotal += $product[ 'line_subtotal' ];
 
 
326
  }
327
 
328
+ return wc_price( $new_subtotal );
329
 
330
 
331
  } // check_order_subtotal_to_display()
332
 
333
+ /**
334
+ * Get the default settings for this email if not already set.
335
+ *
336
+ * @since 1.9.9
337
+ *
338
+ */
339
+ public function get_default_settings(){
340
+
341
+ $settings = array();
342
+
343
+ foreach ( $this->form_fields as $key => $field ) {
344
+ $settings[ $key ] = $field[ 'default' ];
345
+ }
346
+
347
+ return $settings;
348
+
349
+ } // get_default_settings()
350
+
351
 
352
  }
classes/admin/settings/classes/sf-class-settings.php CHANGED
@@ -192,8 +192,11 @@ if ( !class_exists( 'SF_Settings_API' ) ) {
192
  */
193
  public function admin_enqueue_scripts()
194
  {
195
- global $pagenow;
196
- if (is_admin() || $pagenow === 'wc_prd_vendor') {
 
 
 
197
  wp_register_script( 'bootstrap-tooltip', $this->assets_url . 'js/bootstrap-tooltip.js', array( 'jquery' ), '1.0' );
198
  wp_register_script( 'select2', $this->assets_url . 'js/select2/select2.min.js', array( 'jquery' ), '3.5.2' );
199
  wp_register_script( 'wcvendors-media', $this->assets_url . 'js/wcvendors-media.js', array( 'jquery' ), '1.0' );
192
  */
193
  public function admin_enqueue_scripts()
194
  {
195
+
196
+ $screen = get_current_screen();
197
+ $screen_id = $screen->id;
198
+
199
+ if ( $screen_id === 'woocommerce_page_wc_prd_vendor') {
200
  wp_register_script( 'bootstrap-tooltip', $this->assets_url . 'js/bootstrap-tooltip.js', array( 'jquery' ), '1.0' );
201
  wp_register_script( 'select2', $this->assets_url . 'js/select2/select2.min.js', array( 'jquery' ), '3.5.2' );
202
  wp_register_script( 'wcvendors-media', $this->assets_url . 'js/wcvendors-media.js', array( 'jquery' ), '1.0' );
classes/admin/settings/sf-options.php CHANGED
@@ -325,7 +325,7 @@ if ( !empty( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] == __( 'payments', 'wcvendors' )
325
  $options[ ] = array( 'name' => __( 'Payments', 'wcvendors' ), 'type' => 'heading' );
326
  $options[ ] = array(
327
  'name' => __( 'PayPal Adaptive Payments Scheduling', 'wcvendors' ), 'type' => 'title', 'desc' =>
328
- sprintf( __( 'Total commission currently due: %s. <a href="%s">View details</a>.', 'wcvendors' ), !function_exists( 'woocommerce_price' ) ? $total_due : woocommerce_price( $total_due ), '?page=pv_admin_commissions' ) .
329
  '<br/><br/>' . sprintf( __( 'Make sure you update your PayPal Adaptive Payments settings <a href="%s">here</a>. <br><br>To instantly pay with Adaptive Payments you must activate the PayPal AP gateway in your Checkout settings. <br><a href="https://www.wcvendors.com/kb/configuring-paypal-adaptive-payments/" target="top">PayPal AP Application Help</a>. <br><br>Another gateway that offers instant payments to vendors that also accepts credit cards directly on your checkout page is Stripe. <br><a href="https://www.wcvendors.com/product/stripe-commissions-gateway/" target="top">Stripe Commissions & Gateway plugin</a> is $49 and specifically coded for WC Vendors and <a href="https://www.wcvendors.com/product/wc-vendors-pro/" target="top">WC Vendors Pro</a>.', 'wcvendors' ), 'admin.php?page=wc-settings&tab=checkout&section=wc_paypalap' )
330
  );
331
 
325
  $options[ ] = array( 'name' => __( 'Payments', 'wcvendors' ), 'type' => 'heading' );
326
  $options[ ] = array(
327
  'name' => __( 'PayPal Adaptive Payments Scheduling', 'wcvendors' ), 'type' => 'title', 'desc' =>
328
+ sprintf( __( 'Total commission currently due: %s. <a href="%s">View details</a>.', 'wcvendors' ), !function_exists( 'wc_price' ) ? $total_due : wc_price( $total_due ), '?page=pv_admin_commissions' ) .
329
  '<br/><br/>' . sprintf( __( 'Make sure you update your PayPal Adaptive Payments settings <a href="%s">here</a>. <br><br>To instantly pay with Adaptive Payments you must activate the PayPal AP gateway in your Checkout settings. <br><a href="https://www.wcvendors.com/kb/configuring-paypal-adaptive-payments/" target="top">PayPal AP Application Help</a>. <br><br>Another gateway that offers instant payments to vendors that also accepts credit cards directly on your checkout page is Stripe. <br><a href="https://www.wcvendors.com/product/stripe-commissions-gateway/" target="top">Stripe Commissions & Gateway plugin</a> is $49 and specifically coded for WC Vendors and <a href="https://www.wcvendors.com/product/wc-vendors-pro/" target="top">WC Vendors Pro</a>.', 'wcvendors' ), 'admin.php?page=wc-settings&tab=checkout&section=wc_paypalap' )
330
  );
331
 
classes/class-commission.php CHANGED
@@ -128,8 +128,10 @@ class WCV_Commission
128
  $insert_due = array();
129
 
130
  foreach ( $details as $key => $detail ) {
131
- $product_id = $detail['product_id'];
132
 
 
 
 
133
  $insert_due[ $product_id ] = array(
134
  'order_id' => $order_id,
135
  'vendor_id' => $vendor_id,
@@ -138,7 +140,7 @@ class WCV_Commission
138
  'total_shipping' => !empty( $insert_due[ $product_id ][ 'total_shipping' ] ) ? ( $detail[ 'shipping' ] + $insert_due[ $product_id ][ 'total_shipping' ] ) : $detail[ 'shipping' ],
139
  'tax' => !empty( $insert_due[ $product_id ][ 'tax' ] ) ? ( $detail[ 'tax' ] + $insert_due[ $product_id ][ 'tax' ] ) : $detail[ 'tax' ],
140
  'qty' => !empty( $insert_due[ $product_id ][ 'qty' ] ) ? ( $detail[ 'qty' ] + $insert_due[ $product_id ][ 'qty' ] ) : $detail[ 'qty' ],
141
- 'time' => $order->order_date,
142
  );
143
  }
144
 
@@ -199,7 +201,7 @@ class WCV_Commission
199
  $where = $wpdb->prepare( 'WHERE status = %s', 'due' );
200
  $where = apply_filters( 'wcvendors_commission_all_due_where', $where );
201
  $query = "SELECT id, vendor_id, total_due FROM `{$table_name}` $where";
202
- $query = apply_filters( 'wcvendors_commission_all_due_sql', $wpdb->prepare( $query ) );
203
  $results = $wpdb->get_results( $query );
204
 
205
  return $results;
@@ -502,4 +504,34 @@ class WCV_Commission
502
  } // commissions_now()
503
 
504
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
  }
128
  $insert_due = array();
129
 
130
  foreach ( $details as $key => $detail ) {
 
131
 
132
+ $product_id = $detail['product_id'];
133
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
134
+
135
  $insert_due[ $product_id ] = array(
136
  'order_id' => $order_id,
137
  'vendor_id' => $vendor_id,
140
  'total_shipping' => !empty( $insert_due[ $product_id ][ 'total_shipping' ] ) ? ( $detail[ 'shipping' ] + $insert_due[ $product_id ][ 'total_shipping' ] ) : $detail[ 'shipping' ],
141
  'tax' => !empty( $insert_due[ $product_id ][ 'tax' ] ) ? ( $detail[ 'tax' ] + $insert_due[ $product_id ][ 'tax' ] ) : $detail[ 'tax' ],
142
  'qty' => !empty( $insert_due[ $product_id ][ 'qty' ] ) ? ( $detail[ 'qty' ] + $insert_due[ $product_id ][ 'qty' ] ) : $detail[ 'qty' ],
143
+ 'time' => date( 'Y-m-d H:i:s', strtotime( $order_date ) ),
144
  );
145
  }
146
 
201
  $where = $wpdb->prepare( 'WHERE status = %s', 'due' );
202
  $where = apply_filters( 'wcvendors_commission_all_due_where', $where );
203
  $query = "SELECT id, vendor_id, total_due FROM `{$table_name}` $where";
204
+ $query = apply_filters( 'wcvendors_commission_all_due_sql', $query );
205
  $results = $wpdb->get_results( $query );
206
 
207
  return $results;
504
  } // commissions_now()
505
 
506
 
507
+ /**
508
+ * Get the commission for a specific order, product and vendor
509
+ *
510
+ * @since 1.9.9
511
+ * @access public
512
+ * @param int $order_id the order id to search for
513
+ * @param int $product_id the product id to search for
514
+ * @param int $vendor_id the vendor id to search for
515
+ */
516
+ public static function get_commission_due( $order_id, $product_id, $vendor_id ){
517
+
518
+ global $wpdb;
519
+
520
+ $table_name = $wpdb->prefix . "pv_commission";
521
+
522
+ $sql = "SELECT total_due";
523
+
524
+ $sql .= "
525
+ FROM `{$table_name}`
526
+ WHERE vendor_id = {$vendor_id}
527
+ AND product_id = '{$product_id}'
528
+ AND order_id = '{$order_id}'
529
+ ";
530
+
531
+ $commission_due = $wpdb->get_var( $sql );
532
+
533
+ return $commission_due;
534
+
535
+ } // get_commission_due()
536
+
537
  }
classes/class-cron.php CHANGED
@@ -84,7 +84,7 @@ class WCV_Cron
84
  $mass_pay = $mass_pay->do_payments();
85
 
86
  $message = !empty( $mass_pay[ 'total' ] )
87
- ? $mass_pay[ 'msg' ] . '<br/>' . sprintf( __( 'Payment total: %s', 'wcvendors' ), woocommerce_price( $mass_pay[ 'total' ] ) )
88
  : $mass_pay[ 'msg' ];
89
 
90
  return array(
84
  $mass_pay = $mass_pay->do_payments();
85
 
86
  $message = !empty( $mass_pay[ 'total' ] )
87
+ ? $mass_pay[ 'msg' ] . '<br/>' . sprintf( __( 'Payment total: %s', 'wcvendors' ), wc_price( $mass_pay[ 'total' ] ) )
88
  : $mass_pay[ 'msg' ];
89
 
90
  return array(
classes/class-install.php CHANGED
@@ -58,7 +58,7 @@ class WCV_Install
58
  'delete_posts' => true,
59
  'read' => true,
60
  'upload_files' => true,
61
- 'view_woocommerce_reports' => true,
62
  ) );
63
 
64
  WC_Vendors::$pv_options->update_option( 'db_version', '1.9.1' );
@@ -112,7 +112,7 @@ class WCV_Install
112
  'delete_posts' => true,
113
  'read' => true,
114
  'upload_files' => true,
115
- 'view_woocommerce_reports' => true,
116
  ) );
117
  }
118
 
58
  'delete_posts' => true,
59
  'read' => true,
60
  'upload_files' => true,
61
+ 'view_woocommerce_reports' => false,
62
  ) );
63
 
64
  WC_Vendors::$pv_options->update_option( 'db_version', '1.9.1' );
112
  'delete_posts' => true,
113
  'read' => true,
114
  'upload_files' => true,
115
+ 'view_woocommerce_reports' => false,
116
  ) );
117
  }
118
 
classes/class-shipping.php CHANGED
@@ -28,7 +28,6 @@ class WCV_Shipping
28
  }
29
  }
30
 
31
-
32
  /**
33
  *
34
  *
@@ -45,7 +44,7 @@ class WCV_Shipping
45
  $shipping_costs = array( 'amount' => 0, 'tax' => 0);
46
  $shipping_due = 0;
47
  $method = '';
48
- $_product = get_product( $product[ 'product_id' ] );
49
  $order = wc_get_order( $order_id );
50
 
51
  if ( $_product && $_product->needs_shipping() && !$_product->is_downloadable() ) {
@@ -113,9 +112,14 @@ class WCV_Shipping
113
  $taxable = $settings['tax_status'];
114
 
115
  $order = new WC_Order( $order_id );
116
- $package[ 'destination' ][ 'country' ] = $order->shipping_country;
117
- $package[ 'destination' ][ 'state' ] = $order->shipping_state;
118
- $package[ 'destination' ][ 'postcode' ] = $order->shipping_postcode;
 
 
 
 
 
119
  $product_id = !empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
120
 
121
  if ( !empty( $product['variation_id'] ) ) {
@@ -147,8 +151,17 @@ class WCV_Shipping
147
 
148
  public static function calculate_shipping_tax( $shipping_amount, $order ) {
149
 
150
- $tax_based_on = get_option( 'woocommerce_tax_based_on' );
151
- $wc_tax_enabled = get_option( 'woocommerce_calc_taxes' );
 
 
 
 
 
 
 
 
 
152
 
153
  // if taxes aren't enabled don't calculate them
154
  if ( 'no' === $wc_tax_enabled ) return 0;
@@ -163,17 +176,17 @@ class WCV_Shipping
163
 
164
  } elseif ( 'billing' === $tax_based_on ) {
165
 
166
- $country = $order->billing_country;
167
- $state = $order->billing_state;
168
- $postcode = $order->billing_postcode;
169
- $city = $order->billing_city;
170
 
171
  } else {
172
 
173
- $country = $order->shipping_country;
174
- $state = $order->shipping_state;
175
- $postcode = $order->shipping_postcode;
176
- $city = $order->shipping_city;
177
 
178
  }
179
 
28
  }
29
  }
30
 
 
31
  /**
32
  *
33
  *
44
  $shipping_costs = array( 'amount' => 0, 'tax' => 0);
45
  $shipping_due = 0;
46
  $method = '';
47
+ $_product = wc_get_product( $product[ 'product_id' ] );
48
  $order = wc_get_order( $order_id );
49
 
50
  if ( $_product && $_product->needs_shipping() && !$_product->is_downloadable() ) {
112
  $taxable = $settings['tax_status'];
113
 
114
  $order = new WC_Order( $order_id );
115
+
116
+ $shipping_country = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_country : $order->get_shipping_country();
117
+ $shipping_state = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_state : $order->get_shipping_state();
118
+ $shipping_postcode = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_postcode : $order->get_shipping_postcode();
119
+
120
+ $package[ 'destination' ][ 'country' ] = $shipping_country;
121
+ $package[ 'destination' ][ 'state' ] = $shipping_state;
122
+ $package[ 'destination' ][ 'postcode' ] = $shipping_postcode;
123
  $product_id = !empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
124
 
125
  if ( !empty( $product['variation_id'] ) ) {
151
 
152
  public static function calculate_shipping_tax( $shipping_amount, $order ) {
153
 
154
+ $tax_based_on = get_option( 'woocommerce_tax_based_on' );
155
+ $wc_tax_enabled = get_option( 'woocommerce_calc_taxes' );
156
+
157
+ $shipping_city = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_city : $order->get_shipping_city();
158
+ $shipping_country = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_country : $order->get_shipping_country();
159
+ $shipping_state = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_state : $order->get_shipping_state();
160
+ $shipping_postcode = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_postcode : $order->get_shipping_postcode();
161
+ $billing_city = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_city : $order->get_billing_city();
162
+ $billing_country = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_country : $order->get_billing_country();
163
+ $billing_state = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_state : $order->get_billing_state();
164
+ $billing_postcode = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_postcode : $order->get_billing_postcode();
165
 
166
  // if taxes aren't enabled don't calculate them
167
  if ( 'no' === $wc_tax_enabled ) return 0;
176
 
177
  } elseif ( 'billing' === $tax_based_on ) {
178
 
179
+ $country = $billing_country;
180
+ $state = $billing_state;
181
+ $postcode = $billing_postcode;
182
+ $city = $billing_city;
183
 
184
  } else {
185
 
186
+ $country = $shipping_country;
187
+ $state = $shipping_state;
188
+ $postcode = $shipping_postcode;
189
+ $city = $shipping_city;
190
 
191
  }
192
 
classes/class-vendor-order.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @class WC_Order_Vendor
6
  */
7
- class WC_Order_Vendor extends WC_Abstract_Order {
8
 
9
  /** @public string Order type */
10
  public $order_type = 'vendor_order';
4
  *
5
  * @class WC_Order_Vendor
6
  */
7
+ class WC_Order_Vendor extends WC_Order {
8
 
9
  /** @public string Order type */
10
  public $order_type = 'vendor_order';
classes/class-vendors.php CHANGED
@@ -103,14 +103,15 @@ class WCV_Vendors
103
  $is_vendor = WCV_Vendors::is_vendor( $author );
104
  $commission = $is_vendor ? WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product_id, $order, $product[ 'qty' ] ) : 0;
105
  $tax = !empty( $product[ 'line_tax' ] ) ? (float) $product[ 'line_tax' ] : 0;
 
106
 
107
  // Check if shipping is enabled
108
  if ( get_option('woocommerce_calc_shipping') === 'no' ) {
109
  $shipping = 0; $shipping_tax = 0;
110
  } else {
111
- $shipping_costs = WCV_Shipping::get_shipping_due( $order->id, $product, $author );
112
- $shipping = $shipping_costs['amount'];
113
- $shipping_tax = $shipping_costs['tax'];
114
  }
115
 
116
  $_product = new WC_Product( $product['product_id'] );
@@ -186,8 +187,8 @@ class WCV_Vendors
186
 
187
  // Add remainders on end to admin
188
  $discount = $order->get_total_discount();
189
- $shipping = round( ( $order->order_shipping - $shipping_given ), 2 );
190
- $tax = round(( $order->order_tax + $order->order_shipping_tax ) - $tax_given, 2);
191
  $total = ( $tax + $shipping ) - $discount;
192
 
193
  if ( $group ) {
@@ -199,7 +200,7 @@ class WCV_Vendors
199
  } else {
200
  $r_total = round( $receiver[ 1 ][ $key ][ 'total' ], 2 );
201
  $receiver[ 1 ][ $key ][ 'commission' ] = round( $receiver[ 1 ][ $key ][ 'commission' ], 2 ) - round( $discount, 2 );
202
- $receiver[ 1 ][ $key ][ 'shipping' ] = ( $order->order_shipping - $shipping_given );
203
  $receiver[ 1 ][ $key ][ 'tax' ] = $tax;
204
  $receiver[ 1 ][ $key ][ 'total' ] = $r_total + round( $total, 2 );
205
  }
@@ -572,8 +573,10 @@ class WCV_Vendors
572
  $vendor_order = wc_get_order( $vendor_order_id );
573
  $order = wc_get_order( $args['order_id'] );
574
 
 
 
575
  // Order currency is the same used for the parent order
576
- update_post_meta( $vendor_order_id, '_order_currency', $order->get_order_currency() );
577
 
578
  if ( sizeof( $args['line_items'] ) > 0 ) {
579
  $order_items = $order->get_items( array( 'line_item', 'fee', 'shipping' ) );
103
  $is_vendor = WCV_Vendors::is_vendor( $author );
104
  $commission = $is_vendor ? WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product_id, $order, $product[ 'qty' ] ) : 0;
105
  $tax = !empty( $product[ 'line_tax' ] ) ? (float) $product[ 'line_tax' ] : 0;
106
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
107
 
108
  // Check if shipping is enabled
109
  if ( get_option('woocommerce_calc_shipping') === 'no' ) {
110
  $shipping = 0; $shipping_tax = 0;
111
  } else {
112
+ $shipping_costs = WCV_Shipping::get_shipping_due( $order_id, $product, $author );
113
+ $shipping = $shipping_costs['amount'];
114
+ $shipping_tax = $shipping_costs['tax'];
115
  }
116
 
117
  $_product = new WC_Product( $product['product_id'] );
187
 
188
  // Add remainders on end to admin
189
  $discount = $order->get_total_discount();
190
+ $shipping = round( ( $order->get_total_shipping() - $shipping_given ), 2 );
191
+ $tax = round(( $order->get_total_tax() + $order->get_shipping_tax() ) - $tax_given, 2);
192
  $total = ( $tax + $shipping ) - $discount;
193
 
194
  if ( $group ) {
200
  } else {
201
  $r_total = round( $receiver[ 1 ][ $key ][ 'total' ], 2 );
202
  $receiver[ 1 ][ $key ][ 'commission' ] = round( $receiver[ 1 ][ $key ][ 'commission' ], 2 ) - round( $discount, 2 );
203
+ $receiver[ 1 ][ $key ][ 'shipping' ] = ( $order->get_total_shipping() - $shipping_given );
204
  $receiver[ 1 ][ $key ][ 'tax' ] = $tax;
205
  $receiver[ 1 ][ $key ][ 'total' ] = $r_total + round( $total, 2 );
206
  }
573
  $vendor_order = wc_get_order( $vendor_order_id );
574
  $order = wc_get_order( $args['order_id'] );
575
 
576
+ $order_currency = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->get_order_currency() : $order->get_currency();
577
+
578
  // Order currency is the same used for the parent order
579
+ update_post_meta( $vendor_order_id, '_order_currency', $order_currency );
580
 
581
  if ( sizeof( $args['line_items'] ) > 0 ) {
582
  $order_items = $order->get_items( array( 'line_item', 'fee', 'shipping' ) );
classes/front/class-vendor-cart.php CHANGED
@@ -34,16 +34,18 @@ class WCV_Vendor_Cart
34
  *
35
  * @return unknown
36
  */
37
- public static function sold_by( $values, $cart_item )
38
- {
39
- $vendor_id = $cart_item[ 'data' ]->post->post_author;
40
- $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
41
- $sold_by = WCV_Vendors::is_vendor( $vendor_id )
 
 
42
  ? sprintf( '<a href="%s" target="_TOP">%s </a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
43
  : get_bloginfo( 'name' );
44
 
45
  $values[ ] = array(
46
- 'name' => apply_filters('wcvendors_cart_sold_by', $sold_by_label, $cart_item[ 'data' ]->post->ID, $cart_item[ 'data' ]->post->post_author ),
47
  'display' => $sold_by,
48
  );
49
 
34
  *
35
  * @return unknown
36
  */
37
+ public static function sold_by( $values, $cart_item ){
38
+
39
+ $product_id = $cart_item['data']->get_id();
40
+ $post = get_post( $product_id );
41
+ $vendor_id = $post->post_author;
42
+ $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
43
+ $sold_by = WCV_Vendors::is_vendor( $vendor_id )
44
  ? sprintf( '<a href="%s" target="_TOP">%s </a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
45
  : get_bloginfo( 'name' );
46
 
47
  $values[ ] = array(
48
+ 'name' => apply_filters( 'wcvendors_cart_sold_by', $sold_by_label, $product_id, $vendor_id ),
49
  'display' => $sold_by,
50
  );
51
 
classes/front/class-vendor-shop.php CHANGED
@@ -37,7 +37,13 @@ class WCV_Vendor_Shop
37
  add_filter ( 'woocommerce_show_page_title', array( 'WCV_Vendor_Shop', 'remove_vendor_title' ) );
38
 
39
  // Show vendor on all sales related invoices
40
- add_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
 
 
 
 
 
 
41
 
42
  // Add a vendor header
43
  if (WC_Vendors::$pv_options->get_option( 'shop_headers_enabled' ) ) {
@@ -45,6 +51,8 @@ class WCV_Vendor_Shop
45
  add_action( 'woocommerce_before_single_product', array('WCV_Vendor_Shop', 'vendor_mini_header'));
46
  }
47
 
 
 
48
  }
49
 
50
  public static function change_archive_link( $link )
@@ -253,7 +261,7 @@ class WCV_Vendor_Shop
253
 
254
  global $product;
255
 
256
- if (WCV_Vendors::is_vendor_product_page($product->post->post_author)) {
257
 
258
  $vendor = get_userdata( $product->post->post_author );
259
  $vendor_id = $product->post->post_author;
@@ -287,11 +295,13 @@ class WCV_Vendor_Shop
287
  }
288
 
289
  /*
290
- * Add Vendor to Order item Meta
291
- * Thanks to Asbjoern Andersen for the code
292
  *
 
293
  */
294
- public static function add_vendor_to_order_item_meta( $item_id, $cart_item) {
 
295
  $vendor_id = $cart_item[ 'data' ]->post->post_author;
296
  $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
297
  $sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' );
@@ -299,4 +309,48 @@ class WCV_Vendor_Shop
299
  wc_add_order_item_meta( $item_id, apply_filters( 'wcvendors_sold_by_in_email', $sold_by_label ), $sold_by );
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  }
37
  add_filter ( 'woocommerce_show_page_title', array( 'WCV_Vendor_Shop', 'remove_vendor_title' ) );
38
 
39
  // Show vendor on all sales related invoices
40
+ if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
41
+
42
+ add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_vendor_to_order_item_meta_legacy' ), 50, 2 );
43
+
44
+ } else {
45
+
46
+ add_action( 'woocommerce_checkout_create_order_line_item', array( $this, 'add_vendor_to_order_item_meta' ), 50, 3 ); }
47
 
48
  // Add a vendor header
49
  if (WC_Vendors::$pv_options->get_option( 'shop_headers_enabled' ) ) {
51
  add_action( 'woocommerce_before_single_product', array('WCV_Vendor_Shop', 'vendor_mini_header'));
52
  }
53
 
54
+ add_filter( 'pre_get_document_title', array( $this, 'vendor_page_title' ), 999, 1 );
55
+
56
  }
57
 
58
  public static function change_archive_link( $link )
261
 
262
  global $product;
263
 
264
+ if ( WCV_Vendors::is_vendor_product_page($product->post->post_author)) {
265
 
266
  $vendor = get_userdata( $product->post->post_author );
267
  $vendor_id = $product->post->post_author;
295
  }
296
 
297
  /*
298
+ * Add Vendor to Order item Meta legacy
299
+ * Thanks to Asbjoern Andersen for the code
300
  *
301
+ * @depreciated
302
  */
303
+ public static function add_vendor_to_order_item_meta_legacy( $item_id, $cart_item) {
304
+
305
  $vendor_id = $cart_item[ 'data' ]->post->post_author;
306
  $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
307
  $sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' );
309
  wc_add_order_item_meta( $item_id, apply_filters( 'wcvendors_sold_by_in_email', $sold_by_label ), $sold_by );
310
  }
311
 
312
+
313
+ /**
314
+ * Add vendor to order item meta WC2.7 and above
315
+ *
316
+ * @since 1.9.9
317
+ * @access public
318
+ */
319
+ public function add_vendor_to_order_item_meta( $item, $cart_item_key, $values ) {
320
+
321
+ $cart = WC()->cart->get_cart();
322
+ $cart_item = $cart[ $cart_item_key ];
323
+ $product_id = $cart_item['data']->get_id();
324
+ $post = get_post( $product_id );
325
+ $vendor_id = $post->post_author;
326
+ $sold_by_label = WC_Vendors::$pv_options->get_option( 'sold_by_label' );
327
+ $sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' );
328
+
329
+ $item->add_meta_data( apply_filters( 'wcvendors_sold_by_in_email', $sold_by_label ), $sold_by );
330
+
331
+
332
+ } // add_vendor_to_order_item_meta()
333
+
334
+
335
+ /**
336
+ * Add the Vendor shop name to the <title> tag on archive and single product page
337
+ *
338
+ * @since 1.9.9
339
+ */
340
+ public function vendor_page_title( $title ){
341
+
342
+ if ( is_product() ){
343
+ global $post;
344
+ return sprintf( '%s - %s', __( 'Products', 'wcvendors' ), WCV_Vendors::get_vendor_shop_name( $post->post_author ) );
345
+ }
346
+
347
+ if ( WCV_Vendors::is_vendor_page() ) {
348
+ return sprintf( '%s - %s', __( 'Products', 'wcvendors' ), self::page_title() );
349
+ }
350
+
351
+ return $title;
352
+
353
+ } // vendor_page_title
354
+
355
+
356
  }
classes/front/dashboard/class-vendor-dashboard.php CHANGED
@@ -52,7 +52,7 @@ class WCV_Vendor_Dashboard
52
  do_action('wcvendors_vendor_ship', $order_id, $user_id);
53
  wc_add_notice( __( 'Order marked shipped.', 'wcvendors' ), 'success' );
54
  $shop_name = WCV_Vendors::get_vendor_shop_name( $user_id );
55
- $order->add_order_note( apply_filters( 'wcvendors_vendor_shipped_note', sprintf( __( '%s has marked as shipped. ', 'wcvendors'), $shop_name ) ), $user_id, $shop_name );
56
  } elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {
57
  unset( $shippers[$key] ); // Remove user from the shippers array
58
  }
@@ -65,11 +65,11 @@ class WCV_Vendor_Dashboard
65
  $order_id = (int) $_POST[ 'order_id' ];
66
  $product_id = (int) $_POST[ 'product_id' ];
67
 
68
- $tracking_provider = woocommerce_clean( $_POST[ 'tracking_provider' ] );
69
- $custom_tracking_provider = woocommerce_clean( $_POST[ 'custom_tracking_provider_name' ] );
70
- $custom_tracking_link = woocommerce_clean( $_POST[ 'custom_tracking_url' ] );
71
- $tracking_number = woocommerce_clean( $_POST[ 'tracking_number' ] );
72
- $date_shipped = woocommerce_clean( strtotime( $_POST[ 'date_shipped' ] ) );
73
 
74
  $order = new WC_Order( $order_id );
75
  $products = $order->get_items();
@@ -80,8 +80,8 @@ class WCV_Vendor_Dashboard
80
  }
81
  }
82
  if ( $order_item_id ) {
83
- woocommerce_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
84
- woocommerce_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
85
 
86
  $message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
87
  wc_add_notice( $message, 'success' );
@@ -152,7 +152,7 @@ class WCV_Vendor_Dashboard
152
 
153
  if ( $vendor_dashboard_page && is_page( $vendor_dashboard_page ) || $shop_settings_page && is_page( $shop_settings_page ) ) {
154
  if ( !is_user_logged_in() ) {
155
- wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ), 303 );
156
  exit;
157
  }
158
  }
@@ -362,8 +362,9 @@ class WCV_Vendor_Dashboard
362
  if ( $order_item->qty < 1 ) continue;
363
 
364
  $commission_rate = WCV_Commission::get_commission_rate( $order_item->product_id );
365
- $_product = get_product( $order_item->product_id );
366
- $id = !empty($_product->parent->id) ? $_product->parent->id : $order_item->product_id;
 
367
 
368
  $data[ 'products' ][$id] = array(
369
  'id' => $id,
52
  do_action('wcvendors_vendor_ship', $order_id, $user_id);
53
  wc_add_notice( __( 'Order marked shipped.', 'wcvendors' ), 'success' );
54
  $shop_name = WCV_Vendors::get_vendor_shop_name( $user_id );
55
+ $order->add_order_note( apply_filters( 'wcvendors_vendor_shipped_note', sprintf( __( '%s has marked as shipped. ', 'wcvendors'), $shop_name ) , $user_id, $shop_name ) );
56
  } elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {
57
  unset( $shippers[$key] ); // Remove user from the shippers array
58
  }
65
  $order_id = (int) $_POST[ 'order_id' ];
66
  $product_id = (int) $_POST[ 'product_id' ];
67
 
68
+ $tracking_provider = wc_clean( $_POST[ 'tracking_provider' ] );
69
+ $custom_tracking_provider = wc_clean( $_POST[ 'custom_tracking_provider_name' ] );
70
+ $custom_tracking_link = wc_clean( $_POST[ 'custom_tracking_url' ] );
71
+ $tracking_number = wc_clean( $_POST[ 'tracking_number' ] );
72
+ $date_shipped = wc_clean( strtotime( $_POST[ 'date_shipped' ] ) );
73
 
74
  $order = new WC_Order( $order_id );
75
  $products = $order->get_items();
80
  }
81
  }
82
  if ( $order_item_id ) {
83
+ wc_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
84
+ wc_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
85
 
86
  $message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
87
  wc_add_notice( $message, 'success' );
152
 
153
  if ( $vendor_dashboard_page && is_page( $vendor_dashboard_page ) || $shop_settings_page && is_page( $shop_settings_page ) ) {
154
  if ( !is_user_logged_in() ) {
155
+ wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ), 303 );
156
  exit;
157
  }
158
  }
362
  if ( $order_item->qty < 1 ) continue;
363
 
364
  $commission_rate = WCV_Commission::get_commission_rate( $order_item->product_id );
365
+ $_product = wc_get_product( $order_item->product_id );
366
+ $parent_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $_product->parent->id : $_product->get_parent_id();
367
+ $id = !empty( $parent_id ) ?$parent_id : $order_item->product_id;
368
 
369
  $data[ 'products' ][$id] = array(
370
  'id' => $id,
classes/front/orders/class-orders.php CHANGED
@@ -42,7 +42,7 @@ class WCV_Orders
42
  $orders_page = $orders_page_id;
43
  // Only if the orders page is set should we check access
44
  if ( $orders_page && is_page( $orders_page ) && !is_user_logged_in() ) {
45
- wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ), 303 );
46
  exit;
47
  }
48
 
@@ -63,7 +63,7 @@ class WCV_Orders
63
 
64
  $products = array( $this->product_id );
65
 
66
- $_product = get_product( $this->product_id );
67
 
68
  if ( is_object( $_product ) ) {
69
 
@@ -104,7 +104,7 @@ class WCV_Orders
104
 
105
  $products = array( $this->product_id );
106
 
107
- $_product = get_product( $this->product_id );
108
 
109
  if ( is_object( $_product ) ) {
110
 
@@ -170,7 +170,7 @@ class WCV_Orders
170
 
171
  $products = array( $this->product_id );
172
 
173
- $_product = get_product( $this->product_id );
174
 
175
  if ( is_object( $_product ) ) {
176
 
@@ -276,22 +276,34 @@ class WCV_Orders
276
  public function format_order_details( $orders, $product_id )
277
  {
278
  $body = $items = array();
279
- $product = get_product( $product_id )->get_title();
280
 
281
  foreach ( $orders as $i => $order ) {
282
- $i = $order->order_id;
283
- $order = new WC_Order ( $i );
 
 
 
 
 
 
 
 
 
 
 
 
284
  $body[ $i ] = array(
285
  'order_number' => $order->get_order_number(),
286
  'product' => $product,
287
- 'name' => $order->shipping_first_name . ' ' . $order->shipping_last_name,
288
- 'address' => $order->shipping_address_1,
289
- 'city' => $order->shipping_city,
290
- 'state' => $order->shipping_state,
291
- 'zip' => $order->shipping_postcode,
292
- 'email' => $order->billing_email,
293
- 'date' => $order->order_date,
294
- 'comments' => wptexturize( $order->customer_note ),
295
  );
296
 
297
  if ( !$this->can_view_emails ) {
42
  $orders_page = $orders_page_id;
43
  // Only if the orders page is set should we check access
44
  if ( $orders_page && is_page( $orders_page ) && !is_user_logged_in() ) {
45
+ wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ), 303 );
46
  exit;
47
  }
48
 
63
 
64
  $products = array( $this->product_id );
65
 
66
+ $_product = wc_get_product( $this->product_id );
67
 
68
  if ( is_object( $_product ) ) {
69
 
104
 
105
  $products = array( $this->product_id );
106
 
107
+ $_product = wc_get_product( $this->product_id );
108
 
109
  if ( is_object( $_product ) ) {
110
 
170
 
171
  $products = array( $this->product_id );
172
 
173
+ $_product = wc_get_product( $this->product_id );
174
 
175
  if ( is_object( $_product ) ) {
176
 
276
  public function format_order_details( $orders, $product_id )
277
  {
278
  $body = $items = array();
279
+ $product = wc_get_product( $product_id )->get_title();
280
 
281
  foreach ( $orders as $i => $order ) {
282
+ $i = $order->order_id;
283
+ $order = new WC_Order ( $i );
284
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
285
+
286
+ $shipping_first_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_first_name : $order->get_shipping_first_name();
287
+ $shipping_last_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_last_name : $order->get_shipping_last_name();
288
+ $shipping_address_1 = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_address_1 : $order->get_shipping_address_1();
289
+ $shipping_city = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_city : $order->get_shipping_city();
290
+ $shipping_country = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_country : $order->get_shipping_country();
291
+ $shipping_state = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_state : $order->get_shipping_state();
292
+ $shipping_postcode = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->shipping_postcode : $order->get_shipping_postcode();
293
+ $billing_email = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_email : $order->get_billing_email();
294
+ $customer_note = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->customer_note : $order->get_customer_note();
295
+
296
  $body[ $i ] = array(
297
  'order_number' => $order->get_order_number(),
298
  'product' => $product,
299
+ 'name' => $shipping_first_name . ' ' . $shipping_last_name,
300
+ 'address' => $shipping_address_1,
301
+ 'city' => $shipping_city,
302
+ 'state' => $shipping_state,
303
+ 'zip' => $shipping_postcode,
304
+ 'email' => $billing_email,
305
+ 'date' => date_i18n( wc_date_format(), strtotime( $order_date ) ),
306
+ 'comments' => wptexturize( $customer_note ),
307
  );
308
 
309
  if ( !$this->can_view_emails ) {
classes/front/signup/class-vendor-signup.php CHANGED
@@ -38,59 +38,7 @@ class WCV_Vendor_Signup
38
  */
39
  public function vendor_option()
40
  {
41
-
42
- if ( isset( $_GET[ 'action'] ) && 'register' == $_GET[ 'action'] ) {
43
-
44
- // include_once('views/html-vendor-signup.php');
45
-
46
- } else {
47
-
48
- ?>
49
- <div class="clear"></div>
50
-
51
- <?php do_action( 'wcvendors_apply_for_vendor_before' ); ?>
52
-
53
- <p class="form-row">
54
- <input class="input-checkbox"
55
- id="apply_for_vendor" <?php checked( isset( $_POST[ 'apply_for_vendor' ] ), true ) ?> type="checkbox"
56
- name="apply_for_vendor" value="1"/>
57
- <label for="apply_for_vendor"
58
- class="checkbox"><?php echo apply_filters('wcvendors_vendor_registration_checkbox', __( 'Apply to become a vendor? ', 'wcvendors' )); ?></label>
59
- </p>
60
-
61
- <?php do_action( 'wcvendors_apply_for_vendor_after' ); ?>
62
-
63
- <?php if ( $this->terms_page ) { ?>
64
-
65
- <?php do_action( 'wcvendors_agree_to_terms_before' ); ?>
66
-
67
- <p class="form-row agree-to-terms-container" style="display:none">
68
- <input class="input-checkbox"
69
- id="agree_to_terms" <?php checked( isset( $_POST[ 'agree_to_terms' ] ), true ) ?> type="checkbox"
70
- name="agree_to_terms" value="1"/>
71
- <label for="agree_to_terms"
72
- class="checkbox"><?php apply_filters( 'wcvendors_vendor_registration_terms', printf( __( 'I have read and accepted the <a target="top" href="%s">terms and conditions</a>', 'wcvendors' ), get_permalink( $this->terms_page ) ) ); ?></label>
73
- </p>
74
-
75
- <?php do_action( 'wcvendors_agree_to_terms_after' ); ?>
76
-
77
- <script type="text/javascript">
78
- jQuery(function () {
79
- if (jQuery('#apply_for_vendor').is(':checked')) {
80
- jQuery('.agree-to-terms-container').show();
81
- }
82
-
83
- jQuery('#apply_for_vendor').on('click', function () {
84
- jQuery('.agree-to-terms-container').slideToggle();
85
- });
86
- })
87
- </script>
88
- <?php } ?>
89
-
90
- <div class="clear"></div>
91
- <?php
92
- }
93
-
94
  }
95
 
96
 
38
  */
39
  public function vendor_option()
40
  {
41
+ include_once('views/html-vendor-signup.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
 
classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPUtils.php CHANGED
@@ -166,109 +166,109 @@ class PPUtils
166
  * Released : Under GPL
167
  */
168
 
169
- class XmlToArray
170
- {
171
-
172
- var $xml = '';
173
-
174
- /**
175
- * Default Constructor
176
- *
177
- * @param $xml = xml data
178
- *
179
- * @return none
180
- */
181
-
182
- function XmlToArray( $xml )
183
- {
184
- $this->xml = $xml;
185
- }
186
-
187
- /**
188
- * _struct_to_array($values, &$i)
189
- *
190
- * This is adds the contents of the return xml into the array for easier processing.
191
- * Recursive, Static
192
- *
193
- * @access private
194
- *
195
- * @param array $values this is the xml data in an array
196
- * @param int $i this is the current location in the array
197
- *
198
- * @return Array
199
- */
200
-
201
- function _struct_to_array( $values, &$i )
202
- {
203
- $child = array();
204
- if ( isset( $values[ $i ][ 'value' ] ) ) array_push( $child, $values[ $i ][ 'value' ] );
205
-
206
- while ( $i++ < count( $values ) ) {
207
- switch ( $values[ $i ][ 'type' ] ) {
208
- case 'cdata':
209
- array_push( $child, $values[ $i ][ 'value' ] );
210
- break;
211
-
212
- case 'complete':
213
- $name = $values[ $i ][ 'tag' ];
214
- if ( !empty( $name ) ) {
215
- $child[ $name ] = ( $values[ $i ][ 'value' ] ) ? ( $values[ $i ][ 'value' ] ) : '';
216
- if ( isset( $values[ $i ][ 'attributes' ] ) ) {
217
- $child[ $name ] = $values[ $i ][ 'attributes' ];
218
- }
219
- }
220
- break;
221
-
222
- case 'open':
223
- $name = $values[ $i ][ 'tag' ];
224
- $size = isset( $child[ $name ] ) ? sizeof( $child[ $name ] ) : 0;
225
- $child[ $name ][ $size ] = $this->_struct_to_array( $values, $i );
226
- break;
227
-
228
- case 'close':
229
- return $child;
230
- break;
231
- }
232
- }
233
-
234
- return $child;
235
- }
236
-
237
- //_struct_to_array
238
-
239
- /**
240
- * createArray($data)
241
- *
242
- * This is adds the contents of the return xml into the array for easier processing.
243
- *
244
- * @access public
245
- *
246
- * @param string $data this is the string of the xml data
247
- *
248
- * @return Array
249
- */
250
- function createArray()
251
- {
252
- $xml = $this->xml;
253
- $values = array();
254
- $index = array();
255
- $array = array();
256
- $parser = xml_parser_create();
257
- xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
258
- xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
259
- xml_parse_into_struct( $parser, $xml, $values, $index );
260
- xml_parser_free( $parser );
261
- $i = 0;
262
- $name = $values[ $i ][ 'tag' ];
263
- $array[ $name ] = isset( $values[ $i ][ 'attributes' ] ) ? $values[ $i ][ 'attributes' ] : '';
264
- $array[ $name ] = $this->_struct_to_array( $values, $i );
265
-
266
- return $array;
267
- }
268
- //createArray
269
-
270
-
271
- }
272
 
273
  //XmlToArray
274
  ?>
166
  * Released : Under GPL
167
  */
168
 
169
+ // class XmlToArray
170
+ // {
171
+
172
+ // var $xml = '';
173
+
174
+ // /**
175
+ // * Default Constructor
176
+ // *
177
+ // * @param $xml = xml data
178
+ // *
179
+ // * @return none
180
+ // */
181
+
182
+ // function XmlToArray( $xml )
183
+ // {
184
+ // $this->xml = $xml;
185
+ // }
186
+
187
+ // /**
188
+ // * _struct_to_array($values, &$i)
189
+ // *
190
+ // * This is adds the contents of the return xml into the array for easier processing.
191
+ // * Recursive, Static
192
+ // *
193
+ // * @access private
194
+ // *
195
+ // * @param array $values this is the xml data in an array
196
+ // * @param int $i this is the current location in the array
197
+ // *
198
+ // * @return Array
199
+ // */
200
+
201
+ // function _struct_to_array( $values, &$i )
202
+ // {
203
+ // $child = array();
204
+ // if ( isset( $values[ $i ][ 'value' ] ) ) array_push( $child, $values[ $i ][ 'value' ] );
205
+
206
+ // while ( $i++ < count( $values ) ) {
207
+ // switch ( $values[ $i ][ 'type' ] ) {
208
+ // case 'cdata':
209
+ // array_push( $child, $values[ $i ][ 'value' ] );
210
+ // break;
211
+
212
+ // case 'complete':
213
+ // $name = $values[ $i ][ 'tag' ];
214
+ // if ( !empty( $name ) ) {
215
+ // $child[ $name ] = ( $values[ $i ][ 'value' ] ) ? ( $values[ $i ][ 'value' ] ) : '';
216
+ // if ( isset( $values[ $i ][ 'attributes' ] ) ) {
217
+ // $child[ $name ] = $values[ $i ][ 'attributes' ];
218
+ // }
219
+ // }
220
+ // break;
221
+
222
+ // case 'open':
223
+ // $name = $values[ $i ][ 'tag' ];
224
+ // $size = isset( $child[ $name ] ) ? sizeof( $child[ $name ] ) : 0;
225
+ // $child[ $name ][ $size ] = $this->_struct_to_array( $values, $i );
226
+ // break;
227
+
228
+ // case 'close':
229
+ // return $child;
230
+ // break;
231
+ // }
232
+ // }
233
+
234
+ // return $child;
235
+ // }
236
+
237
+ // //_struct_to_array
238
+
239
+ // /**
240
+ // * createArray($data)
241
+ // *
242
+ // * This is adds the contents of the return xml into the array for easier processing.
243
+ // *
244
+ // * @access public
245
+ // *
246
+ // * @param string $data this is the string of the xml data
247
+ // *
248
+ // * @return Array
249
+ // */
250
+ // function createArray()
251
+ // {
252
+ // $xml = $this->xml;
253
+ // $values = array();
254
+ // $index = array();
255
+ // $array = array();
256
+ // $parser = xml_parser_create();
257
+ // xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
258
+ // xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
259
+ // xml_parse_into_struct( $parser, $xml, $values, $index );
260
+ // xml_parser_free( $parser );
261
+ // $i = 0;
262
+ // $name = $values[ $i ][ 'tag' ];
263
+ // $array[ $name ] = isset( $values[ $i ][ 'attributes' ] ) ? $values[ $i ][ 'attributes' ] : '';
264
+ // $array[ $name ] = $this->_struct_to_array( $values, $i );
265
+
266
+ // return $array;
267
+ // }
268
+ // //createArray
269
+
270
+
271
+ // }
272
 
273
  //XmlToArray
274
  ?>
classes/gateways/PayPal_AdvPayments/paypal_ap.php CHANGED
@@ -304,6 +304,8 @@ class WC_PaypalAP extends WC_Payment_Gateway
304
  $receivers = WCV_Vendors::get_vendor_dues_from_order( $order );
305
  $i = 0;
306
 
 
 
307
  foreach ( $receivers as $author => $values ) {
308
  if ( empty( $values[ 'total' ] ) ) continue;
309
 
@@ -311,7 +313,7 @@ class WC_PaypalAP extends WC_Payment_Gateway
311
  $response[ $i ]->email = $values[ 'vendor_id' ] == 1 ? $this->main_paypal : WCV_Vendors::get_vendor_paypal( $values[ 'vendor_id' ] );
312
  $response[ $i ]->amount = round( $values[ 'total' ], 2);
313
  $response[ $i ]->primary = false;
314
- $response[ $i ]->invoiceId = $order->id;
315
  $i++;
316
  }
317
 
@@ -321,7 +323,7 @@ class WC_PaypalAP extends WC_Payment_Gateway
321
  $single_receiver->email = $this->main_paypal;
322
  $single_receiver->amount = $order->get_total();
323
  $single_receiver->primary = false;
324
- $single_receiver->invoiceId = $order->id;
325
  // Set a single reciever for the transaction
326
  $response[] = $single_receiver;
327
  }
@@ -346,8 +348,11 @@ class WC_PaypalAP extends WC_Payment_Gateway
346
  global $woocommerce;
347
 
348
  $this->include_paypal_sdk();
349
- $this->logger = new PPLoggingManager( 'Pay' );
350
- $order = new WC_Order( $order_id );
 
 
 
351
 
352
  $receivers = $this->get_receivers( $order );
353
  $receiverList = new ReceiverList( $receivers );
@@ -355,7 +360,7 @@ class WC_PaypalAP extends WC_Payment_Gateway
355
  $actionType = 'CREATE';
356
  $cancelUrl = $order->get_cancel_order_url_raw();
357
  $currencyCode = get_woocommerce_currency();
358
- $returnUrl = esc_url_raw( add_query_arg( 'key', $order->order_key, add_query_arg( 'order-received', $order->id, $order->get_checkout_order_received_url() ) ) );
359
 
360
  $payRequest = new PayRequest( new RequestEnvelope( "en_US" ), $actionType, $cancelUrl, $currencyCode, $receiverList, $returnUrl );
361
 
@@ -374,7 +379,7 @@ class WC_PaypalAP extends WC_Payment_Gateway
374
  );
375
 
376
  $payRequest->ipnNotificationUrl = add_query_arg( $args, home_url( '/' ) );
377
- $payRequest->memo = !empty( $order->customer_note ) ? $order->customer_note : '';
378
  $payRequest->reverseAllParallelPaymentsOnError = true;
379
 
380
  $service = new AdaptivePaymentsService();
304
  $receivers = WCV_Vendors::get_vendor_dues_from_order( $order );
305
  $i = 0;
306
 
307
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
308
+
309
  foreach ( $receivers as $author => $values ) {
310
  if ( empty( $values[ 'total' ] ) ) continue;
311
 
313
  $response[ $i ]->email = $values[ 'vendor_id' ] == 1 ? $this->main_paypal : WCV_Vendors::get_vendor_paypal( $values[ 'vendor_id' ] );
314
  $response[ $i ]->amount = round( $values[ 'total' ], 2);
315
  $response[ $i ]->primary = false;
316
+ $response[ $i ]->invoiceId = $order_id;
317
  $i++;
318
  }
319
 
323
  $single_receiver->email = $this->main_paypal;
324
  $single_receiver->amount = $order->get_total();
325
  $single_receiver->primary = false;
326
+ $single_receiver->invoiceId = $order_id;
327
  // Set a single reciever for the transaction
328
  $response[] = $single_receiver;
329
  }
348
  global $woocommerce;
349
 
350
  $this->include_paypal_sdk();
351
+ $this->logger = new PPLoggingManager( 'Pay' );
352
+ $order = new WC_Order( $order_id );
353
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
354
+ $order_key = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_key : $order->get_order_key();
355
+ $customer_note = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->customer_note : $order->get_customer_note();
356
 
357
  $receivers = $this->get_receivers( $order );
358
  $receiverList = new ReceiverList( $receivers );
360
  $actionType = 'CREATE';
361
  $cancelUrl = $order->get_cancel_order_url_raw();
362
  $currencyCode = get_woocommerce_currency();
363
+ $returnUrl = esc_url_raw( add_query_arg( 'key', $order_key, add_query_arg( 'order-received', $order_id, $order->get_checkout_order_received_url() ) ) );
364
 
365
  $payRequest = new PayRequest( new RequestEnvelope( "en_US" ), $actionType, $cancelUrl, $currencyCode, $receiverList, $returnUrl );
366
 
379
  );
380
 
381
  $payRequest->ipnNotificationUrl = add_query_arg( $args, home_url( '/' ) );
382
+ $payRequest->memo = !empty( $customer_note ) ? $customer_note : '';
383
  $payRequest->reverseAllParallelPaymentsOnError = true;
384
 
385
  $service = new AdaptivePaymentsService();
classes/gateways/WCV_Gateway_Test/class-wcv-gateway-test.php CHANGED
@@ -124,7 +124,12 @@ class WC_Gateway_WCV_Gateway_Test extends WC_Payment_Gateway {
124
  $order->update_status( 'processing', __( 'Test gateway transation complete. Order processing.', 'woocommerce' ) );
125
 
126
  // Reduce stock levels
127
- $order->reduce_order_stock();
 
 
 
 
 
128
 
129
  // Remove cart
130
  WC()->cart->empty_cart();
124
  $order->update_status( 'processing', __( 'Test gateway transation complete. Order processing.', 'woocommerce' ) );
125
 
126
  // Reduce stock levels
127
+ if ( version_compare( WC_VERSION, '2.7', '<' ) ){
128
+ $order->reduce_order_stock();
129
+ } else {
130
+ wc_reduce_stock_levels( $order_id );
131
+ }
132
+
133
 
134
  // Remove cart
135
  WC()->cart->empty_cart();
languages/default.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2016 wcvendors
2
  # This file is distributed under the same license as the wcvendors package.
3
  msgid ""
4
  msgstr ""
@@ -7,7 +7,7 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
11
  "Last-Translator: Jamie Madden <support@wcvendors.com>\n"
12
  "Language-Team: WC Vendors <support@wcvendors.com>\n"
13
  "X-Poedit-Basepath: ..\n"
@@ -20,155 +20,163 @@ msgstr ""
20
  msgid "WC Vendors requires WooCommerce to run. Please install WooCommerce and activate before attempting to activate again."
21
  msgstr ""
22
 
23
- #: class-wc-vendors.php:199, classes/admin/class-admin-reports.php:41, classes/admin/class-admin-users.php:408
24
  msgid "WC Vendors"
25
  msgstr ""
26
 
27
  #: class-wc-vendors.php:255
28
- msgid "<b>WC Vendors is disabled</b>. WC Vendors requires a minimum of WooCommerce v2.5.0."
29
  msgstr ""
30
 
31
- #: class-wc-vendors.php:601, classes/admin/settings/sf-options.php:192
32
  msgid "Capabilities"
33
  msgstr ""
34
 
35
- #: class-wc-vendors.php:647, classes/admin/class-admin-page.php:149, classes/admin/class-admin-page.php:380, classes/admin/class-admin-reports.php:178, classes/admin/class-admin-reports.php:461, classes/admin/class-product-meta.php:46, classes/admin/class-product-meta.php:187, classes/admin/class-product-meta.php:223, classes/class-install.php:51, classes/class-install.php:105
36
  msgid "Vendor"
37
  msgstr ""
38
 
39
- #: class-wc-vendors.php:651, classes/admin/settings/sf-options.php:4
40
  msgid "General"
41
  msgstr ""
42
 
43
- #: class-wc-vendors.php:727
44
  msgid "Documentation/KB"
45
  msgstr ""
46
 
47
- #: class-wc-vendors.php:729
48
  msgid "Help Forums"
49
  msgstr ""
50
 
51
- #: class-wc-vendors.php:731
52
  msgid "Paid Support"
53
  msgstr ""
54
 
55
- #: classes/admin/class-admin-page.php:29
56
  msgid "Vendors shipped"
57
  msgstr ""
58
 
59
- #: classes/admin/class-admin-page.php:52
60
  msgid "Vendors Shipped"
61
  msgstr ""
62
 
63
- #: classes/admin/class-admin-page.php:78, classes/admin/class-admin-page.php:78, classes/admin/class-admin-page.php:248, classes/admin/class-product-meta.php:151, classes/admin/class-product-meta.php:167, templates/dashboard/reports.php:19
64
  msgid "Commission"
65
  msgstr ""
66
 
67
- #: classes/admin/class-admin-page.php:103
68
  msgid "Reset WC Vendors roles "
69
  msgstr ""
70
 
71
- #: classes/admin/class-admin-page.php:104
72
  msgid "Reset WC Vendor Roles"
73
  msgstr ""
74
 
75
- #: classes/admin/class-admin-page.php:105
76
  msgid "This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities."
77
  msgstr ""
78
 
79
- #: classes/admin/class-admin-page.php:110
80
  msgid "Reset WC Vendors "
81
  msgstr ""
82
 
83
- #: classes/admin/class-admin-page.php:111
84
  msgid "Reset WC Vendors Settings"
85
  msgstr ""
86
 
87
- #: classes/admin/class-admin-page.php:112
88
  msgid "This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings."
89
  msgstr ""
90
 
91
- #: classes/admin/class-admin-page.php:152, classes/class-install.php:98, classes/class-install.php:254
92
  msgid "Pending Vendor"
93
  msgstr ""
94
 
95
- #: classes/admin/class-admin-page.php:158
96
  msgid "WC Vendor roles successfully reset."
97
  msgstr ""
98
 
99
- #: classes/admin/class-admin-page.php:172
100
  msgid "WC Vendors was successfully reset. All settings have been reset."
101
  msgstr ""
102
 
103
- #: classes/admin/class-admin-page.php:186
104
  msgid "Select a Vendor"
105
  msgstr ""
106
 
107
- #: classes/admin/class-admin-page.php:378, classes/admin/class-admin-reports.php:177, templates/dashboard/reports.php:17, templates/emails/notify-vendor-shipped.php:22, templates/emails/vendor-new-order.php:22
108
  msgid "Product"
109
  msgstr ""
110
 
111
- #: classes/admin/class-admin-page.php:379, classes/admin/class-vendor-admin-dashboard.php:290
112
  msgid "Order ID"
113
  msgstr ""
114
 
115
- #: classes/admin/class-admin-page.php:381, classes/admin/class-admin-reports.php:179, classes/admin/class-admin-reports.php:377, classes/admin/class-vendor-admin-dashboard.php:293, templates/dashboard/orders.php:46
 
 
 
 
 
 
 
 
116
  msgid "Total"
117
  msgstr ""
118
 
119
- #: classes/admin/class-admin-page.php:382, classes/admin/class-admin-reports.php:181, classes/admin/class-admin-reports.php:464
120
  msgid "Status"
121
  msgstr ""
122
 
123
- #: classes/admin/class-admin-page.php:383, classes/admin/class-vendor-admin-dashboard.php:295, classes/front/orders/class-orders.php:257, templates/dashboard/orders.php:47
124
  msgid "Date"
125
  msgstr ""
126
 
127
- #: classes/admin/class-admin-page.php:420
128
  msgid "Mark paid"
129
  msgstr ""
130
 
131
- #: classes/admin/class-admin-page.php:421
132
  msgid "Mark due"
133
  msgstr ""
134
 
135
- #: classes/admin/class-admin-page.php:422
136
  msgid "Mark reversed"
137
  msgstr ""
138
 
139
- #: classes/admin/class-admin-page.php:423
140
  msgid "Delete"
141
  msgstr ""
142
 
143
- #: classes/admin/class-admin-page.php:482
144
  msgid "Show all dates"
145
  msgstr ""
146
 
147
- #: classes/admin/class-admin-page.php:517
148
  msgid "Show all Statuses"
149
  msgstr ""
150
 
151
- #: classes/admin/class-admin-page.php:518, classes/admin/class-admin-reports.php:353, classes/admin/class-admin-reports.php:446, classes/class-commission.php:66
152
  msgid "Due"
153
  msgstr ""
154
 
155
- #: classes/admin/class-admin-page.php:519, classes/admin/class-admin-reports.php:352, classes/admin/class-admin-reports.php:447, classes/class-commission.php:67
156
  msgid "Paid"
157
  msgstr ""
158
 
159
- #: classes/admin/class-admin-page.php:520, classes/admin/class-admin-reports.php:351, classes/admin/class-admin-reports.php:448, classes/class-commission.php:68
160
  msgid "Reversed"
161
  msgstr ""
162
 
163
- #: classes/admin/class-admin-page.php:573
164
  msgid "Commission marked paid."
165
  msgstr ""
166
 
167
- #: classes/admin/class-admin-page.php:580
168
  msgid "Commission marked due."
169
  msgstr ""
170
 
171
- #: classes/admin/class-admin-page.php:587
172
  msgid "Commission marked reversed."
173
  msgstr ""
174
 
@@ -260,14 +268,6 @@ msgstr ""
260
  msgid "Month"
261
  msgstr ""
262
 
263
- #: classes/admin/class-admin-reports.php:349
264
- msgid "Tax"
265
- msgstr ""
266
-
267
- #: classes/admin/class-admin-reports.php:350, classes/admin/settings/sf-options.php:52, classes/admin/settings/sf-options.php:136, templates/dashboard/orders.php:45, templates/orders/orders.php:115
268
- msgid "Shipping"
269
- msgstr ""
270
-
271
  #: classes/admin/class-admin-reports.php:462
272
  msgid "Tax Total"
273
  msgstr ""
@@ -284,134 +284,118 @@ msgstr ""
284
  msgid "No commissions found."
285
  msgstr ""
286
 
287
- #: classes/admin/class-admin-users.php:418
288
  msgid "Enable HTML for the shop description"
289
  msgstr ""
290
 
291
- #: classes/admin/class-admin-users.php:424
292
  msgid "Shop name"
293
  msgstr ""
294
 
295
- #: classes/admin/class-admin-users.php:431
296
  msgid "PayPal E-mail"
297
  msgstr ""
298
 
299
- #: classes/admin/class-admin-users.php:432
300
  msgid "required"
301
  msgstr ""
302
 
303
- #: classes/admin/class-admin-users.php:439
304
  msgid "Commission rate"
305
  msgstr ""
306
 
307
- #: classes/admin/class-admin-users.php:440, classes/admin/class-product-meta.php:174
308
  msgid "Leave blank for default"
309
  msgstr ""
310
 
311
- #: classes/admin/class-admin-users.php:446
312
  msgid "Give Tax"
313
  msgstr ""
314
 
315
- #: classes/admin/class-admin-users.php:451
316
  msgid "Tax override for vendor"
317
  msgstr ""
318
 
319
- #: classes/admin/class-admin-users.php:457
320
  msgid "Give Shipping"
321
  msgstr ""
322
 
323
- #: classes/admin/class-admin-users.php:462
324
  msgid "Shipping override for vendor"
325
  msgstr ""
326
 
327
- #: classes/admin/class-admin-users.php:468, classes/admin/views/html-vendor-settings-page.php:30, templates/dashboard/settings/seller-info.php:3
328
  msgid "Seller info"
329
  msgstr ""
330
 
331
- #: classes/admin/class-admin-users.php:473
332
  msgid "Shop description"
333
  msgstr ""
334
 
335
- #: classes/admin/class-vendor-admin-dashboard.php:20, classes/admin/class-vendor-admin-dashboard.php:20, classes/class-install.php:207
336
  msgid "Shop Settings"
337
  msgstr ""
338
 
339
- #: classes/admin/class-vendor-admin-dashboard.php:21, classes/admin/class-vendor-admin-dashboard.php:21, classes/admin/class-vendor-admin-dashboard.php:153, classes/admin/settings/sf-options.php:196, classes/class-install.php:206, templates/dashboard/orders.php:35
340
  msgid "Orders"
341
  msgstr ""
342
 
343
- #: classes/admin/class-vendor-admin-dashboard.php:65, classes/front/dashboard/class-vendor-dashboard.php:112
344
  msgid "Your PayPal address is not a valid email address."
345
  msgstr ""
346
 
347
- #: classes/admin/class-vendor-admin-dashboard.php:74, classes/front/dashboard/class-vendor-dashboard.php:121
348
  msgid "That shop name is already taken. Your shop name must be unique."
349
  msgstr ""
350
 
351
- #: classes/admin/class-vendor-admin-dashboard.php:94, classes/admin/settings/classes/sf-class-settings.php:368, classes/front/dashboard/class-vendor-dashboard.php:139
352
  msgid "Settings saved."
353
  msgstr ""
354
 
355
- #: classes/admin/class-vendor-admin-dashboard.php:216
356
  msgid "order"
357
  msgstr ""
358
 
359
- #: classes/admin/class-vendor-admin-dashboard.php:217
360
  msgid "orders"
361
  msgstr ""
362
 
363
- #: classes/admin/class-vendor-admin-dashboard.php:291
364
  msgid "Customer"
365
  msgstr ""
366
 
367
- #: classes/admin/class-vendor-admin-dashboard.php:292, classes/admin/settings/sf-options.php:127, classes/admin/settings/sf-options.php:254
368
  msgid "Products"
369
  msgstr ""
370
 
371
- #: classes/admin/class-vendor-admin-dashboard.php:294, classes/admin/class-vendor-admin-dashboard.php:519
372
  msgid "Comments to Customer"
373
  msgstr ""
374
 
375
- #: classes/admin/class-vendor-admin-dashboard.php:296, templates/dashboard/orders.php:103
376
  msgid "Shipped"
377
  msgstr ""
378
 
379
- #: classes/admin/class-vendor-admin-dashboard.php:331, templates/dashboard/orders.php:96
380
  msgid "Mark shipped"
381
  msgstr ""
382
 
383
- #: classes/admin/class-vendor-admin-dashboard.php:356
384
  msgid "Orders marked shipped."
385
  msgstr ""
386
 
387
- #: classes/admin/class-vendor-admin-dashboard.php:392, classes/front/dashboard/class-vendor-dashboard.php:40
388
  msgid "You are not allowed to modify this order."
389
  msgstr ""
390
 
391
- #: classes/admin/class-vendor-admin-dashboard.php:501
392
  msgid "Yes"
393
  msgstr ""
394
 
395
- #: classes/admin/class-vendor-admin-dashboard.php:501
396
  msgid "No"
397
  msgstr ""
398
 
399
- #: classes/admin/class-vendor-admin-dashboard.php:516, templates/orders/orders.php:84
400
- msgid "Comments (%s)"
401
- msgstr ""
402
-
403
- #: classes/admin/class-vendor-admin-dashboard.php:528, templates/orders/comments/existing-comments.php:9
404
- msgid "added %s ago"
405
- msgstr ""
406
-
407
- #: classes/admin/class-vendor-admin-dashboard.php:534
408
- msgid "No comments currently to customer."
409
- msgstr ""
410
-
411
- #: classes/admin/class-vendor-admin-dashboard.php:543, templates/orders/comments/add-new-comment.php:11
412
- msgid "Add comment"
413
- msgstr ""
414
-
415
  #: classes/admin/class-vendor-applicants.php:73
416
  msgid "Vendor has been <b>denied</b>."
417
  msgstr ""
@@ -452,11 +436,11 @@ msgstr ""
452
  msgid "[{blogname}] Your vendor application has been {status}"
453
  msgstr ""
454
 
455
- #: classes/admin/emails/class-wc-approve-vendor.php:123, classes/admin/emails/class-wc-notify-admin.php:134, classes/admin/emails/class-wc-notify-shipped.php:163, classes/admin/emails/class-wc-notify-vendor.php:256
456
  msgid "Enable/Disable"
457
  msgstr ""
458
 
459
- #: classes/admin/emails/class-wc-approve-vendor.php:125, classes/admin/emails/class-wc-notify-admin.php:136, classes/admin/emails/class-wc-notify-shipped.php:165, classes/admin/emails/class-wc-notify-vendor.php:258
460
  msgid "Enable this email notification"
461
  msgstr ""
462
 
@@ -464,39 +448,39 @@ msgstr ""
464
  msgid "Enter recipients (comma separated) for this email. Defaults to <code>%s</code>."
465
  msgstr ""
466
 
467
- #: classes/admin/emails/class-wc-approve-vendor.php:136, classes/admin/emails/class-wc-notify-admin.php:147, classes/admin/emails/class-wc-notify-shipped.php:169, classes/admin/emails/class-wc-notify-vendor.php:262
468
  msgid "Subject"
469
  msgstr ""
470
 
471
- #: classes/admin/emails/class-wc-approve-vendor.php:138, classes/admin/emails/class-wc-notify-admin.php:149, classes/admin/emails/class-wc-notify-shipped.php:171, classes/admin/emails/class-wc-notify-vendor.php:264
472
  msgid "This controls the email subject line. Leave blank to use the default subject: <code>%s</code>."
473
  msgstr ""
474
 
475
- #: classes/admin/emails/class-wc-approve-vendor.php:143, classes/admin/emails/class-wc-notify-admin.php:154, classes/admin/emails/class-wc-notify-shipped.php:176, classes/admin/emails/class-wc-notify-vendor.php:269
476
  msgid "Email Heading"
477
  msgstr ""
478
 
479
- #: classes/admin/emails/class-wc-approve-vendor.php:145, classes/admin/emails/class-wc-notify-admin.php:156, classes/admin/emails/class-wc-notify-shipped.php:178, classes/admin/emails/class-wc-notify-vendor.php:271
480
  msgid "This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>."
481
  msgstr ""
482
 
483
- #: classes/admin/emails/class-wc-approve-vendor.php:150, classes/admin/emails/class-wc-notify-admin.php:161, classes/admin/emails/class-wc-notify-shipped.php:183, classes/admin/emails/class-wc-notify-vendor.php:282
484
  msgid "Email type"
485
  msgstr ""
486
 
487
- #: classes/admin/emails/class-wc-approve-vendor.php:152, classes/admin/emails/class-wc-notify-admin.php:163, classes/admin/emails/class-wc-notify-shipped.php:185, classes/admin/emails/class-wc-notify-vendor.php:284
488
  msgid "Choose which format of email to send."
489
  msgstr ""
490
 
491
- #: classes/admin/emails/class-wc-approve-vendor.php:156, classes/admin/emails/class-wc-notify-admin.php:167, classes/admin/emails/class-wc-notify-shipped.php:189, classes/admin/emails/class-wc-notify-vendor.php:288
492
  msgid "Plain text"
493
  msgstr ""
494
 
495
- #: classes/admin/emails/class-wc-approve-vendor.php:157, classes/admin/emails/class-wc-notify-admin.php:168, classes/admin/emails/class-wc-notify-shipped.php:190, classes/admin/emails/class-wc-notify-vendor.php:289
496
  msgid "HTML"
497
  msgstr ""
498
 
499
- #: classes/admin/emails/class-wc-approve-vendor.php:158, classes/admin/emails/class-wc-notify-admin.php:169, classes/admin/emails/class-wc-notify-shipped.php:191, classes/admin/emails/class-wc-notify-vendor.php:290
500
  msgid "Multipart"
501
  msgstr ""
502
 
@@ -532,7 +516,7 @@ msgstr ""
532
  msgid "[{blogname}] Your order has been shipped ({order_number}) - {order_date}"
533
  msgstr ""
534
 
535
- #: classes/admin/emails/class-wc-notify-shipped.php:112
536
  msgid "Subtotal:"
537
  msgstr ""
538
 
@@ -552,27 +536,27 @@ msgstr ""
552
  msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
553
  msgstr ""
554
 
555
- #: classes/admin/emails/class-wc-notify-vendor.php:105
556
  msgid "Commission Subtotal:"
557
  msgstr ""
558
 
559
- #: classes/admin/emails/class-wc-notify-vendor.php:111
560
  msgid "Tax Subtotal:"
561
  msgstr ""
562
 
563
- #: classes/admin/emails/class-wc-notify-vendor.php:119
564
  msgid "Shipping Subtotal:"
565
  msgstr ""
566
 
567
- #: classes/admin/emails/class-wc-notify-vendor.php:276
568
  msgid "Product Totals"
569
  msgstr ""
570
 
571
- #: classes/admin/emails/class-wc-notify-vendor.php:278
572
  msgid "Show the commission due/paid as the product totals instead of the product prices."
573
  msgstr ""
574
 
575
- #: classes/admin/settings/classes/sf-class-format-options.php:211, classes/admin/settings/classes/sf-class-settings.php:791
576
  msgid "Select a page..."
577
  msgstr ""
578
 
@@ -580,39 +564,39 @@ msgstr ""
580
  msgid "Settings"
581
  msgstr ""
582
 
583
- #: classes/admin/settings/classes/sf-class-settings.php:302
584
  msgid "Could not load settings at: "
585
  msgstr ""
586
 
587
- #: classes/admin/settings/classes/sf-class-settings.php:302
588
  msgid "Error - WP Settings Framework"
589
  msgstr ""
590
 
591
- #: classes/admin/settings/classes/sf-class-settings.php:486
592
  msgid "Save %s changes"
593
  msgstr ""
594
 
595
- #: classes/admin/settings/classes/sf-class-settings.php:499
596
  msgid "Please help with a <a href=\"https://wordpress.org/support/view/plugin-reviews/wc-vendors?rate=5#postform\" target=\"top\">High Five!</a> | <a href=\"https://www.wcvendors.com/product/wc-vendors-pro/\" target=\"top\">WC Vendors Pro</a> | <a href=\"https://www.wcvendors.com/product/stripe-commissions-gateway/\" target=\"top\">Stripe Commissions & Gateway</a> | <a href=\"https://www.wcvendors.com/kb/\" target=\"top\">KnowledgeBase</a> | <a href=\"https://www.wcvendors.com/help/\" target=\"top\">Help Forums</a>"
597
  msgstr ""
598
 
599
- #: classes/admin/settings/classes/sf-class-settings.php:784
600
  msgid "Edit Page"
601
  msgstr ""
602
 
603
- #: classes/admin/settings/classes/sf-class-settings.php:785
604
  msgid "View Page"
605
  msgstr ""
606
 
607
- #: classes/admin/settings/classes/sf-class-settings.php:848
608
  msgid "Update %s"
609
  msgstr ""
610
 
611
- #: classes/admin/settings/classes/sf-class-settings.php:848, classes/admin/settings/classes/sf-class-settings.php:848
612
  msgid "Add %s"
613
  msgstr ""
614
 
615
- #: classes/admin/settings/classes/sf-class-settings.php:848
616
  msgid "Upload an image for the %s"
617
  msgstr ""
618
 
@@ -1112,7 +1096,7 @@ msgstr ""
1112
  msgid "Success. Your tracking number has been updated."
1113
  msgstr ""
1114
 
1115
- #: classes/front/orders/class-export-csv.php:19, templates/dashboard/reports.php:18, templates/emails/notify-vendor-shipped.php:23, templates/emails/vendor-new-order.php:23
1116
  msgid "Quantity"
1117
  msgstr ""
1118
 
@@ -1164,24 +1148,24 @@ msgstr ""
1164
  msgid "Success. The customer has been notified of your comment."
1165
  msgstr ""
1166
 
1167
- #: classes/front/signup/class-vendor-signup.php:58, classes/front/signup/views/html-vendor-signup.php:21, templates/dashboard/denied.php:22
1168
- msgid "Apply to become a vendor? "
1169
  msgstr ""
1170
 
1171
- #: classes/front/signup/class-vendor-signup.php:72, classes/front/signup/views/html-vendor-signup.php:35
1172
- msgid "I have read and accepted the <a target=\"top\" href=\"%s\">terms and conditions</a>"
1173
  msgstr ""
1174
 
1175
- #: classes/front/signup/class-vendor-signup.php:122
1176
- msgid "Application denied. You are an administrator."
1177
  msgstr ""
1178
 
1179
- #: classes/front/signup/class-vendor-signup.php:124
1180
- msgid "Your application has been submitted."
1181
  msgstr ""
1182
 
1183
- #: classes/front/signup/class-vendor-signup.php:171, classes/front/signup/class-vendor-signup.php:208, classes/front/signup/class-vendor-signup.php:220
1184
- msgid "You must accept the terms and conditions to become a vendor."
1185
  msgstr ""
1186
 
1187
  #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:43
@@ -1292,15 +1276,15 @@ msgstr ""
1292
  msgid "%s does not support your store currency."
1293
  msgstr ""
1294
 
1295
- #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:384, classes/gateways/PayPal_AdvPayments/paypal_ap.php:500, classes/gateways/PayPal_Masspay/class-paypal-masspay.php:153
1296
  msgid "Error: %s"
1297
  msgstr ""
1298
 
1299
- #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:393, classes/gateways/PayPal_AdvPayments/paypal_ap.php:394
1300
  msgid "Error ID: %s. %s"
1301
  msgstr ""
1302
 
1303
- #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:508
1304
  msgid "sprintfError ID: %s. %s"
1305
  msgstr ""
1306
 
@@ -1372,7 +1356,7 @@ msgstr ""
1372
  msgid "Hide items"
1373
  msgstr ""
1374
 
1375
- #: templates/dashboard/orders.php:19, templates/dashboard/orders.php:90
1376
  msgid "View items"
1377
  msgstr ""
1378
 
@@ -1380,11 +1364,11 @@ msgstr ""
1380
  msgid "Links"
1381
  msgstr ""
1382
 
1383
- #: templates/dashboard/orders.php:111
1384
  msgid "Tracking"
1385
  msgstr ""
1386
 
1387
- #: templates/dashboard/orders.php:185
1388
  msgid "You have no orders during this period."
1389
  msgstr ""
1390
 
@@ -1444,34 +1428,42 @@ msgstr ""
1444
  msgid "Edit product: %s"
1445
  msgstr ""
1446
 
1447
- #: templates/emails/notify-vendor-shipped.php:13
1448
  msgid "A vendor has marked part of your order as shipped. The items that are shipped are as follows:"
1449
  msgstr ""
1450
 
1451
- #: templates/emails/notify-vendor-shipped.php:17, templates/emails/vendor-new-order.php:17
1452
  msgid "Order: %s"
1453
  msgstr ""
1454
 
1455
- #: templates/emails/notify-vendor-shipped.php:24, templates/emails/vendor-new-order.php:24
1456
  msgid "Price"
1457
  msgstr ""
1458
 
1459
- #: templates/emails/notify-vendor-shipped.php:56, templates/emails/vendor-new-order.php:56
1460
  msgid "Customer details"
1461
  msgstr ""
1462
 
1463
- #: templates/emails/notify-vendor-shipped.php:59, templates/emails/vendor-new-order.php:59
1464
  msgid "Email:"
1465
  msgstr ""
1466
 
1467
- #: templates/emails/notify-vendor-shipped.php:62, templates/emails/vendor-new-order.php:62
1468
  msgid "Tel:"
1469
  msgstr ""
1470
 
1471
- #: templates/emails/vendor-new-order.php:13
1472
  msgid "You have received an order from %s. Their order is as follows:"
1473
  msgstr ""
1474
 
 
 
 
 
 
 
 
 
1475
  #: templates/orders/csv-export.php:6
1476
  msgid "Export orders"
1477
  msgstr ""
@@ -1484,6 +1476,10 @@ msgstr ""
1484
  msgid "No customer note."
1485
  msgstr ""
1486
 
 
 
 
 
1487
  #: templates/orders/shipping/shipping-form.php:75
1488
  msgid "Update tracking number"
1489
  msgstr ""
1
+ # Copyright (C) 2017 wcvendors
2
  # This file is distributed under the same license as the wcvendors package.
3
  msgid ""
4
  msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
11
  "Last-Translator: Jamie Madden <support@wcvendors.com>\n"
12
  "Language-Team: WC Vendors <support@wcvendors.com>\n"
13
  "X-Poedit-Basepath: ..\n"
20
  msgid "WC Vendors requires WooCommerce to run. Please install WooCommerce and activate before attempting to activate again."
21
  msgstr ""
22
 
23
+ #: class-wc-vendors.php:199, classes/admin/class-admin-reports.php:41, classes/admin/class-admin-users.php:384
24
  msgid "WC Vendors"
25
  msgstr ""
26
 
27
  #: class-wc-vendors.php:255
28
+ msgid "<b>WC Vendors is inactive</b>. WC Vendors requires a minimum of WooCommerce v2.7.0."
29
  msgstr ""
30
 
31
+ #: class-wc-vendors.php:595, classes/admin/settings/sf-options.php:192
32
  msgid "Capabilities"
33
  msgstr ""
34
 
35
+ #: class-wc-vendors.php:641, classes/admin/class-admin-page.php:153, classes/admin/class-admin-page.php:416, classes/admin/class-admin-reports.php:178, classes/admin/class-admin-reports.php:461, classes/admin/class-product-meta.php:46, classes/admin/class-product-meta.php:187, classes/admin/class-product-meta.php:223, classes/class-install.php:51, classes/class-install.php:105
36
  msgid "Vendor"
37
  msgstr ""
38
 
39
+ #: class-wc-vendors.php:645, classes/admin/settings/sf-options.php:4
40
  msgid "General"
41
  msgstr ""
42
 
43
+ #: class-wc-vendors.php:721
44
  msgid "Documentation/KB"
45
  msgstr ""
46
 
47
+ #: class-wc-vendors.php:723
48
  msgid "Help Forums"
49
  msgstr ""
50
 
51
+ #: class-wc-vendors.php:725
52
  msgid "Paid Support"
53
  msgstr ""
54
 
55
+ #: classes/admin/class-admin-page.php:31
56
  msgid "Vendors shipped"
57
  msgstr ""
58
 
59
+ #: classes/admin/class-admin-page.php:56
60
  msgid "Vendors Shipped"
61
  msgstr ""
62
 
63
+ #: classes/admin/class-admin-page.php:82, classes/admin/class-admin-page.php:82, classes/admin/class-admin-page.php:277, classes/admin/class-admin-page.php:417, classes/admin/class-product-meta.php:151, classes/admin/class-product-meta.php:167, templates/dashboard/reports.php:19
64
  msgid "Commission"
65
  msgstr ""
66
 
67
+ #: classes/admin/class-admin-page.php:107
68
  msgid "Reset WC Vendors roles "
69
  msgstr ""
70
 
71
+ #: classes/admin/class-admin-page.php:108
72
  msgid "Reset WC Vendor Roles"
73
  msgstr ""
74
 
75
+ #: classes/admin/class-admin-page.php:109
76
  msgid "This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities."
77
  msgstr ""
78
 
79
+ #: classes/admin/class-admin-page.php:114
80
  msgid "Reset WC Vendors "
81
  msgstr ""
82
 
83
+ #: classes/admin/class-admin-page.php:115
84
  msgid "Reset WC Vendors Settings"
85
  msgstr ""
86
 
87
+ #: classes/admin/class-admin-page.php:116
88
  msgid "This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings."
89
  msgstr ""
90
 
91
+ #: classes/admin/class-admin-page.php:156, classes/class-install.php:98, classes/class-install.php:254
92
  msgid "Pending Vendor"
93
  msgstr ""
94
 
95
+ #: classes/admin/class-admin-page.php:162
96
  msgid "WC Vendor roles successfully reset."
97
  msgstr ""
98
 
99
+ #: classes/admin/class-admin-page.php:176
100
  msgid "WC Vendors was successfully reset. All settings have been reset."
101
  msgstr ""
102
 
103
+ #: classes/admin/class-admin-page.php:190
104
  msgid "Select a Vendor"
105
  msgstr ""
106
 
107
+ #: classes/admin/class-admin-page.php:414, classes/admin/class-admin-reports.php:177, templates/dashboard/reports.php:17, templates/emails/notify-vendor-shipped.php:26, templates/emails/vendor-new-order.php:30
108
  msgid "Product"
109
  msgstr ""
110
 
111
+ #: classes/admin/class-admin-page.php:415, classes/admin/class-vendor-admin-dashboard.php:307
112
  msgid "Order ID"
113
  msgstr ""
114
 
115
+ #: classes/admin/class-admin-page.php:418, classes/admin/class-admin-reports.php:350, classes/admin/settings/sf-options.php:52, classes/admin/settings/sf-options.php:136, templates/dashboard/orders.php:45, templates/orders/orders.php:111
116
+ msgid "Shipping"
117
+ msgstr ""
118
+
119
+ #: classes/admin/class-admin-page.php:419, classes/admin/class-admin-reports.php:349
120
+ msgid "Tax"
121
+ msgstr ""
122
+
123
+ #: classes/admin/class-admin-page.php:420, classes/admin/class-admin-reports.php:179, classes/admin/class-admin-reports.php:377, classes/admin/class-vendor-admin-dashboard.php:310, templates/dashboard/orders.php:46
124
  msgid "Total"
125
  msgstr ""
126
 
127
+ #: classes/admin/class-admin-page.php:421, classes/admin/class-admin-reports.php:181, classes/admin/class-admin-reports.php:464
128
  msgid "Status"
129
  msgstr ""
130
 
131
+ #: classes/admin/class-admin-page.php:422, classes/admin/class-vendor-admin-dashboard.php:312, classes/front/orders/class-orders.php:257, templates/dashboard/orders.php:47
132
  msgid "Date"
133
  msgstr ""
134
 
135
+ #: classes/admin/class-admin-page.php:466
136
  msgid "Mark paid"
137
  msgstr ""
138
 
139
+ #: classes/admin/class-admin-page.php:467
140
  msgid "Mark due"
141
  msgstr ""
142
 
143
+ #: classes/admin/class-admin-page.php:468
144
  msgid "Mark reversed"
145
  msgstr ""
146
 
147
+ #: classes/admin/class-admin-page.php:469
148
  msgid "Delete"
149
  msgstr ""
150
 
151
+ #: classes/admin/class-admin-page.php:530
152
  msgid "Show all dates"
153
  msgstr ""
154
 
155
+ #: classes/admin/class-admin-page.php:565
156
  msgid "Show all Statuses"
157
  msgstr ""
158
 
159
+ #: classes/admin/class-admin-page.php:566, classes/admin/class-admin-reports.php:353, classes/admin/class-admin-reports.php:446, classes/class-commission.php:66
160
  msgid "Due"
161
  msgstr ""
162
 
163
+ #: classes/admin/class-admin-page.php:567, classes/admin/class-admin-reports.php:352, classes/admin/class-admin-reports.php:447, classes/class-commission.php:67
164
  msgid "Paid"
165
  msgstr ""
166
 
167
+ #: classes/admin/class-admin-page.php:568, classes/admin/class-admin-reports.php:351, classes/admin/class-admin-reports.php:448, classes/class-commission.php:68
168
  msgid "Reversed"
169
  msgstr ""
170
 
171
+ #: classes/admin/class-admin-page.php:621
172
  msgid "Commission marked paid."
173
  msgstr ""
174
 
175
+ #: classes/admin/class-admin-page.php:628
176
  msgid "Commission marked due."
177
  msgstr ""
178
 
179
+ #: classes/admin/class-admin-page.php:635
180
  msgid "Commission marked reversed."
181
  msgstr ""
182
 
268
  msgid "Month"
269
  msgstr ""
270
 
 
 
 
 
 
 
 
 
271
  #: classes/admin/class-admin-reports.php:462
272
  msgid "Tax Total"
273
  msgstr ""
284
  msgid "No commissions found."
285
  msgstr ""
286
 
287
+ #: classes/admin/class-admin-users.php:394
288
  msgid "Enable HTML for the shop description"
289
  msgstr ""
290
 
291
+ #: classes/admin/class-admin-users.php:400
292
  msgid "Shop name"
293
  msgstr ""
294
 
295
+ #: classes/admin/class-admin-users.php:407
296
  msgid "PayPal E-mail"
297
  msgstr ""
298
 
299
+ #: classes/admin/class-admin-users.php:408
300
  msgid "required"
301
  msgstr ""
302
 
303
+ #: classes/admin/class-admin-users.php:415
304
  msgid "Commission rate"
305
  msgstr ""
306
 
307
+ #: classes/admin/class-admin-users.php:416, classes/admin/class-product-meta.php:174
308
  msgid "Leave blank for default"
309
  msgstr ""
310
 
311
+ #: classes/admin/class-admin-users.php:422
312
  msgid "Give Tax"
313
  msgstr ""
314
 
315
+ #: classes/admin/class-admin-users.php:427
316
  msgid "Tax override for vendor"
317
  msgstr ""
318
 
319
+ #: classes/admin/class-admin-users.php:433
320
  msgid "Give Shipping"
321
  msgstr ""
322
 
323
+ #: classes/admin/class-admin-users.php:438
324
  msgid "Shipping override for vendor"
325
  msgstr ""
326
 
327
+ #: classes/admin/class-admin-users.php:444, classes/admin/views/html-vendor-settings-page.php:30, templates/dashboard/settings/seller-info.php:3
328
  msgid "Seller info"
329
  msgstr ""
330
 
331
+ #: classes/admin/class-admin-users.php:449
332
  msgid "Shop description"
333
  msgstr ""
334
 
335
+ #: classes/admin/class-vendor-admin-dashboard.php:22, classes/admin/class-vendor-admin-dashboard.php:22, classes/class-install.php:207
336
  msgid "Shop Settings"
337
  msgstr ""
338
 
339
+ #: classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:168, classes/admin/settings/sf-options.php:196, classes/class-install.php:206, templates/dashboard/orders.php:35
340
  msgid "Orders"
341
  msgstr ""
342
 
343
+ #: classes/admin/class-vendor-admin-dashboard.php:67, classes/front/dashboard/class-vendor-dashboard.php:112
344
  msgid "Your PayPal address is not a valid email address."
345
  msgstr ""
346
 
347
+ #: classes/admin/class-vendor-admin-dashboard.php:76, classes/front/dashboard/class-vendor-dashboard.php:121
348
  msgid "That shop name is already taken. Your shop name must be unique."
349
  msgstr ""
350
 
351
+ #: classes/admin/class-vendor-admin-dashboard.php:106, classes/admin/settings/classes/sf-class-settings.php:371, classes/front/dashboard/class-vendor-dashboard.php:139
352
  msgid "Settings saved."
353
  msgstr ""
354
 
355
+ #: classes/admin/class-vendor-admin-dashboard.php:231
356
  msgid "order"
357
  msgstr ""
358
 
359
+ #: classes/admin/class-vendor-admin-dashboard.php:232
360
  msgid "orders"
361
  msgstr ""
362
 
363
+ #: classes/admin/class-vendor-admin-dashboard.php:308
364
  msgid "Customer"
365
  msgstr ""
366
 
367
+ #: classes/admin/class-vendor-admin-dashboard.php:309, classes/admin/settings/sf-options.php:127, classes/admin/settings/sf-options.php:254, classes/front/class-vendor-shop.php:344, classes/front/class-vendor-shop.php:348
368
  msgid "Products"
369
  msgstr ""
370
 
371
+ #: classes/admin/class-vendor-admin-dashboard.php:311
372
  msgid "Comments to Customer"
373
  msgstr ""
374
 
375
+ #: classes/admin/class-vendor-admin-dashboard.php:313, templates/dashboard/orders.php:106
376
  msgid "Shipped"
377
  msgstr ""
378
 
379
+ #: classes/admin/class-vendor-admin-dashboard.php:349, templates/dashboard/orders.php:99
380
  msgid "Mark shipped"
381
  msgstr ""
382
 
383
+ #: classes/admin/class-vendor-admin-dashboard.php:374
384
  msgid "Orders marked shipped."
385
  msgstr ""
386
 
387
+ #: classes/admin/class-vendor-admin-dashboard.php:410, classes/front/dashboard/class-vendor-dashboard.php:40
388
  msgid "You are not allowed to modify this order."
389
  msgstr ""
390
 
391
+ #: classes/admin/class-vendor-admin-dashboard.php:532
392
  msgid "Yes"
393
  msgstr ""
394
 
395
+ #: classes/admin/class-vendor-admin-dashboard.php:532
396
  msgid "No"
397
  msgstr ""
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  #: classes/admin/class-vendor-applicants.php:73
400
  msgid "Vendor has been <b>denied</b>."
401
  msgstr ""
436
  msgid "[{blogname}] Your vendor application has been {status}"
437
  msgstr ""
438
 
439
+ #: classes/admin/emails/class-wc-approve-vendor.php:123, classes/admin/emails/class-wc-notify-admin.php:134, classes/admin/emails/class-wc-notify-shipped.php:164, classes/admin/emails/class-wc-notify-vendor.php:265
440
  msgid "Enable/Disable"
441
  msgstr ""
442
 
443
+ #: classes/admin/emails/class-wc-approve-vendor.php:125, classes/admin/emails/class-wc-notify-admin.php:136, classes/admin/emails/class-wc-notify-shipped.php:166, classes/admin/emails/class-wc-notify-vendor.php:267
444
  msgid "Enable this email notification"
445
  msgstr ""
446
 
448
  msgid "Enter recipients (comma separated) for this email. Defaults to <code>%s</code>."
449
  msgstr ""
450
 
451
+ #: classes/admin/emails/class-wc-approve-vendor.php:136, classes/admin/emails/class-wc-notify-admin.php:147, classes/admin/emails/class-wc-notify-shipped.php:170, classes/admin/emails/class-wc-notify-vendor.php:271
452
  msgid "Subject"
453
  msgstr ""
454
 
455
+ #: classes/admin/emails/class-wc-approve-vendor.php:138, classes/admin/emails/class-wc-notify-admin.php:149, classes/admin/emails/class-wc-notify-shipped.php:172, classes/admin/emails/class-wc-notify-vendor.php:273
456
  msgid "This controls the email subject line. Leave blank to use the default subject: <code>%s</code>."
457
  msgstr ""
458
 
459
+ #: classes/admin/emails/class-wc-approve-vendor.php:143, classes/admin/emails/class-wc-notify-admin.php:154, classes/admin/emails/class-wc-notify-shipped.php:177, classes/admin/emails/class-wc-notify-vendor.php:278
460
  msgid "Email Heading"
461
  msgstr ""
462
 
463
+ #: classes/admin/emails/class-wc-approve-vendor.php:145, classes/admin/emails/class-wc-notify-admin.php:156, classes/admin/emails/class-wc-notify-shipped.php:179, classes/admin/emails/class-wc-notify-vendor.php:280
464
  msgid "This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>."
465
  msgstr ""
466
 
467
+ #: classes/admin/emails/class-wc-approve-vendor.php:150, classes/admin/emails/class-wc-notify-admin.php:161, classes/admin/emails/class-wc-notify-shipped.php:184, classes/admin/emails/class-wc-notify-vendor.php:291
468
  msgid "Email type"
469
  msgstr ""
470
 
471
+ #: classes/admin/emails/class-wc-approve-vendor.php:152, classes/admin/emails/class-wc-notify-admin.php:163, classes/admin/emails/class-wc-notify-shipped.php:186, classes/admin/emails/class-wc-notify-vendor.php:293
472
  msgid "Choose which format of email to send."
473
  msgstr ""
474
 
475
+ #: classes/admin/emails/class-wc-approve-vendor.php:156, classes/admin/emails/class-wc-notify-admin.php:167, classes/admin/emails/class-wc-notify-shipped.php:190, classes/admin/emails/class-wc-notify-vendor.php:297
476
  msgid "Plain text"
477
  msgstr ""
478
 
479
+ #: classes/admin/emails/class-wc-approve-vendor.php:157, classes/admin/emails/class-wc-notify-admin.php:168, classes/admin/emails/class-wc-notify-shipped.php:191, classes/admin/emails/class-wc-notify-vendor.php:298
480
  msgid "HTML"
481
  msgstr ""
482
 
483
+ #: classes/admin/emails/class-wc-approve-vendor.php:158, classes/admin/emails/class-wc-notify-admin.php:169, classes/admin/emails/class-wc-notify-shipped.php:192, classes/admin/emails/class-wc-notify-vendor.php:299
484
  msgid "Multipart"
485
  msgstr ""
486
 
516
  msgid "[{blogname}] Your order has been shipped ({order_number}) - {order_date}"
517
  msgstr ""
518
 
519
+ #: classes/admin/emails/class-wc-notify-shipped.php:113
520
  msgid "Subtotal:"
521
  msgstr ""
522
 
536
  msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
537
  msgstr ""
538
 
539
+ #: classes/admin/emails/class-wc-notify-vendor.php:107
540
  msgid "Commission Subtotal:"
541
  msgstr ""
542
 
543
+ #: classes/admin/emails/class-wc-notify-vendor.php:113
544
  msgid "Tax Subtotal:"
545
  msgstr ""
546
 
547
+ #: classes/admin/emails/class-wc-notify-vendor.php:121
548
  msgid "Shipping Subtotal:"
549
  msgstr ""
550
 
551
+ #: classes/admin/emails/class-wc-notify-vendor.php:285
552
  msgid "Product Totals"
553
  msgstr ""
554
 
555
+ #: classes/admin/emails/class-wc-notify-vendor.php:287
556
  msgid "Show the commission due/paid as the product totals instead of the product prices."
557
  msgstr ""
558
 
559
+ #: classes/admin/settings/classes/sf-class-format-options.php:211, classes/admin/settings/classes/sf-class-settings.php:794, classes/admin/settings/classes/sf-class-settings.php:828
560
  msgid "Select a page..."
561
  msgstr ""
562
 
564
  msgid "Settings"
565
  msgstr ""
566
 
567
+ #: classes/admin/settings/classes/sf-class-settings.php:305
568
  msgid "Could not load settings at: "
569
  msgstr ""
570
 
571
+ #: classes/admin/settings/classes/sf-class-settings.php:305
572
  msgid "Error - WP Settings Framework"
573
  msgstr ""
574
 
575
+ #: classes/admin/settings/classes/sf-class-settings.php:489
576
  msgid "Save %s changes"
577
  msgstr ""
578
 
579
+ #: classes/admin/settings/classes/sf-class-settings.php:502
580
  msgid "Please help with a <a href=\"https://wordpress.org/support/view/plugin-reviews/wc-vendors?rate=5#postform\" target=\"top\">High Five!</a> | <a href=\"https://www.wcvendors.com/product/wc-vendors-pro/\" target=\"top\">WC Vendors Pro</a> | <a href=\"https://www.wcvendors.com/product/stripe-commissions-gateway/\" target=\"top\">Stripe Commissions & Gateway</a> | <a href=\"https://www.wcvendors.com/kb/\" target=\"top\">KnowledgeBase</a> | <a href=\"https://www.wcvendors.com/help/\" target=\"top\">Help Forums</a>"
581
  msgstr ""
582
 
583
+ #: classes/admin/settings/classes/sf-class-settings.php:787, classes/admin/settings/classes/sf-class-settings.php:821
584
  msgid "Edit Page"
585
  msgstr ""
586
 
587
+ #: classes/admin/settings/classes/sf-class-settings.php:788, classes/admin/settings/classes/sf-class-settings.php:822
588
  msgid "View Page"
589
  msgstr ""
590
 
591
+ #: classes/admin/settings/classes/sf-class-settings.php:886
592
  msgid "Update %s"
593
  msgstr ""
594
 
595
+ #: classes/admin/settings/classes/sf-class-settings.php:886, classes/admin/settings/classes/sf-class-settings.php:886
596
  msgid "Add %s"
597
  msgstr ""
598
 
599
+ #: classes/admin/settings/classes/sf-class-settings.php:886
600
  msgid "Upload an image for the %s"
601
  msgstr ""
602
 
1096
  msgid "Success. Your tracking number has been updated."
1097
  msgstr ""
1098
 
1099
+ #: classes/front/orders/class-export-csv.php:19, templates/dashboard/reports.php:18, templates/emails/notify-vendor-shipped.php:27, templates/emails/vendor-new-order.php:31
1100
  msgid "Quantity"
1101
  msgstr ""
1102
 
1148
  msgid "Success. The customer has been notified of your comment."
1149
  msgstr ""
1150
 
1151
+ #: classes/front/signup/class-vendor-signup.php:70
1152
+ msgid "Application denied. You are an administrator."
1153
  msgstr ""
1154
 
1155
+ #: classes/front/signup/class-vendor-signup.php:72
1156
+ msgid "Your application has been submitted."
1157
  msgstr ""
1158
 
1159
+ #: classes/front/signup/class-vendor-signup.php:119, classes/front/signup/class-vendor-signup.php:156, classes/front/signup/class-vendor-signup.php:168
1160
+ msgid "You must accept the terms and conditions to become a vendor."
1161
  msgstr ""
1162
 
1163
+ #: classes/front/signup/views/html-vendor-signup.php:21, templates/dashboard/denied.php:22
1164
+ msgid "Apply to become a vendor? "
1165
  msgstr ""
1166
 
1167
+ #: classes/front/signup/views/html-vendor-signup.php:35
1168
+ msgid "I have read and accepted the <a target=\"top\" href=\"%s\">terms and conditions</a>"
1169
  msgstr ""
1170
 
1171
  #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:43
1276
  msgid "%s does not support your store currency."
1277
  msgstr ""
1278
 
1279
+ #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:389, classes/gateways/PayPal_AdvPayments/paypal_ap.php:505, classes/gateways/PayPal_Masspay/class-paypal-masspay.php:153
1280
  msgid "Error: %s"
1281
  msgstr ""
1282
 
1283
+ #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:398, classes/gateways/PayPal_AdvPayments/paypal_ap.php:399
1284
  msgid "Error ID: %s. %s"
1285
  msgstr ""
1286
 
1287
+ #: classes/gateways/PayPal_AdvPayments/paypal_ap.php:513
1288
  msgid "sprintfError ID: %s. %s"
1289
  msgstr ""
1290
 
1356
  msgid "Hide items"
1357
  msgstr ""
1358
 
1359
+ #: templates/dashboard/orders.php:19, templates/dashboard/orders.php:93
1360
  msgid "View items"
1361
  msgstr ""
1362
 
1364
  msgid "Links"
1365
  msgstr ""
1366
 
1367
+ #: templates/dashboard/orders.php:114
1368
  msgid "Tracking"
1369
  msgstr ""
1370
 
1371
+ #: templates/dashboard/orders.php:188
1372
  msgid "You have no orders during this period."
1373
  msgstr ""
1374
 
1428
  msgid "Edit product: %s"
1429
  msgstr ""
1430
 
1431
+ #: templates/emails/notify-vendor-shipped.php:17
1432
  msgid "A vendor has marked part of your order as shipped. The items that are shipped are as follows:"
1433
  msgstr ""
1434
 
1435
+ #: templates/emails/notify-vendor-shipped.php:21, templates/emails/vendor-new-order.php:25
1436
  msgid "Order: %s"
1437
  msgstr ""
1438
 
1439
+ #: templates/emails/notify-vendor-shipped.php:28, templates/emails/vendor-new-order.php:32
1440
  msgid "Price"
1441
  msgstr ""
1442
 
1443
+ #: templates/emails/notify-vendor-shipped.php:60, templates/emails/vendor-new-order.php:80
1444
  msgid "Customer details"
1445
  msgstr ""
1446
 
1447
+ #: templates/emails/notify-vendor-shipped.php:63, templates/emails/vendor-new-order.php:83
1448
  msgid "Email:"
1449
  msgstr ""
1450
 
1451
+ #: templates/emails/notify-vendor-shipped.php:66, templates/emails/vendor-new-order.php:86
1452
  msgid "Tel:"
1453
  msgstr ""
1454
 
1455
+ #: templates/emails/vendor-new-order.php:21
1456
  msgid "You have received an order from %s. Their order is as follows:"
1457
  msgstr ""
1458
 
1459
+ #: templates/orders/comments/add-new-comment.php:11
1460
+ msgid "Add comment"
1461
+ msgstr ""
1462
+
1463
+ #: templates/orders/comments/existing-comments.php:9
1464
+ msgid "added %s ago"
1465
+ msgstr ""
1466
+
1467
  #: templates/orders/csv-export.php:6
1468
  msgid "Export orders"
1469
  msgstr ""
1476
  msgid "No customer note."
1477
  msgstr ""
1478
 
1479
+ #: templates/orders/orders.php:80
1480
+ msgid "Comments (%s)"
1481
+ msgstr ""
1482
+
1483
  #: templates/orders/shipping/shipping-form.php:75
1484
  msgid "Update tracking number"
1485
  msgstr ""
readme.txt CHANGED
@@ -6,7 +6,7 @@ Author URI: http://www.wcvendors.com/
6
  Plugin URI: http://www.wcvendors.com/
7
  Requires at least: 4.4.0
8
  Tested up to: 4.7.1
9
- Stable tag: 1.9.8
10
  License: GPLv2 or later
11
 
12
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your site!
@@ -122,7 +122,25 @@ No Upgrade required at this time.
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
 
 
 
 
125
  * Fixed: Capabilities Fix for Resetting Roles #329
 
 
 
 
 
 
 
 
126
 
127
  = Version 1.9.8 - 18th January 2017 =
128
 
6
  Plugin URI: http://www.wcvendors.com/
7
  Requires at least: 4.4.0
8
  Tested up to: 4.7.1
9
+ Stable tag: 1.9.9
10
  License: GPLv2 or later
11
 
12
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your site!
122
 
123
  == Changelog ==
124
 
125
+ = Version 1.9.9 - 14th March 2017 =
126
+
127
+ * Added: Filters to vendor admin dashboard class for custom columns #339
128
+ * Added: Vendor shop name to the <title> tag on products archive page
129
+ * Updated Woocommerce 2.7 compatibility
130
+ * Updated: i18n text domain loading for proper translations #341
131
+ * Fixed: Class logger when called via includes files
132
+ * Fixed: Bug in how admin notices are displayed when saving shop settings
133
+ * Fixed: 2.7 compatibility bugs
134
+ * Fixed: Commissions Subtotal showing Full Product Price in vendor email #330
135
  * Fixed: Capabilities Fix for Resetting Roles #329
136
+ * Fixed: HTML title attribute doesn't change for store pages #328
137
+ * Fixed: Login form not displayed if get variable set
138
+ * Fixed: Depreciated action in product edit screen
139
+
140
+ Templates Updated:
141
+ templates/emails/vendor-new-order.php
142
+ templates/emails/notify-vendor-shipped.php
143
+ templates/order/orders.php
144
 
145
  = Version 1.9.8 - 18th January 2017 =
146
 
templates/dashboard/orders.php CHANGED
@@ -55,9 +55,10 @@ jQuery(function () {
55
 
56
  <?php foreach ( $order_summary as $order ) :
57
 
58
- $order = new WC_Order( $order->order_id );
59
- $valid_items = WCV_Queries::get_products_for_order( $order->id );
60
- $valid = array();
 
61
  $needs_shipping = false;
62
 
63
  $items = $order->get_items();
@@ -72,16 +73,18 @@ jQuery(function () {
72
 
73
  }
74
 
75
- $shippers = (array) get_post_meta( $order->id, 'wc_pv_shipped', true );
76
  $shipped = in_array($user_id, $shippers);
 
 
77
 
78
  ?>
79
 
80
- <tr id="order-<?php echo $order->id; ?>" data-order-id="<?php echo $order->id; ?>">
81
  <td><?php echo $order->get_order_number(); ?></td>
82
  <td><?php echo apply_filters( 'wcvendors_dashboard_google_maps_link', '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( esc_html( preg_replace( '#<br\s*/?>#i', ', ', $order->get_formatted_shipping_address() ) ) ) . '&z=16' ) . '">'. esc_html( preg_replace( '#<br\s*/?>#i', ', ', $order->get_formatted_shipping_address() ) ) .'</a>' ); ?></td>
83
- <td><?php $sum = WCV_Queries::sum_for_orders( array( $order->id ), array('vendor_id'=>get_current_user_id()) ); $total = $sum[0]->line_total; $totals += $total; echo woocommerce_price( $total ); ?></td>
84
- <td><?php echo $order->order_date; ?></td>
85
  <td>
86
  <?php
87
  $order_actions = array(
@@ -94,7 +97,7 @@ jQuery(function () {
94
  $order_actions['shipped'] = array(
95
  'class' => 'mark-shipped',
96
  'content' => __('Mark shipped', 'wcvendors'),
97
- 'url' => '?wc_pv_mark_shipped=' . $order->id
98
  );
99
  }
100
  if ( $shipped ) {
@@ -120,7 +123,7 @@ jQuery(function () {
120
  $output[] = sprintf(
121
  '<a href="%s" id="%s" class="%s">%s</a>',
122
  (isset($data['url'])) ? $data['url'] : '#',
123
- (isset($data['id'])) ? $data['id'] : $key . '-' . $order->id,
124
  (isset($data['class'])) ? $data['class'] : '',
125
  $data['content']
126
  );
@@ -131,7 +134,7 @@ jQuery(function () {
131
  </td>
132
  </tr>
133
 
134
- <tr id="view-items-<?php echo $order->id; ?>" style="display:none;">
135
  <td colspan="5">
136
  <?php
137
  $product_id = '';
@@ -153,12 +156,12 @@ jQuery(function () {
153
  <?php if ( class_exists( 'WC_Shipment_Tracking' ) ) : ?>
154
 
155
  <?php if ( is_array( $providers ) ) : ?>
156
- <tr id="view-tracking-<?php echo $order->id; ?>" style="display:none;">
157
  <td colspan="5">
158
  <div class="order-tracking">
159
  <?php
160
  wc_get_template( 'shipping-form.php', array(
161
- 'order_id' => $order->id,
162
  'product_id' => $product_id,
163
  'providers' => $providers,
164
  ), 'wc-vendors/orders/shipping/', wcv_plugin_dir . 'templates/orders/shipping/' );
@@ -175,7 +178,7 @@ jQuery(function () {
175
 
176
  <tr>
177
  <td><b>Total:</b></td>
178
- <td colspan="4"><?php echo woocommerce_price( $totals ); ?></td>
179
  </tr>
180
 
181
  <?php else : ?>
55
 
56
  <?php foreach ( $order_summary as $order ) :
57
 
58
+ $order = new WC_Order( $order->order_id );
59
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
60
+ $valid_items = WCV_Queries::get_products_for_order( $order_id );
61
+ $valid = array();
62
  $needs_shipping = false;
63
 
64
  $items = $order->get_items();
73
 
74
  }
75
 
76
+ $shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
77
  $shipped = in_array($user_id, $shippers);
78
+
79
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
80
 
81
  ?>
82
 
83
+ <tr id="order-<?php echo $order_id; ?>" data-order-id="<?php echo $order_id; ?>">
84
  <td><?php echo $order->get_order_number(); ?></td>
85
  <td><?php echo apply_filters( 'wcvendors_dashboard_google_maps_link', '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( esc_html( preg_replace( '#<br\s*/?>#i', ', ', $order->get_formatted_shipping_address() ) ) ) . '&z=16' ) . '">'. esc_html( preg_replace( '#<br\s*/?>#i', ', ', $order->get_formatted_shipping_address() ) ) .'</a>' ); ?></td>
86
+ <td><?php $sum = WCV_Queries::sum_for_orders( array( $order_id ), array('vendor_id'=>get_current_user_id()) ); $total = $sum[0]->line_total; $totals += $total; echo wc_price( $total ); ?></td>
87
+ <td><?php echo date_i18n( wc_date_format(), strtotime( $order_date ) ); ?></td>
88
  <td>
89
  <?php
90
  $order_actions = array(
97
  $order_actions['shipped'] = array(
98
  'class' => 'mark-shipped',
99
  'content' => __('Mark shipped', 'wcvendors'),
100
+ 'url' => '?wc_pv_mark_shipped=' . $order_id
101
  );
102
  }
103
  if ( $shipped ) {
123
  $output[] = sprintf(
124
  '<a href="%s" id="%s" class="%s">%s</a>',
125
  (isset($data['url'])) ? $data['url'] : '#',
126
+ (isset($data['id'])) ? $data['id'] : $key . '-' . $order_id,
127
  (isset($data['class'])) ? $data['class'] : '',
128
  $data['content']
129
  );
134
  </td>
135
  </tr>
136
 
137
+ <tr id="view-items-<?php echo $order_id; ?>" style="display:none;">
138
  <td colspan="5">
139
  <?php
140
  $product_id = '';
156
  <?php if ( class_exists( 'WC_Shipment_Tracking' ) ) : ?>
157
 
158
  <?php if ( is_array( $providers ) ) : ?>
159
+ <tr id="view-tracking-<?php echo $order_id; ?>" style="display:none;">
160
  <td colspan="5">
161
  <div class="order-tracking">
162
  <?php
163
  wc_get_template( 'shipping-form.php', array(
164
+ 'order_id' => $order_id,
165
  'product_id' => $product_id,
166
  'providers' => $providers,
167
  ), 'wc-vendors/orders/shipping/', wcv_plugin_dir . 'templates/orders/shipping/' );
178
 
179
  <tr>
180
  <td><b>Total:</b></td>
181
+ <td colspan="4"><?php echo wc_price( $totals ); ?></td>
182
  </tr>
183
 
184
  <?php else : ?>
templates/dashboard/reports.php CHANGED
@@ -28,18 +28,18 @@ if ( $datepicker !== 'false' ) {
28
  <?php if ( !empty( $vendor_summary[ 'products' ] ) ) : ?>
29
 
30
  <?php foreach ( $vendor_summary[ 'products' ] as $product ) :
31
- $_product = get_product( $product[ 'id' ] ); ?>
32
 
33
  <tr>
34
 
35
  <td class="product"><strong><a
36
- href="<?php echo esc_url( get_permalink( $_product->id ) ) ?>"><?php echo $product[ 'title' ] ?></a></strong>
37
  <?php if ( !empty( $_product->variation_id ) ) {
38
  echo woocommerce_get_formatted_variation( $_product->variation_data );
39
  } ?>
40
  </td>
41
  <td class="qty"><?php echo $product[ 'qty' ]; ?></td>
42
- <td class="commission"><?php echo woocommerce_price( $product[ 'cost' ] ); ?></td>
43
  <td class="rate"><?php echo sprintf( '%.2f%%', $product[ 'commission_rate' ] ); ?></td>
44
 
45
  <?php if ( $can_view_orders ) : ?>
@@ -55,7 +55,7 @@ if ( $datepicker !== 'false' ) {
55
  <tr>
56
  <td><strong><?php _e( 'Totals', 'wcvendors' ); ?></strong></td>
57
  <td><?php echo $vendor_summary[ 'total_qty' ]; ?></td>
58
- <td><?php echo woocommerce_price( $vendor_summary[ 'total_cost' ] ); ?></td>
59
  <td></td>
60
 
61
  <?php if ( $can_view_orders ) : ?>
28
  <?php if ( !empty( $vendor_summary[ 'products' ] ) ) : ?>
29
 
30
  <?php foreach ( $vendor_summary[ 'products' ] as $product ) :
31
+ $_product = wc_get_product( $product[ 'id' ] ); ?>
32
 
33
  <tr>
34
 
35
  <td class="product"><strong><a
36
+ href="<?php echo esc_url( get_permalink( $_product->get_id() ) ) ?>"><?php echo $product[ 'title' ] ?></a></strong>
37
  <?php if ( !empty( $_product->variation_id ) ) {
38
  echo woocommerce_get_formatted_variation( $_product->variation_data );
39
  } ?>
40
  </td>
41
  <td class="qty"><?php echo $product[ 'qty' ]; ?></td>
42
+ <td class="commission"><?php echo wc_price( $product[ 'cost' ] ); ?></td>
43
  <td class="rate"><?php echo sprintf( '%.2f%%', $product[ 'commission_rate' ] ); ?></td>
44
 
45
  <?php if ( $can_view_orders ) : ?>
55
  <tr>
56
  <td><strong><?php _e( 'Totals', 'wcvendors' ); ?></strong></td>
57
  <td><?php echo $vendor_summary[ 'total_qty' ]; ?></td>
58
+ <td><?php echo wc_price( $vendor_summary[ 'total_cost' ] ); ?></td>
59
  <td></td>
60
 
61
  <?php if ( $can_view_orders ) : ?>
templates/emails/notify-vendor-shipped.php CHANGED
@@ -6,7 +6,11 @@
6
  * @package WooCommerce/Templates/Emails/HTML
7
  * @version 2.0.0
8
  */
9
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
 
 
 
 
10
 
11
  <?php do_action( 'woocommerce_email_header', $email_heading ); ?>
12
 
@@ -14,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
14
 
15
  <?php do_action( 'woocommerce_email_before_order_table', $order, true ); ?>
16
 
17
- <h2><?php printf( __( 'Order: %s', 'wcvendors'), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( woocommerce_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
18
 
19
  <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
20
  <thead>
@@ -25,12 +29,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
25
  </tr>
26
  </thead>
27
  <tbody>
28
- <?php echo $order->email_order_items_table( array(
29
- 'show_sku' => false,
30
  'show_image' => false,
31
  'image_size' => array( 32, 32 ),
32
  'plain_text' => false,
33
- 'sent_to_admin' => false
34
  ) ); ?>
35
  </tbody>
36
  <tfoot>
@@ -55,11 +59,11 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
55
 
56
  <h2><?php _e( 'Customer details', 'wcvendors' ); ?></h2>
57
 
58
- <?php if ( $order->billing_email ) : ?>
59
- <p><strong><?php _e( 'Email:', 'wcvendors' ); ?></strong> <?php echo $order->billing_email; ?></p>
60
  <?php endif; ?>
61
- <?php if ( $order->billing_phone ) : ?>
62
- <p><strong><?php _e( 'Tel:', 'wcvendors' ); ?></strong> <?php echo $order->billing_phone; ?></p>
63
  <?php endif; ?>
64
 
65
  <?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
6
  * @package WooCommerce/Templates/Emails/HTML
7
  * @version 2.0.0
8
  */
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
12
+
13
+ ?>
14
 
15
  <?php do_action( 'woocommerce_email_header', $email_heading ); ?>
16
 
18
 
19
  <?php do_action( 'woocommerce_email_before_order_table', $order, true ); ?>
20
 
21
+ <h2><?php printf( __( 'Order: %s', 'wcvendors'), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order_date ) ), date_i18n( wc_date_format(), strtotime( $order_date ) ) ); ?>)</h2>
22
 
23
  <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
24
  <thead>
29
  </tr>
30
  </thead>
31
  <tbody>
32
+ <?php echo wc_get_email_order_items( $order, array(
33
+ 'show_sku' => true,
34
  'show_image' => false,
35
  'image_size' => array( 32, 32 ),
36
  'plain_text' => false,
37
+ 'sent_to_admin' => false,
38
  ) ); ?>
39
  </tbody>
40
  <tfoot>
59
 
60
  <h2><?php _e( 'Customer details', 'wcvendors' ); ?></h2>
61
 
62
+ <?php if ( $order->get_billing_email() ) : ?>
63
+ <p><strong><?php _e( 'Email:', 'wcvendors' ); ?></strong> <?php echo $order->get_billing_email(); ?></p>
64
  <?php endif; ?>
65
+ <?php if ( $order->get_billing_phone() ) : ?>
66
+ <p><strong><?php _e( 'Tel:', 'wcvendors' ); ?></strong> <?php echo $order->get_billing_phone(); ?></p>
67
  <?php endif; ?>
68
 
69
  <?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
templates/emails/vendor-new-order.php CHANGED
@@ -2,19 +2,27 @@
2
  /**
3
  * Vendor new order email
4
  *
5
- * @author WooThemes
6
  * @package WooCommerce/Templates/Emails/HTML
7
- * @version 2.0.0
8
  */
9
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
 
 
 
 
 
 
 
 
10
 
11
  <?php do_action( 'woocommerce_email_header', $email_heading ); ?>
12
 
13
- <p><?php printf( __( 'You have received an order from %s. Their order is as follows:', 'wcvendors' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>
14
 
15
  <?php do_action( 'woocommerce_email_before_order_table', $order, true ); ?>
16
 
17
- <h2><?php printf( __( 'Order: %s', 'wcvendors'), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( woocommerce_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
18
 
19
  <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
20
  <thead>
@@ -25,13 +33,29 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
25
  </tr>
26
  </thead>
27
  <tbody>
28
- <?php echo $order->email_order_items_table( array(
29
- 'show_sku' => true,
30
- 'show_image' => false,
31
- 'image_size' => array( 32, 32 ),
32
- 'plain_text' => false,
33
- 'sent_to_admin' => false
34
- ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  </tbody>
36
  <tfoot>
37
  <?php
@@ -55,11 +79,11 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
55
 
56
  <h2><?php _e( 'Customer details', 'wcvendors' ); ?></h2>
57
 
58
- <?php if ( $order->billing_email ) : ?>
59
- <p><strong><?php _e( 'Email:', 'wcvendors' ); ?></strong> <?php echo $order->billing_email; ?></p>
60
  <?php endif; ?>
61
- <?php if ( $order->billing_phone ) : ?>
62
- <p><strong><?php _e( 'Tel:', 'wcvendors' ); ?></strong> <?php echo $order->billing_phone; ?></p>
63
  <?php endif; ?>
64
 
65
  <?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
2
  /**
3
  * Vendor new order email
4
  *
5
+ * @author WC Vendors
6
  * @package WooCommerce/Templates/Emails/HTML
7
+ * @version 1.9.9
8
  */
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+ $billing_first_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_first_name : $order->get_billing_first_name();
12
+ $billing_last_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_last_name : $order->get_billing_last_name();
13
+ $billing_email = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_email : $order->get_billing_email();
14
+ $billing_phone = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_phone : $order->get_billing_phone();
15
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
16
+
17
+ ?>
18
 
19
  <?php do_action( 'woocommerce_email_header', $email_heading ); ?>
20
 
21
+ <p><?php printf( __( 'You have received an order from %s. Their order is as follows:', 'wcvendors' ), $billing_first_name . ' ' . $billing_last_name ); ?></p>
22
 
23
  <?php do_action( 'woocommerce_email_before_order_table', $order, true ); ?>
24
 
25
+ <h2><?php printf( __( 'Order: %s', 'wcvendors'), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order_date ) ), date_i18n( wc_date_format(), strtotime( $order_date ) ) ); ?>)</h2>
26
 
27
  <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
28
  <thead>
33
  </tr>
34
  </thead>
35
  <tbody>
36
+ <?php
37
+
38
+ if ( version_compare( WC_VERSION, '2.7', '<' ) ){
39
+
40
+ echo $order->email_order_items_table( array(
41
+ 'show_sku' => true,
42
+ 'show_image' => false,
43
+ 'image_size' => array( 32, 32 ),
44
+ 'plain_text' => false,
45
+ 'sent_to_admin' => false
46
+ ) );
47
+
48
+ } else {
49
+ echo wc_get_email_order_items( $order, array(
50
+ 'show_sku' => false,
51
+ 'show_image' => false,
52
+ 'image_size' => array( 32, 32 ),
53
+ 'plain_text' => false,
54
+ 'sent_to_admin' => false,
55
+ ) );
56
+ }
57
+
58
+ ?>
59
  </tbody>
60
  <tfoot>
61
  <?php
79
 
80
  <h2><?php _e( 'Customer details', 'wcvendors' ); ?></h2>
81
 
82
+ <?php if ( $billing_email ) : ?>
83
+ <p><strong><?php _e( 'Email:', 'wcvendors' ); ?></strong> <?php echo $billing_email; ?></p>
84
  <?php endif; ?>
85
+ <?php if ( $billing_phone ) : ?>
86
+ <p><strong><?php _e( 'Tel:', 'wcvendors' ); ?></strong> <?php echo $billing_phone; ?></p>
87
  <?php endif; ?>
88
 
89
  <?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
templates/orders/orders.php CHANGED
@@ -1,10 +1,6 @@
1
- <?php
2
-
3
- global $woocommerce; ?>
4
-
5
  <?php if ( function_exists( 'wc_print_notices' ) ) { wc_print_notices(); } ?>
6
 
7
- <h2><?php printf( 'Orders for %s', get_product( $product_id )->get_title() ); ?></h2>
8
 
9
  <table class="table table-striped table-bordered">
10
  <thead>
@@ -118,12 +114,9 @@ global $woocommerce; ?>
118
 
119
  <div class="order-tracking">
120
  <?php
121
- if ( function_exists( 'wc_enqueue_js' ) ) {
122
- wc_enqueue_js( WCV_Vendor_dashboard::wc_st_js( $provider_array ) );
123
- } else {
124
- $woocommerce->add_inline_js( $js );
125
- }
126
-
127
  wc_get_template( 'shipping-form.php', array(
128
  'order_id' => $order_id,
129
  'product_id' => $product_id,
 
 
 
 
1
  <?php if ( function_exists( 'wc_print_notices' ) ) { wc_print_notices(); } ?>
2
 
3
+ <h2><?php printf( 'Orders for %s', wc_get_product( $product_id )->get_title() ); ?></h2>
4
 
5
  <table class="table table-striped table-bordered">
6
  <thead>
114
 
115
  <div class="order-tracking">
116
  <?php
117
+
118
+ wc_enqueue_js( WCV_Vendor_dashboard::wc_st_js( $provider_array ) );
119
+
 
 
 
120
  wc_get_template( 'shipping-form.php', array(
121
  'order_id' => $order_id,
122
  'product_id' => $product_id,