$name, 'available' => $available, ); if ( ! tinv_get_option( 'integrations', $slug ) ) { return; } if ( ! $available ) { return; } if ( defined( 'WOOSB_VERSION' ) ) { add_action( 'tinvwl_wishlist_addtowishlist_button', 'tinvwl_woo_product_bundle_loop_data', 10, 2 ); function tinvwl_woo_product_bundle_loop_data( $product, $loop ) { if ( $loop && 'woosb' === $product->get_type() ) { $ids_str = ''; if ( get_post_meta( $product->get_id(), 'woosb_ids', true ) ) { $ids = get_post_meta( $product->get_id(), 'woosb_ids', true ); if ( is_array( $ids ) ) { foreach ( $ids as $item ) { if ( ! empty( $item['id'] ) ) { $ids_arr[] = $item['id'] . '/' . $item['qty']; } } $ids_str = implode( ',', $ids_arr ); } else { $ids_str = $ids; } } $ids_str = ( version_compare( WOOSB_VERSION, '6.2.0', '<' ) ) ? WPCleverWoosb_Helper::woosb_clean_ids( $ids_str ) : WPCleverWoosb_Helper::clean_ids( $ids_str ); ?> is_type( 'woosb' ) && isset( $wl_product['meta'] ) && isset( $wl_product['meta']['woosb_ids'] ) ) { $bundle = WPCleverWoosb::instance(); $bundled_items = ( version_compare( WOOSB_VERSION, '6.2.0', '<' ) ) ? $bundle->woosb_get_bundled( $wl_product['meta']['woosb_ids'] ) : $bundle->get_bundled( $wl_product['meta']['woosb_ids'] ); if ( ! empty( $bundled_items ) ) { foreach ( $bundled_items as $key => $data ) { $bundled_item = new stdClass(); $bundled_item->product = wc_get_product( $data['id'] ); if ( ! $bundled_item->product ) { continue; } $bundled_product_qty = $data['qty']; $product_url = ( get_option( '_woosb_bundled_link', 'yes' ) !== 'no' ) ? $product->get_permalink() : $bundled_item->product->get_permalink(); $product_image = $bundled_item->product->get_image(); $product_title = is_callable( array( $bundled_item->product, 'get_name' ) ) ? $bundled_item->product->get_name() : $bundled_item->product->get_title(); $product_price = $bundled_item->product->get_price_html(); if ( $bundled_item->product->is_visible() ) { $product_image = sprintf( '%s', esc_url( $product_url ), $product_image ); $product_title = sprintf( '%s', esc_url( $product_url ), $product_title ); } $product_title .= tinv_wishlist_get_item_data( $bundled_item->product, $wl_product ); $availability = (array) $bundled_item->product->get_availability(); if ( ! array_key_exists( 'availability', $availability ) ) { $availability['availability'] = ''; } if ( ! array_key_exists( 'class', $availability ) ) { $availability['class'] = ''; } $availability_html = empty( $availability['availability'] ) ? '
' . esc_html__( 'In stock', 'ti-woocommerce-wishlist' ) . '
' : '' . esc_html( $availability['availability'] ) . '
'; $row_string = '