Version Description
No Upgrade required at this time.
Download this release
Release Info
Developer | digitalchild |
Plugin | WC Vendors |
Version | 1.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.0 to 1.6.2
- changelog.txt +14 -0
- class-wc-vendors.php +1 -1
- classes/admin/class-admin-page.php +24 -18
- classes/admin/class-admin-users.php +31 -9
- classes/admin/emails/class-emails.php +2 -3
- classes/admin/emails/class-wc-notify-vendor.php +3 -1
- classes/admin/settings/sf-options.php +14 -0
- classes/class-shipping.php +2 -2
- classes/class-vendors.php +22 -2
- classes/front/class-vendor-cart.php +6 -7
- classes/front/class-vendor-shop.php +4 -4
- classes/front/dashboard/class-vendor-dashboard.php +2 -2
- readme.txt +15 -1
changelog.txt
CHANGED
@@ -1,5 +1,19 @@
|
|
1 |
Changelog for WC Vendors
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Version 1.6.0
|
4 |
|
5 |
* Added: Admin notices for vendor page slug & permalinks
|
1 |
Changelog for WC Vendors
|
2 |
|
3 |
+
Version 1.6.2
|
4 |
+
|
5 |
+
* Added: Option to change sold by vendor name #106
|
6 |
+
* Fixed: Error notice in vendor dashboard #133
|
7 |
+
* Fixed: Pagination in commissions admin screen #68
|
8 |
+
* Added: Support for WooCommerce Order Status Manager
|
9 |
+
* Fixed: Updated media filter method for vendors #132
|
10 |
+
* Fixed: Commission not logged for variations #131
|
11 |
+
|
12 |
+
Version 1.6.1
|
13 |
+
|
14 |
+
* Fixed: Support for Per Product Shipping 2.2.x #126
|
15 |
+
* Added: Filter to change commission label in vendor email #127
|
16 |
+
|
17 |
Version 1.6.0
|
18 |
|
19 |
* Added: Admin notices for vendor page slug & permalinks
|
class-wc-vendors.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Author: WC Vendors
|
8 |
* Author URI: http://wcvendors.com
|
9 |
*
|
10 |
-
* Version: 1.6.
|
11 |
* Requires at least: 4.0.0
|
12 |
* Tested up to: 4.1.1
|
13 |
*
|
7 |
* Author: WC Vendors
|
8 |
* Author URI: http://wcvendors.com
|
9 |
*
|
10 |
+
* Version: 1.6.2
|
11 |
* Requires at least: 4.0.0
|
12 |
* Tested up to: 4.1.1
|
13 |
*
|
classes/admin/class-admin-page.php
CHANGED
@@ -132,7 +132,7 @@ class WCV_Admin_Setup
|
|
132 |
<div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
|
133 |
<h2><?php _e( 'Commission', 'wcvendors' ); ?></h2>
|
134 |
|
135 |
-
<form id="posts-filter" method="
|
136 |
|
137 |
<input type="hidden" name="page" value="pv_admin_commissions"/>
|
138 |
<?php $PV_Admin_Page->display() ?>
|
@@ -315,7 +315,8 @@ class WCV_Admin_Page extends WP_List_Table
|
|
315 |
<div class="alignleft actions"><?php
|
316 |
$this->status_dropdown( 'commission' );
|
317 |
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
318 |
-
?></div
|
|
|
319 |
}
|
320 |
}
|
321 |
|
@@ -345,9 +346,9 @@ class WCV_Admin_Page extends WP_List_Table
|
|
345 |
if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
|
346 |
return;
|
347 |
|
348 |
-
$m = isset( $
|
349 |
?>
|
350 |
-
<select name="m">
|
351 |
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
|
352 |
<?php
|
353 |
foreach ( $months as $arc_row ) {
|
@@ -366,6 +367,7 @@ class WCV_Admin_Page extends WP_List_Table
|
|
366 |
}
|
367 |
?>
|
368 |
</select>
|
|
|
369 |
<?php
|
370 |
}
|
371 |
|
@@ -379,7 +381,7 @@ class WCV_Admin_Page extends WP_List_Table
|
|
379 |
*/
|
380 |
function status_dropdown( $post_type )
|
381 |
{
|
382 |
-
$com_status = isset( $
|
383 |
?>
|
384 |
<select name="com_status">
|
385 |
<option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wcvendors' ); ?></option>
|
@@ -398,9 +400,9 @@ class WCV_Admin_Page extends WP_List_Table
|
|
398 |
*/
|
399 |
function process_bulk_action()
|
400 |
{
|
401 |
-
if ( !isset( $
|
402 |
|
403 |
-
$items = array_map( 'intval', $
|
404 |
$ids = implode( ',', $items );
|
405 |
|
406 |
switch ( $this->current_action() ) {
|
@@ -527,9 +529,10 @@ class WCV_Admin_Page extends WP_List_Table
|
|
527 |
*/
|
528 |
$sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
|
529 |
|
530 |
-
if ( !empty( $
|
531 |
-
|
532 |
-
$
|
|
|
533 |
|
534 |
$time_sql = "
|
535 |
WHERE MONTH(`time`) = '$month'
|
@@ -539,19 +542,18 @@ class WCV_Admin_Page extends WP_List_Table
|
|
539 |
$sql .= $time_sql;
|
540 |
}
|
541 |
|
542 |
-
if ( !empty( $
|
543 |
|
544 |
if ( $time_sql == '' ) {
|
545 |
$status_sql = "
|
546 |
-
|
547 |
";
|
548 |
} else {
|
549 |
$status_sql = "
|
550 |
-
|
551 |
";
|
552 |
}
|
553 |
|
554 |
-
|
555 |
$sql .= $status_sql;
|
556 |
}
|
557 |
|
@@ -561,20 +563,24 @@ class WCV_Admin_Page extends WP_List_Table
|
|
561 |
SELECT * FROM {$wpdb->prefix}pv_commission
|
562 |
";
|
563 |
|
564 |
-
if ( !empty( $
|
565 |
$sql .= $time_sql;
|
566 |
}
|
567 |
|
568 |
-
if ( !empty( $
|
569 |
$sql .= $status_sql;
|
570 |
}
|
571 |
|
|
|
|
|
|
|
572 |
$sql .= "
|
573 |
ORDER BY `{$orderby}` {$order}
|
574 |
-
LIMIT
|
575 |
";
|
576 |
|
577 |
-
$this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
|
|
|
578 |
|
579 |
/**
|
580 |
* Pagination
|
132 |
<div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
|
133 |
<h2><?php _e( 'Commission', 'wcvendors' ); ?></h2>
|
134 |
|
135 |
+
<form id="posts-filter" method="get">
|
136 |
|
137 |
<input type="hidden" name="page" value="pv_admin_commissions"/>
|
138 |
<?php $PV_Admin_Page->display() ?>
|
315 |
<div class="alignleft actions"><?php
|
316 |
$this->status_dropdown( 'commission' );
|
317 |
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
318 |
+
?></div>
|
319 |
+
<?php
|
320 |
}
|
321 |
}
|
322 |
|
346 |
if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
|
347 |
return;
|
348 |
|
349 |
+
$m = isset( $_GET[ 'm' ] ) ? (int) $_GET[ 'm' ] : 0;
|
350 |
?>
|
351 |
+
<select name="m" id="filter-by-date">
|
352 |
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
|
353 |
<?php
|
354 |
foreach ( $months as $arc_row ) {
|
367 |
}
|
368 |
?>
|
369 |
</select>
|
370 |
+
|
371 |
<?php
|
372 |
}
|
373 |
|
381 |
*/
|
382 |
function status_dropdown( $post_type )
|
383 |
{
|
384 |
+
$com_status = isset( $_GET[ 'com_status' ] ) ? $_GET[ 'com_status' ] : '';
|
385 |
?>
|
386 |
<select name="com_status">
|
387 |
<option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wcvendors' ); ?></option>
|
400 |
*/
|
401 |
function process_bulk_action()
|
402 |
{
|
403 |
+
if ( !isset( $_GET[ 'id' ] ) ) return;
|
404 |
|
405 |
+
$items = array_map( 'intval', $_GET[ 'id' ] );
|
406 |
$ids = implode( ',', $items );
|
407 |
|
408 |
switch ( $this->current_action() ) {
|
529 |
*/
|
530 |
$sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
|
531 |
|
532 |
+
if ( !empty( $_GET[ 'm' ] ) ) {
|
533 |
+
|
534 |
+
$year = substr( $_GET[ 'm' ], 0, 4 );
|
535 |
+
$month = substr( $_GET[ 'm' ], 4, 2 );
|
536 |
|
537 |
$time_sql = "
|
538 |
WHERE MONTH(`time`) = '$month'
|
542 |
$sql .= $time_sql;
|
543 |
}
|
544 |
|
545 |
+
if ( !empty( $_GET[ 'com_status' ] ) ) {
|
546 |
|
547 |
if ( $time_sql == '' ) {
|
548 |
$status_sql = "
|
549 |
+
WHERE status = '$com_status'
|
550 |
";
|
551 |
} else {
|
552 |
$status_sql = "
|
553 |
+
AND status = '$com_status'
|
554 |
";
|
555 |
}
|
556 |
|
|
|
557 |
$sql .= $status_sql;
|
558 |
}
|
559 |
|
563 |
SELECT * FROM {$wpdb->prefix}pv_commission
|
564 |
";
|
565 |
|
566 |
+
if ( !empty( $_GET[ 'm' ] ) ) {
|
567 |
$sql .= $time_sql;
|
568 |
}
|
569 |
|
570 |
+
if ( !empty( $_GET['com_status'] ) ) {
|
571 |
$sql .= $status_sql;
|
572 |
}
|
573 |
|
574 |
+
$offset = ( $current_page - 1 ) * $per_page;
|
575 |
+
|
576 |
+
|
577 |
$sql .= "
|
578 |
ORDER BY `{$orderby}` {$order}
|
579 |
+
LIMIT {$offset}, {$per_page}
|
580 |
";
|
581 |
|
582 |
+
// $this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
|
583 |
+
$this->items = $wpdb->get_results( $sql );
|
584 |
|
585 |
/**
|
586 |
* Pagination
|
classes/admin/class-admin-users.php
CHANGED
@@ -35,13 +35,15 @@ class WCV_Admin_Users
|
|
35 |
|
36 |
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
|
37 |
|
38 |
-
|
39 |
// WC > Product page fixes
|
40 |
add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
|
41 |
add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
|
42 |
add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
|
43 |
|
44 |
-
|
|
|
|
|
|
|
45 |
add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
|
46 |
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
|
47 |
add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99, 2 );
|
@@ -215,17 +217,37 @@ class WCV_Admin_Users
|
|
215 |
/**
|
216 |
* Show attachments only belonging to vendor
|
217 |
*
|
218 |
-
* @param object $
|
219 |
*/
|
220 |
-
function
|
221 |
-
{
|
222 |
-
global $current_user, $pagenow;
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
/**
|
231 |
* Allow vendors to access admin when disabled
|
35 |
|
36 |
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
|
37 |
|
|
|
38 |
// WC > Product page fixes
|
39 |
add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
|
40 |
add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
|
41 |
add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
|
42 |
|
43 |
+
// Filter user attachments so they only see their own attachements
|
44 |
+
add_action( 'ajax_query_attachments_args', array( $this, 'show_user_attachment_ajax' ) );
|
45 |
+
add_filter( 'parse_query', array( $this, 'show_user_attachment_page' ) );
|
46 |
+
|
47 |
add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
|
48 |
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
|
49 |
add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99, 2 );
|
217 |
/**
|
218 |
* Show attachments only belonging to vendor
|
219 |
*
|
220 |
+
* @param object $query
|
221 |
*/
|
222 |
+
function show_user_attachment_ajax ( $query ) {
|
|
|
|
|
223 |
|
224 |
+
$user_id = get_current_user_id();
|
225 |
+
if ( $user_id ) {
|
226 |
+
$query['author'] = $user_id;
|
227 |
+
}
|
228 |
+
return $query;
|
229 |
}
|
230 |
|
231 |
+
/**
|
232 |
+
* Show attachments only belonging to vendor
|
233 |
+
*
|
234 |
+
* @param object $query
|
235 |
+
*/
|
236 |
+
function show_user_attachment_page ( $query ) {
|
237 |
+
|
238 |
+
global $current_user, $pagenow;
|
239 |
+
|
240 |
+
if ( !is_a( $current_user, 'WP_User') )
|
241 |
+
return;
|
242 |
+
|
243 |
+
if ( 'upload.php' != $pagenow && 'media-upload.php' != $pagenow)
|
244 |
+
return;
|
245 |
+
|
246 |
+
if ( !current_user_can('delete_pages') )
|
247 |
+
$query->set('author', $current_user->ID );
|
248 |
+
|
249 |
+
return;
|
250 |
+
}
|
251 |
|
252 |
/**
|
253 |
* Allow vendors to access admin when disabled
|
classes/admin/emails/class-emails.php
CHANGED
@@ -78,10 +78,9 @@ class WCV_Emails
|
|
78 |
*/
|
79 |
function show_vendor_in_email( $name, $_product )
|
80 |
{
|
81 |
-
$product = get_post( $_product->id );
|
82 |
-
|
83 |
$sold_by = WCV_Vendors::is_vendor( $product->post_author )
|
84 |
-
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::
|
85 |
: get_bloginfo( 'name' );
|
86 |
|
87 |
$name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small><br />';
|
78 |
*/
|
79 |
function show_vendor_in_email( $name, $_product )
|
80 |
{
|
81 |
+
$product = get_post( $_product->id );
|
|
|
82 |
$sold_by = WCV_Vendors::is_vendor( $product->post_author )
|
83 |
+
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::get_vendor_sold_by( $product->post_author ) )
|
84 |
: get_bloginfo( 'name' );
|
85 |
|
86 |
$name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small><br />';
|
classes/admin/emails/class-wc-notify-vendor.php
CHANGED
@@ -99,8 +99,10 @@ class WC_Email_Notify_Vendor extends WC_Email
|
|
99 |
*/
|
100 |
function check_order_totals( $total_rows, $order )
|
101 |
{
|
|
|
|
|
102 |
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
103 |
-
$return[ 'cart_subtotal' ][ 'label' ] =
|
104 |
|
105 |
$dues = WCV_Vendors::get_vendor_dues_from_order( $order );
|
106 |
|
99 |
*/
|
100 |
function check_order_totals( $total_rows, $order )
|
101 |
{
|
102 |
+
|
103 |
+
$commission_label = apply_filters('wcv_notify_vendor_commission_label', __( 'Commission Subtotal:', 'wcvendors' ) ) ;
|
104 |
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
105 |
+
$return[ 'cart_subtotal' ][ 'label' ] = $commission_label;
|
106 |
|
107 |
$dues = WCV_Vendors::get_vendor_dues_from_order( $order );
|
108 |
|
classes/admin/settings/sf-options.php
CHANGED
@@ -78,6 +78,20 @@ $options[ ] = array(
|
|
78 |
'std' => false,
|
79 |
);
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
$options[ ] = array( 'name' => __( 'Products', 'wcvendors' ), 'type' => 'heading' );
|
82 |
$options[ ] = array( 'name' => __( 'Product Add Page', 'wcvendors' ), 'type' => 'title', 'desc' => __( 'Configure what to hide from all vendors when adding a product', 'wcvendors' ) );
|
83 |
|
78 |
'std' => false,
|
79 |
);
|
80 |
|
81 |
+
$options[ ] = array(
|
82 |
+
'name' => __( 'Vendor Display Name', 'wcvendors' ),
|
83 |
+
'desc' => __( 'Select what will be displayed for the sold by text throughout the store.', 'wcvendors' ),
|
84 |
+
'id' => 'vendor_display_name',
|
85 |
+
'type' => 'select',
|
86 |
+
'options' => array(
|
87 |
+
'display_name' => __( 'Display Name', 'wcvendors'),
|
88 |
+
'shop_name' => __( 'Shop Name', 'wcvendors'),
|
89 |
+
'user_login' => __( 'User Login', 'wcvendors'),
|
90 |
+
),
|
91 |
+
'std' => 'shop_name'
|
92 |
+
|
93 |
+
);
|
94 |
+
|
95 |
$options[ ] = array( 'name' => __( 'Products', 'wcvendors' ), 'type' => 'heading' );
|
96 |
$options[ ] = array( 'name' => __( 'Product Add Page', 'wcvendors' ), 'type' => 'title', 'desc' => __( 'Configure what to hide from all vendors when adding a product', 'wcvendors' ) );
|
97 |
|
classes/class-shipping.php
CHANGED
@@ -63,7 +63,7 @@ class WCV_Shipping
|
|
63 |
// $shipping_due = WCV_Shipping::trs2_get_due( $order_id, $product[ 'product_id' ] );
|
64 |
|
65 |
// Per Product Shipping 2
|
66 |
-
} else if ( function_exists( 'woocommerce_per_product_shipping' ) && $method == 'per_product' ) {
|
67 |
$shipping_due = WCV_Shipping::pps_get_due( $order_id, $product );
|
68 |
|
69 |
// Local Delivery
|
@@ -101,7 +101,7 @@ class WCV_Shipping
|
|
101 |
*
|
102 |
* @return unknown
|
103 |
*/
|
104 |
-
public function pps_get_due( $order_id, $product )
|
105 |
{
|
106 |
global $woocommerce;
|
107 |
|
63 |
// $shipping_due = WCV_Shipping::trs2_get_due( $order_id, $product[ 'product_id' ] );
|
64 |
|
65 |
// Per Product Shipping 2
|
66 |
+
} else if ( ( class_exists('WC_Shipping_Per_Product_Init') || function_exists( 'woocommerce_per_product_shipping' ) ) && $method == 'per_product' ) {
|
67 |
$shipping_due = WCV_Shipping::pps_get_due( $order_id, $product );
|
68 |
|
69 |
// Local Delivery
|
101 |
*
|
102 |
* @return unknown
|
103 |
*/
|
104 |
+
public static function pps_get_due( $order_id, $product )
|
105 |
{
|
106 |
global $woocommerce;
|
107 |
|
classes/class-vendors.php
CHANGED
@@ -259,8 +259,8 @@ class WCV_Vendors
|
|
259 |
*/
|
260 |
public static function get_vendor_from_product( $product_id )
|
261 |
{
|
262 |
-
// Make sure we are returning an author for products only
|
263 |
-
if ( 'product' === get_post_type( $product_id ) ) {
|
264 |
$parent = get_post_ancestors( $product_id );
|
265 |
if ( $parent ) $product_id = $parent[ 0 ];
|
266 |
|
@@ -415,4 +415,24 @@ class WCV_Vendors
|
|
415 |
|
416 |
}
|
417 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
}
|
259 |
*/
|
260 |
public static function get_vendor_from_product( $product_id )
|
261 |
{
|
262 |
+
// Make sure we are returning an author for products or product variations only
|
263 |
+
if ( 'product' === get_post_type( $product_id ) || 'product_variation' === get_post_type( $product_id ) ) {
|
264 |
$parent = get_post_ancestors( $product_id );
|
265 |
if ( $parent ) $product_id = $parent[ 0 ];
|
266 |
|
415 |
|
416 |
}
|
417 |
|
418 |
+
public static function get_vendor_sold_by( $vendor_id ){
|
419 |
+
|
420 |
+
$vendor_display_name = WC_Vendors::$pv_options->get_option( 'vendor_display_name' );
|
421 |
+
$vendor = get_userdata( $vendor_id );
|
422 |
+
|
423 |
+
switch ($vendor_display_name) {
|
424 |
+
case 'display_name':
|
425 |
+
$display_name = $vendor->display_name;
|
426 |
+
break;
|
427 |
+
case 'user_login':
|
428 |
+
$display_name = $vendor->user_login;
|
429 |
+
break;
|
430 |
+
default:
|
431 |
+
$display_name = WCV_Vendors::get_vendor_shop_name( $vendor_id );
|
432 |
+
break;
|
433 |
+
}
|
434 |
+
|
435 |
+
return $display_name;
|
436 |
+
}
|
437 |
+
|
438 |
}
|
classes/front/class-vendor-cart.php
CHANGED
@@ -32,9 +32,9 @@ class WCV_Vendor_Cart
|
|
32 |
*/
|
33 |
public static function sold_by( $values, $cart_item )
|
34 |
{
|
35 |
-
$
|
36 |
-
$sold_by = WCV_Vendors::is_vendor( $
|
37 |
-
? sprintf( '<a href="%s" target="_TOP">%s</a>', WCV_Vendors::get_vendor_shop_page( $
|
38 |
: get_bloginfo( 'name' );
|
39 |
|
40 |
$values[ ] = array(
|
@@ -51,10 +51,9 @@ class WCV_Vendor_Cart
|
|
51 |
*/
|
52 |
public static function sold_by_meta()
|
53 |
{
|
54 |
-
$
|
55 |
-
|
56 |
-
|
57 |
-
? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $author_id ), WCV_Vendors::get_vendor_shop_name( $author_id ) )
|
58 |
: get_bloginfo( 'name' );
|
59 |
|
60 |
echo apply_filters('wcvendors_cart_sold_by_meta', __( 'Sold by: ', 'wcvendors' )) . $sold_by . '<br/>';
|
32 |
*/
|
33 |
public static function sold_by( $values, $cart_item )
|
34 |
{
|
35 |
+
$vendor_id = $cart_item[ 'data' ]->post->post_author;
|
36 |
+
$sold_by = WCV_Vendors::is_vendor( $vendor_id )
|
37 |
+
? sprintf( '<a href="%s" target="_TOP">%s</a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
|
38 |
: get_bloginfo( 'name' );
|
39 |
|
40 |
$values[ ] = array(
|
51 |
*/
|
52 |
public static function sold_by_meta()
|
53 |
{
|
54 |
+
$vendor_id = get_the_author_meta( 'ID' );
|
55 |
+
$sold_by = WCV_Vendors::is_vendor( $vendor_id )
|
56 |
+
? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
|
|
|
57 |
: get_bloginfo( 'name' );
|
58 |
|
59 |
echo apply_filters('wcvendors_cart_sold_by_meta', __( 'Sold by: ', 'wcvendors' )) . $sold_by . '<br/>';
|
classes/front/class-vendor-shop.php
CHANGED
@@ -171,9 +171,9 @@ class WCV_Vendor_Shop
|
|
171 |
Adding sold by to product loop
|
172 |
*/
|
173 |
public static function template_loop_sold_by($product_id) {
|
174 |
-
$
|
175 |
-
$sold_by = WCV_Vendors::is_vendor( $
|
176 |
-
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $
|
177 |
: get_bloginfo( 'name' );
|
178 |
echo '<small class="wcvendors_sold_by_in_loop">' . apply_filters('wcvendors_sold_by_in_loop', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small> <br />';
|
179 |
}
|
@@ -259,7 +259,7 @@ class WCV_Vendor_Shop
|
|
259 |
*/
|
260 |
public static function add_vendor_to_order_item_meta( $item_id, $cart_item) {
|
261 |
$vendor_id = $cart_item[ 'data' ]->post->post_author;
|
262 |
-
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::
|
263 |
wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('Sold by', 'wcvendors')), $sold_by);
|
264 |
}
|
265 |
|
171 |
Adding sold by to product loop
|
172 |
*/
|
173 |
public static function template_loop_sold_by($product_id) {
|
174 |
+
$vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
|
175 |
+
$sold_by = WCV_Vendors::is_vendor( $vendor_id )
|
176 |
+
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
|
177 |
: get_bloginfo( 'name' );
|
178 |
echo '<small class="wcvendors_sold_by_in_loop">' . apply_filters('wcvendors_sold_by_in_loop', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small> <br />';
|
179 |
}
|
259 |
*/
|
260 |
public static function add_vendor_to_order_item_meta( $item_id, $cart_item) {
|
261 |
$vendor_id = $cart_item[ 'data' ]->post->post_author;
|
262 |
+
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' );
|
263 |
wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('Sold by', 'wcvendors')), $sold_by);
|
264 |
}
|
265 |
|
classes/front/dashboard/class-vendor-dashboard.php
CHANGED
@@ -159,8 +159,8 @@ class WCV_Vendor_Dashboard
|
|
159 |
$can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
160 |
$settings_page = get_permalink( WC_Vendors::$pv_options->get_option( 'shop_settings_page' ) );
|
161 |
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
162 |
-
|
163 |
-
|
164 |
|
165 |
if ( !$this->can_view_vendor_page() ) {
|
166 |
return false;
|
159 |
$can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
160 |
$settings_page = get_permalink( WC_Vendors::$pv_options->get_option( 'shop_settings_page' ) );
|
161 |
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
162 |
+
$submit_link = ( $can_submit ) ? admin_url( 'post-new.php?post_type=product' ) : '';
|
163 |
+
$edit_link = ( $can_submit ) ? admin_url( 'edit.php?post_type=product' ) : '';
|
164 |
|
165 |
if ( !$this->can_view_vendor_page() ) {
|
166 |
return false;
|
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.0
|
8 |
Tested up to: 4.1.1
|
9 |
-
Stable tag: 1.6.
|
10 |
License: GPLv2 or later
|
11 |
|
12 |
The free multi-vendor plugin for WooCommerce. Now you can allow anyone to open a store on your site!
|
@@ -58,6 +58,20 @@ No Upgrade required at this time.
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
= Version 1.6.0 - April 8th 2015 =
|
62 |
|
63 |
* Added: Admin notices for vendor page slug & permalinks
|
6 |
Plugin URI: http://www.wcvendors.com/
|
7 |
Requires at least: 4.0
|
8 |
Tested up to: 4.1.1
|
9 |
+
Stable tag: 1.6.2
|
10 |
License: GPLv2 or later
|
11 |
|
12 |
The free multi-vendor plugin for WooCommerce. Now you can allow anyone to open a store on your site!
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= Version 1.6.2 - April 17th 2015 =
|
62 |
+
|
63 |
+
* Added: Option to change sold by vendor name #106
|
64 |
+
* Fixed: Error notice in vendor dashboard #133
|
65 |
+
* Fixed: Pagination in commissions admin screen #68
|
66 |
+
* Added: Support for WooCommerce Order Status Manager
|
67 |
+
* Fixed: Updated media filter method for vendors #132
|
68 |
+
* Fixed: Commission not logged for variations #131
|
69 |
+
|
70 |
+
= Version 1.6.1 - April 10th 2015 =
|
71 |
+
|
72 |
+
* Fixed: Support for Per Product Shipping 2.2.x #126
|
73 |
+
* Added: Filter to change commission label in vendor email #127
|
74 |
+
|
75 |
= Version 1.6.0 - April 8th 2015 =
|
76 |
|
77 |
* Added: Admin notices for vendor page slug & permalinks
|