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 // Sync parent
if ( $parent ) { if ( $parent ) {
// We can force variable product prices to sync up by removing their min price meta // Clear prices transient for variable products.
delete_post_meta( $parent, '_min_price_variation_id' ); delete_transient( 'wc_var_prices_' . $parent );
// Grouped products need syncing via a function // Grouped products need syncing via a function
$this_product = wc_get_product( $product_id ); $this_product = wc_get_product( $product_id );

View File

@ -133,9 +133,6 @@ class WC_Helper_Product {
// Attribute meta // Attribute meta
update_post_meta( $variation_id, 'attribute_pa_size', 'small' ); 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 // Create the variation
$variation_id = wp_insert_post( array( $variation_id = wp_insert_post( array(
'post_title' => 'Variation #' . ( $product_id + 2 ) . ' of Dummy Product', 'post_title' => 'Variation #' . ( $product_id + 2 ) . ' of Dummy Product',

View File

@ -271,7 +271,7 @@ final class WooCommerce {
include_once( 'includes/class-wc-integrations.php' ); // Loads integrations include_once( 'includes/class-wc-integrations.php' ); // Loads integrations
include_once( 'includes/class-wc-cache-helper.php' ); // Cache Helper include_once( 'includes/class-wc-cache-helper.php' ); // Cache Helper
include_once( 'includes/class-wc-https.php' ); // https Helper include_once( 'includes/class-wc-https.php' ); // https Helper
if ( defined( 'WP_CLI' ) && WP_CLI ) { if ( defined( 'WP_CLI' ) && WP_CLI ) {
include_once( 'includes/class-wc-cli.php' ); include_once( 'includes/class-wc-cli.php' );
} }