Support

Account

Home Forums General Issues Show Offer for a particular time

Helping

Show Offer for a particular time

  • I want to create a field of date which i can easily make through DATEPICKER field, and assign a offer for a product (without using WOOCOMMERCE). Now is there a way in ACF by which i can show that offer on the product only till the date choosen in DATEPICKER, and that date offer is not shown.
    NOTE:The product should not be removed after the date ends only the offer on the product should hide/end

  • 
    $offer_date = get_field('offer_date');
    // not that this assumes specific date formatting
    // the value returned from above would need to have matching formatting
    $today = date('Y-m-d');
    if ($offer_date < $today) {
      // code to show offer here
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.