Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
devAsadNur committed Oct 24, 2024
2 parents 50f9238 + e23dab5 commit 3b33a45
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 37 deletions.
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
====== Changelog ======

v1.2.3 -> 23 Oct 2024
------------------------
- **Update:** WordPress v6.6.2 compatibility
- **Update:** PDF Invoices & Packing Slips for WooCommerce v3.9.0 compatibility
- **Update:** Rewrite dokan store name adding implementation
- **Fix:** Dependency error with PDF Invoices for WooCommerce v3.9.0 on plugin activation

v1.2.2 -> 16 Sep 2023
------------------------
- **Update:** WordPress 6.3.1 compatibility
Expand Down
44 changes: 29 additions & 15 deletions dokan-invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
* Plugin Name: Dokan - PDF Invoice
* Plugin URI: https://dokan.co/wordpress/
* Description: A Dokan plugin Add-on to get PDF invoice.
* Version: 1.2.2
* Version: 1.2.3
* Author: weDevs
* Author URI: https://dokan.co/
* License: GPL2
* Text Domain: dokan-invoice
* WC requires at least: 5.0.0
* WC tested up to: 8.1.0
* WC requires at least: 8.0.0
* WC tested up to: 9.3.3
* Requires Plugins: woocommerce, dokan-lite, woocommerce-pdf-invoices-packing-slips
*/

/**
Expand Down Expand Up @@ -56,6 +57,15 @@ class Dokan_Invoice {
private $depends_on = array();
private $dependency_error = array();

/**
* WC PDF Plugin Class Name.
*
* @since 1.2.3
*
* @var string
*/
public $wc_pdf_class = '';

