Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rafsuntaskin committed Sep 9, 2017
2 parents 759a1ce + 372a78f commit 1cd6e9d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 29 deletions.
17 changes: 17 additions & 0 deletions .svnignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bin
node_modules
assets/src
assets/css/style.css.map
tests
nbproject
Gruntfile.js
package.json
docs.md
changelog.txt
.gitignore
.travis.yml
debug.log
phpunit.xml
.svnignore
README.md
plugin-deploy.sh
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
====== Changelog ======

v1.1.0 -> 9 September 2017
------------------------
- [new] Compatibility with WooCommerce PDF Invoices & packing slips 2.0+
- [fix] showing error on Order action for vendor dashboard

v1.0.3 -> 14 May 2017
------------------------
- [new] Compatibility with WooCommerce 3.0+
Expand Down
42 changes: 25 additions & 17 deletions dokan-invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Dokan - PDF Invoice
Plugin URI: https://wedevs.com/
Description: A Dokan plugin Add-on to get PDF invoice.
Version: 1.0.3
Version: 1.1.0
Author: weDevs
Author URI: https://wedevs.com/
License: GPL2
Expand Down Expand Up @@ -239,16 +239,21 @@ function dokan_invoice_listing_actions_my_account( $actions, $order ) {
function wpo_wcpdf_add_dokan_shop_name( $shop_name ) {

global $wpo_wcpdf;

$order = $wpo_wcpdf->export->order;
$order_id = dokan_get_prop( $order, 'id' );
$parent_id = wp_get_post_parent_id( $order_id );

// If parent order keep Original Store name else set seller store name
if ( $wpo_wcpdf->export->order->post->post_parent == 0 ) {
if ( $parent_id == 0 ) {

if ( function_exists( 'dokan_get_seller_ids_by' ) ) {

$seller_list = dokan_get_seller_ids_by( $wpo_wcpdf->export->order->id );
$seller_list = dokan_get_seller_ids_by( $order_id );

} else {

$seller_list = array_unique( array_keys( dokan_get_sellers_by( $wpo_wcpdf->export->order->id ) ) );
$seller_list = array_unique( array_keys( dokan_get_sellers_by( $order_id ) ) );

}

Expand All @@ -269,7 +274,7 @@ function wpo_wcpdf_add_dokan_shop_name( $shop_name ) {

} else {

$seller_id = $wpo_wcpdf->export->order->post->post_author;
$seller_id = get_post_field( 'post_author' , $order_id );

$store_info = dokan_get_store_info( $seller_id );

Expand All @@ -292,17 +297,21 @@ function wpo_wcpdf_add_dokan_shop_name( $shop_name ) {
*/
function wpo_wcpdf_add_dokan_shop_details( $shop_address ) {
global $wpo_wcpdf;

$order = $wpo_wcpdf->export->order;
$order_id = dokan_get_prop( $order, 'id' );
$parent_id = wp_get_post_parent_id( $order_id );

//If parent order print Store names only after address else Print Seller Store Address
if ( $wpo_wcpdf->export->order->post->post_parent == 0 ) {
if ( $parent_id == 0 ) {

if ( function_exists( 'dokan_get_seller_ids_by' ) ) {

$seller_list = dokan_get_seller_ids_by( $wpo_wcpdf->export->order->id );
$seller_list = dokan_get_seller_ids_by( $order_id );

} else {

$seller_list = array_unique( array_keys( dokan_get_sellers_by( $wpo_wcpdf->export->order->id ) ) );
$seller_list = array_unique( array_keys( dokan_get_sellers_by( $order_id ) ) );

}

Expand Down Expand Up @@ -336,7 +345,7 @@ function wpo_wcpdf_add_dokan_shop_details( $shop_address ) {

} else {

$seller_id = $wpo_wcpdf->export->order->post->post_author;
$seller_id = get_post_field( 'post_author' , $order_id );

$store_info = dokan_get_store_info( $seller_id );

Expand All @@ -352,14 +361,13 @@ function wpo_wcpdf_add_dokan_shop_details( $shop_address ) {
/**
* Set seller permission true if oreder consists his item
*
* @param type $not_allowed
* @param type $allowed
* @param type $order_ids
* @return boolean
*/
function wpo_wcpdf_dokan_privs( $not_allowed, $order_ids ) {

function wpo_wcpdf_dokan_privs( $allowed, $order_ids ) {
// check if user is seller
if ( $not_allowed && in_array( 'seller', $GLOBALS['current_user']->roles ) ) {
if ( !$allowed && in_array( 'seller', $GLOBALS['current_user']->roles ) ) {

if ( count( $order_ids ) == 1 ) {

Expand All @@ -369,9 +377,9 @@ function wpo_wcpdf_dokan_privs( $not_allowed, $order_ids ) {
$current_user = get_current_user_id();

if ( $current_user == $seller_id ) {
return false; // this seller is allowed
return true; // this seller is allowed
} else {
return true;
return false;
}
}

Expand All @@ -391,9 +399,9 @@ function wpo_wcpdf_dokan_privs( $not_allowed, $order_ids ) {
}
}
// if we got here, that means the user is a seller and all orders and items belong to this seller
return false; // allowed!
return true; // allowed!
} else {
return $not_allowed; // preserve original check result
return $allowed; // preserve original check result
}
}

Expand Down
18 changes: 9 additions & 9 deletions languages/dokan-invoice.pot
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (C) 2017 WeDevs
# Copyright (C) 2017 weDevs
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: Dokan PDF Invoice 1.0.3\n"
"Project-Id-Version: Dokan - PDF Invoice 1.1.0\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-05-14 06:35:18+00:00\n"
"POT-Creation-Date: 2017-09-09 08:50:12+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -29,27 +29,27 @@ msgstr ""
msgid "Download invoice (PDF)"
msgstr ""

#: dokan-invoice.php:265 dokan-invoice.php:276 dokan-invoice.php:317
#: dokan-invoice.php:329 dokan-invoice.php:343
#: dokan-invoice.php:270 dokan-invoice.php:281 dokan-invoice.php:326
#: dokan-invoice.php:338 dokan-invoice.php:352
msgid "store_info"
msgstr ""

#: dokan-invoice.php:311
#: dokan-invoice.php:320
msgid "From vendors:"
msgstr ""

#. Plugin Name of the plugin/theme
msgid "Dokan PDF Invoice"
msgid "Dokan - PDF Invoice"
msgstr ""

#. Author URI of the plugin/theme
msgid "http://wedevs.com/"
msgid "https://wedevs.com/"
msgstr ""

#. Description of the plugin/theme
msgid "A Dokan plugin Add-on to get PDF invoice."
msgstr ""

#. Author of the plugin/theme
msgid "WeDevs"
msgid "weDevs"
msgstr ""
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dokan-Invoice",
"version": "1.0.3",
"version": "1.1.0",
"slug": "dokan-invoice",
"description": "Dokan Invoice add-on",
"author": "Tareq Hasan",
Expand Down
14 changes: 12 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== Dokan Invoice ===
Contributors: tareq1988, wedevs
Contributors: tareq1988, wedevs, rafsuntaskin
Donate link: http://tareq.wedevs.com/donate/
Tags: WooCommerce, Multi seller, Multi vendor, Dokan, Invoice, PDF
Requires at least: 4.7
Expand Down Expand Up @@ -53,6 +53,11 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove

== Changelog ==

v1.1.0 -> 9 September 2017
------------------------
- [new] Compatibility with WooCommerce PDF Invoices & packing slips 2.0+
- [fix] showing error on Order action for vendor dashboard

= 1.0.3 =
------------------------
- [new] Compatibility with WooCommerce 3.0+
Expand All @@ -72,4 +77,9 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove
* [fix] Sellers can download their sales invoice from dashboard order page

= 1.0 =
* Initial Release
* Initial Release

== Upgrade Notice ==

= 1.1.0 =
**Important Update** This update is compatible with WooCommerce PDF Invoices & Packing Slips 2.0+ . Make sure to update to the latest version of **WooCommerce PDF Invoices & Packing Slips** before updating.

0 comments on commit 1cd6e9d

Please sign in to comment.