• Resolved devnet22

    (@devnet22)


    Hello,
    I am setting the sale price and dates of sale price with this code snippet:

    $product = wc_get_product($post_id);
                
                if ( !is_wp_error( $product ) ) {
                    $product->set_sale_price( $c->Price );
                    $product->set_date_on_sale_from( date( 'Y-m-d 00:00:00', strtotime($c->FromDate)) );
                    $product->set_date_on_sale_to( date( 'Y-m-d 23:59:59', strtotime($c->FinalDate)) );
                }
                
                $product->save();

    But the problem is that timers are not showing unless I click the Update button in Woocommerce back end manually. Why is that?

Viewing 1 replies (of 1 total)
  • Hi,

    Please make sure you set countdown timer profile in the sale schedule of the product.
    In addition, we do not offer support custom code, so let us know only when you are stuck with our available settings of the plugin.

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Product needs update by button to show dates’ is closed to new replies.