Advertisement
vapvarun

Display requirements after Product Description

Jun 26th, 2020
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. add_action( 'edd_after_price_options', 'edd_sell_service_question_delivery');
  2. function edd_sell_service_question_delivery(){
  3.     if ( is_single() ) {
  4.         $estimate_time = get_post_meta( get_the_ID(), 'estimate_time', true);
  5.         $product_requirement = get_field( "edd_services_requirement_data", get_the_ID() );
  6.         echo "Estimate Delivery Time: " . $estimate_time .  ( ( $estimate_time > 1) ? ' Days' : ' Day' ) ;
  7.         if (!empty($product_requirement)) {
  8.             echo "<ul>";
  9.             foreach( $product_requirement as $requirement ) {
  10.                 echo "<li>";
  11.                 echo $requirement['edd_question'];
  12.                 echo "</li>";
  13.             }
  14.             echo "</ul>";          
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement