From 8cb2ca86d79b7b8745c481ea160d69a0fd162d62 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 25 Mar 2015 16:23:19 +0000 Subject: [PATCH] Store variation ID in transient --- includes/class-wc-product-variable.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index 4a4935fb681..b1eba5588d7 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -283,14 +283,14 @@ class WC_Product_Variable extends WC_Product { $sale_price = $tax_display_mode == 'incl' ? $variation->get_price_including_tax( 1, $sale_price ) : $variation->get_price_excluding_tax( 1, $sale_price ); } - $prices[] = $price; - $regular_prices[] = $regular_price; - $sale_prices[] = $sale_price; + $prices[ $variation_id ] = $price; + $regular_prices[ $variation_id ] = $regular_price; + $sale_prices[ $variation_id ] = $sale_price; } - sort( $prices ); - sort( $regular_prices ); - sort( $sale_prices ); + asort( $prices ); + asort( $regular_prices ); + asort( $sale_prices ); $prices_array = array( 'price' => $prices,