vapvarun

Display Requirement on single product page : Woo Sell Services

Apr 11th, 2021
634
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'woocommerce_before_add_to_cart_button', 'woo_sell_service_question_delivery');
  2. function woo_sell_service_question_delivery(){
  3.     if ( is_product() ) {
  4.         $estimate_time = get_post_meta( get_the_ID(), 'wbcom_wss_estimate_time', true);
  5.         $product_requirement = get_field( "woo_sell_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.                 //print_r($requirement);
  12.                 echo $requirement['woo_sell_question'];
  13.                 echo "</li>";
  14.             }
  15.             echo "</ul>";          
  16.         }
  17.     }
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×