Clear prices transient for variable products after scheduled sale.

This commit is contained in:
Mike Jolley 2016-03-31 12:03:03 +01:00
parent d2ed9c0b0b
commit e2139a5c5e
3 changed files with 3 additions and 6 deletions

View File

@ -386,8 +386,8 @@ function wc_scheduled_sales() {
// Sync parent
if ( $parent ) {
// We can force variable product prices to sync up by removing their min price meta
delete_post_meta( $parent, '_min_price_variation_id' );
// Clear prices transient for variable products.
delete_transient( 'wc_var_prices_' . $parent );
// Grouped products need syncing via a function
$this_product = wc_get_product( $product_id );

View File

@ -133,9 +133,6 @@ class WC_Helper_Product {
// Attribute meta
update_post_meta( $variation_id, 'attribute_pa_size', 'small' );
// Add the variation meta to the main product
update_post_meta( $product_id, '_min_price_variation_id', $variation_id );
// Create the variation
$variation_id = wp_insert_post( array(
'post_title' => 'Variation #' . ( $product_id + 2 ) . ' of Dummy Product',