/**
* Constructor for the Dokan_Invoice class
*
Expand All @@ -72,14 +82,16 @@ public function __construct() {
self::$plugin_url = plugin_dir_url( self::$plugin_basename );
self::$plugin_path = trailingslashit( dirname( __FILE__ ) );

$this->wc_pdf_class = version_compare( get_option( 'wpo_wcpdf_version', false ), '3.9.0', '<' ) ? 'WooCommerce_PDF_Invoices' : 'WPO_WCPDF' ;

$this->depends_on['dokan'] = array(
'name' => 'WeDevs_Dokan',
'notice' => sprintf( __( '<b>Dokan PDF Invoice </b> requires %sDokan plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://dokan.co/wordpress/">', '</a>' ),
'name' => 'WeDevs_Dokan',
'notice' => sprintf( esc_html__( '<b>Dokan PDF Invoice </b> requires %sDokan plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://dokan.co/wordpress/">', '</a>' ),
);

$this->depends_on['woocommerce_pdf_invoices'] = array(
'name' => 'WooCommerce_PDF_Invoices',
'notice' => sprintf( __( '<b>Dokan PDF Invoice </b> requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/">', '</a>' ),
'name' => $this->wc_pdf_class,
'notice' => sprintf( esc_html__( '<b>Dokan PDF Invoice </b> requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/">', '</a>' ),
);

add_action( 'before_woocommerce_init', [ $this, 'add_hpos_support' ] );
Expand Down Expand Up @@ -161,7 +173,7 @@ public static function init() {
* @return void
*/
public function init_hooks() {
if ( ! class_exists( 'WooCommerce_PDF_Invoices' ) ) {
if ( ! class_exists( $this->wc_pdf_class ) ) {
return ;
}

Expand Down Expand Up @@ -224,6 +236,8 @@ public function dokan_invoice_listing_actions_my_account( $actions, $order ) {
public function wpo_wcpdf_add_dokan_shop_name( $shop_name, $document = null ) {
extract( $this->get_order_id_parent_id( $document ) );

$shop_name_label = apply_filters( 'dokan_invoice_shop_name_label', esc_html__( 'Vendor', 'dokan-invoice' ), $document );

// If parent order keep Original Store name else set seller store name
if ( $parent_id == 0 ) {
if ( function_exists( 'dokan_get_seller_ids_by' ) ) {
Expand All @@ -232,24 +246,24 @@ public function wpo_wcpdf_add_dokan_shop_name( $shop_name, $document = null ) {
$seller_list = array_unique( array_keys( dokan_get_sellers_by( $order_id ) ) );
}

if ( count( $seller_list ) > 1 ) {
return $shop_name;
} else {
if ( 1 === count( $seller_list ) ) {
$vendor_id = $seller_list[0];
$vendor = dokan()->vendor->get( $vendor_id );
$store_name = $vendor->get_shop_name();
$store_name = ! empty( $store_name ) ? $store_name : __( 'store_info', 'dokan-invoice' );
$store_name = $store_name ?: '';

return $shop_name . "<br /><br />" . __( 'Vendor:', 'dokan-invoice' ) . $store_name;
$shop_name .= sprintf( '<br/><br/>%s: %s', $shop_name_label, $store_name );
}
} else {
$vendor_id = dokan_get_seller_id_by_order( $order_id );
$vendor = dokan()->vendor->get( $vendor_id );
$store_name = $vendor->get_shop_name();
$store_name = ! empty( $store_name ) ? $store_name : __( 'store_info', 'dokan-invoice' );
$store_name = $store_name ?: '';

return $shop_name . "<br /><br />" . __( 'Vendor:', 'dokan-invoice' ) . $store_name;
$shop_name .= sprintf( '<br/><br/>%s: %s', $shop_name_label, $store_name );
}

return apply_filters( 'dokan_invoice_store_name', $shop_name, $document );
}

/**
Expand Down
32 changes: 18 additions & 14 deletions languages/dokan-invoice.pot
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# Copyright (C) 2023 weDevs
# Copyright (C) 2024 weDevs
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: Dokan - PDF Invoice 1.2.2\n"
"Project-Id-Version: Dokan - PDF Invoice 1.2.3\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2023-09-16 14:52:26+00:00\n"
"POT-Creation-Date: 2024-10-23 09:43:19+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: dokan-invoice.php:77
#: dokan-invoice.php:89
msgid ""
"<b>Dokan PDF Invoice </b> requires %sDokan plugin%s to be installed & "
"activated!"
msgstr ""

#: dokan-invoice.php:82
#: dokan-invoice.php:94
msgid ""
"<b>Dokan PDF Invoice </b> requires %sWooCommerce PDF Invoices & packing "
"slips plugin%s to be installed & activated!"
msgstr ""

#: dokan-invoice.php:241 dokan-invoice.php:249 dokan-invoice.php:283
msgid "store_info"
#: dokan-invoice.php:239
msgid "Vendor"
msgstr ""

#: dokan-invoice.php:243 dokan-invoice.php:251
msgid "Vendor:"
#: dokan-invoice.php:293
msgid "From vendors:"
msgstr ""

#: dokan-invoice.php:279
msgid "From vendors:"
#: dokan-invoice.php:297
msgid "store_info"
msgstr ""

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

#. Author URI of the plugin/theme
msgid "https://wedevs.com/"
#. Plugin URI of the plugin/theme
msgid "https://dokan.co/wordpress/"
msgstr ""

#. Description of the plugin/theme
Expand All @@ -51,4 +51,8 @@ msgstr ""

#. Author of the plugin/theme
msgid "weDevs"
msgstr ""

#. Author URI of the plugin/theme
msgid "https://dokan.co/"
msgstr ""
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.2.2",
"version": "1.2.3",
"slug": "dokan-invoice",
"description": "Dokan Invoice add-on",
"author": "Tareq Hasan",
Expand Down
17 changes: 12 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Contributors: tareq1988, wedevs, nizamuddinbabu
Donate Link: http://tareq.co/donate/
Tags: WooCommerce, Multi seller, Multi vendor, Dokan, Invoice, PDF
Requires at least: 4.7
Tested up to: 6.3.1
WC requires at least: 5.0.0
WC tested up to: 8.1.0
Stable tag: 1.2.2
Requires at least: 6.4
Tested up to: 6.6.2
WC requires at least: 8.0.0
WC tested up to: 9.3.3
Stable tag: 1.2.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -55,6 +55,13 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove

== Changelog ==

v1.2.3 -> 23 Oct 2024
------------------------
- **Update:** WordPress v6.6.2 compatibility
- **Update:** PDF Invoices & Packing Slips for WooCommerce v3.9.0 compatibility
- **Update:** Rewrite dokan store name adding implementation
- **Fix:** Dependency error with PDF Invoices for WooCommerce v3.9.0 on plugin activation

v1.2.2 -> 16 Sep 2023
------------------------
- **Update:** WordPress 6.3.1 compatibility
Expand Down

0 comments on commit 3b33a45

Please sign in to comment.