From 9140ca0f76d1c3b7b605fe020aa866db4a244a6c Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Wed, 5 Aug 2015 11:01:47 +0200 Subject: [PATCH 1/2] added cross and up sells IDs filters --- includes/abstracts/abstract-wc-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index b1b7d688c60..9b1b5f149cc 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -1152,7 +1152,7 @@ class WC_Product { * @return array */ public function get_upsells() { - return (array) maybe_unserialize( $this->upsell_ids ); + return apply_filters( 'woocommerce_up_sells_ids', (array) maybe_unserialize( $this->upsell_ids ) ); } /** @@ -1161,7 +1161,7 @@ class WC_Product { * @return array */ public function get_cross_sells() { - return (array) maybe_unserialize( $this->crosssell_ids ); + return apply_filters( 'woocommerce_cross_sells_ids', (array) maybe_unserialize( $this->crosssell_ids ) ); } /** From 9822edda0bf23dabe7a07ef26308429b653a1ff0 Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Wed, 5 Aug 2015 13:54:20 +0200 Subject: [PATCH 2/2] better naming --- includes/abstracts/abstract-wc-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index 9b1b5f149cc..fd60879e001 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -1152,7 +1152,7 @@ class WC_Product { * @return array */ public function get_upsells() { - return apply_filters( 'woocommerce_up_sells_ids', (array) maybe_unserialize( $this->upsell_ids ) ); + return apply_filters( 'woocommerce_product_upsell_ids', (array) maybe_unserialize( $this->upsell_ids ) ); } /** @@ -1161,7 +1161,7 @@ class WC_Product { * @return array */ public function get_cross_sells() { - return apply_filters( 'woocommerce_cross_sells_ids', (array) maybe_unserialize( $this->crosssell_ids ) ); + return apply_filters( 'woocommerce_product_crosssell_ids', (array) maybe_unserialize( $this->crosssell_ids ) ); } /**