Skip to content

Commit

Permalink
v2.7.17
Browse files Browse the repository at this point in the history
  • Loading branch information
kousikmukherjee committed May 28, 2024
1 parent 6b09011 commit fc83028
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 12 deletions.
39 changes: 38 additions & 1 deletion includes/shortcodes/class-alg-products-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Product XML Feeds for WooCommerce - Products Shortcodes
*
* @version 2.7.16
* @version 2.7.17
* @since 1.0.0
* @author WPFactory
*/
Expand Down Expand Up @@ -75,6 +75,7 @@ function __construct() {
'alg_product_list_available_variations_for_variable',
'alg_product_list_attributes_hirarchy',
'alg_product_custom_value',
'alg_wc_product_category_hierar_list',
);

$this->the_atts = array(
Expand Down Expand Up @@ -1598,6 +1599,42 @@ function alg_product_custom_value( $atts, $content = ''){
}
return $content;
}

/**
* alg_wc_product_category_hierar_list.
*
* @version 2.7.17
* @since 2.7.17
*/
function alg_wc_product_category_hierar_list( $atts ){
$atts = shortcode_atts( array(
'id' => $this->the_product->get_id(),
), $atts, 'alg_wc_product_category_hierar_list' );

$output = []; // Initialising
$taxonomy = 'product_cat'; // Taxonomy for product category

// Get the product categories terms ids in the product:
$terms_ids = wp_get_post_terms( $atts['id'], $taxonomy, array('fields' => 'ids') );

// Loop though terms ids (product categories)
foreach( $terms_ids as $term_id ) {
$term_names = []; // Initialising category array

// Loop through product category ancestors
foreach( get_ancestors( $term_id, $taxonomy ) as $ancestor_id ){
// Add the ancestors term names to the category array
$term_names[] = get_term( $ancestor_id, $taxonomy )->name;
}
// Add the product category term name to the category array
$term_names[] = get_term( $term_id, $taxonomy )->name;

// Add the formatted ancestors with the product category to main array
$output[] = implode(' > ', $term_names);
}
// Output the formatted product categories with their ancestors
return implode('" | "', $output);
}

}

Expand Down
14 changes: 7 additions & 7 deletions langs/product-xml-feeds-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GNU General Public License v3.0.
msgid ""
msgstr ""
"Project-Id-Version: product-xml-feeds-for-woocommerce 2.7.16\n"
"Project-Id-Version: product-xml-feeds-for-woocommerce 2.7.17\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/product-xml-feeds-for-woocommerce\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-05-01T20:59:57+02:00\n"
"POT-Creation-Date: 2024-05-28T14:49:32+02:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.9.0\n"
"X-Domain: product-xml-feeds-for-woocommerce\n"
Expand Down Expand Up @@ -635,17 +635,17 @@ msgstr ""
msgid "Your settings have been reset."
msgstr ""

#: includes/shortcodes/class-alg-products-shortcodes.php:430
#: includes/shortcodes/class-alg-products-shortcodes.php:487
#: includes/shortcodes/class-alg-products-shortcodes.php:431
#: includes/shortcodes/class-alg-products-shortcodes.php:488
msgid "%s ago"
msgstr ""

#: includes/shortcodes/class-alg-products-shortcodes.php:444
#: includes/shortcodes/class-alg-products-shortcodes.php:501
#: includes/shortcodes/class-alg-products-shortcodes.php:445
#: includes/shortcodes/class-alg-products-shortcodes.php:502
msgid "No sales yet."
msgstr ""

#: includes/shortcodes/class-alg-products-shortcodes.php:525
#: includes/shortcodes/class-alg-products-shortcodes.php:526
msgid "Any"
msgstr ""

Expand Down
6 changes: 3 additions & 3 deletions product-xml-feeds-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Plugin Name: Product XML Feeds for WooCommerce
Plugin URI: https://wpfactory.com/item/product-xml-feeds-woocommerce/
Description: Create your own XML files using tens of preconfigured shortcodes for you on your WooCommerce store
Version: 2.7.16
Version: 2.7.17
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: product-xml-feeds-for-woocommerce
Domain Path: /langs
Copyright: © 2023 WPFactory
WC tested up to: 8.8
WC tested up to: 8.9
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down Expand Up @@ -53,7 +53,7 @@ final class Alg_WC_Product_XML_Feeds {
* @var string
* @since 1.0.0
*/
public $version = '2.7.16';
public $version = '2.7.17';

/**
* @var Alg_WC_Product_XML_Feeds The single instance of the class
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmu
Tags: woocommerce, product xml feeds, xml, export
Requires at least: 4.4
Tested up to: 6.5
Stable tag: 2.7.16
Stable tag: 2.7.17
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -158,6 +158,10 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S

== Changelog ==

= 2.7.17 - 28/05/2024 =
* WC tested up to: 8.9
* Add - new shortcode [alg_wc_product_category_hierar_list]

= 2.7.16 - 01/05/2024 =
* Add - new shortcode [alg_product_custom_value]
* WC tested up to: 8.8
Expand Down

0 comments on commit fc83028

Please sign in to comment.