Estimated Delivery for Products woocommerce

Viewed 16

I need help. I created an additional field in ACF - data_dostawy which I am displaying the text. But I would like it to show me the estimated delivery date. I import the products through WP all import. (there are 5k) from several suppliers with different lead times. That's why I can't set one date for everyone. I would like this function to get the value from the delivery_time field and display the delivery date. For example, today is 09/18/2022, the value in the delivery_time field is 2 so it should say "expected delivery on 09/20/2022. Moreover, I would like to exclude Saturdays and Sundays. Please tell me if such a thing is possible? My code

add_action( 'etheme_product_single_custom_html_01', 'shipping_date', 20);
  
function shipping_date() { ?>
 
<?php if(get_field('czas_dostawy')) { ?>
    <div class="sp_czas_dostawy"><?php the_field('czas_dostawy'); ?></div>
<?php }
}
0 Answers
Related