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
|
// 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 );
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue