$this ) ); add_action( $form_position_hook, array( $wc_sc_purchase_credit, 'gift_certificate_receiver_detail_form' ) ); } add_action( 'wp_footer', array( $this, 'enqueue_styles_scripts' ), 99 ); } } /** * Get single instance of WC_SC_KCO_Compatibility * * @return WC_SC_KCO_Compatibility Singleton object of WC_SC_KCO_Compatibility */ public static function get_instance() { // Check if instance is already exists. if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Handle call to functions which is not available in this class * * @param string $function_name Function to call. * @param array $arguments Array of arguments passed while calling $function_name. * @return mixed Result of function call. */ public function __call( $function_name, $arguments = array() ) { global $woocommerce_smart_coupon; if ( ! is_callable( array( $woocommerce_smart_coupon, $function_name ) ) ) { return; } if ( ! empty( $arguments ) ) { return call_user_func_array( array( $woocommerce_smart_coupon, $function_name ), $arguments ); } else { return call_user_func( array( $woocommerce_smart_coupon, $function_name ) ); } } /** * Enqueue required styles/scripts for store credit frontend form */ public function enqueue_styles_scripts() { // Return if gift certificate form is not shown. if ( ! did_action( 'wc_sc_gift_certificate_form_shown' ) ) { return; } if ( ! wp_script_is( 'jquery' ) ) { wp_enqueue_script( 'jquery' ); } ?>