From a8adf3a01f9ae25666ebbcc99e92b3b9c43510e9 Mon Sep 17 00:00:00 2001 From: Adam Lipscore Date: Wed, 7 Jan 2026 17:59:35 +0100 Subject: [PATCH] Fix variant category --- README.md | 3 +++ includes/class-lipscore-product-helper.php | 4 +++- lipscore.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9dbaf6..557ab49 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ ## Changelog ## +### 0.6.5 ### +* Fixed category for variant products + ### 0.6.4 ### * Add support for custom attributes in initializer diff --git a/includes/class-lipscore-product-helper.php b/includes/class-lipscore-product-helper.php index b15590b..9b61d4e 100644 --- a/includes/class-lipscore-product-helper.php +++ b/includes/class-lipscore-product-helper.php @@ -22,8 +22,10 @@ public function product_data( $product ) { $product_id = $this->product_id($parent); $variant_name = $product->get_name(); $variant_id = $product->get_id(); + $category = $this->product_category($parent); } else { $product_id = $this->product_id($product); + $category = $this->product_category($product); } return array( @@ -35,7 +37,7 @@ public function product_data( $product ) { 'image_url' => $this->image_url( $product ), 'price' => $product->get_price(), 'currency' => get_woocommerce_currency(), - 'category' => $this->product_category( $product ), + 'category' => $category, 'gtin' => $this->product_gtin( $product ), 'variant_name' => $variant_name, 'variant_id' => $variant_id diff --git a/lipscore.php b/lipscore.php index 21d9e00..55324b3 100644 --- a/lipscore.php +++ b/lipscore.php @@ -8,7 +8,7 @@ * Plugin Name: Lipscore Ratings and Reviews * Plugin URI: http://lipscore.com/ * Description: Collecting reviews is difficult. Let the most efficient and flexible plugin in the world do it for you. - * Version: 0.6.4 + * Version: 0.6.5 * Author: Lipscore * Author URI: http://lipscore.com/ * Donate link: http://lipscore.com/