Clear prices transient for variable products after scheduled sale.
This commit is contained in:
parent
d2ed9c0b0b
commit
e2139a5c5e
|
@ -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 );
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -271,7 +271,7 @@ final class WooCommerce {
|
|||
include_once( 'includes/class-wc-integrations.php' ); // Loads integrations
|
||||
include_once( 'includes/class-wc-cache-helper.php' ); // Cache Helper
|
||||
include_once( 'includes/class-wc-https.php' ); // https Helper
|
||||
|
||||
|
||||
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
||||
include_once( 'includes/class-wc-cli.php' );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue