woocommerce_gzd_service_checkbox

The WooCommerce Germanized woocommerce gzd service checkbox function.

Description

woocommerce_gzd_service_checkbox(); 

Usage

  1. if ( !function_exists( 'woocommerce_gzd_service_checkbox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_gzd_service_checkbox(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-gzd-template-functions.php  
  1. function woocommerce_gzd_service_checkbox() { 
  2.  
  3. $items = WC()->cart->get_cart(); 
  4. $is_service = false; 
  5.  
  6. if ( ! empty( $items ) ) { 
  7.  
  8. foreach ( $items as $cart_item_key => $values ) { 
  9. $_product = apply_filters( 'woocommerce_cart_item_product', $values[ 'data' ], $values, $cart_item_key ); 
  10.  
  11. if ( wc_gzd_is_revocation_exempt( $_product, service ) ) 
  12. $is_service = true; 
  13.  
  14.  
  15. if ( $is_service ) 
  16. wc_get_template( 'checkout/terms-service.php' );