<div class="shop_table wishlist_table wishlist-fragment">
    <?php if (count($wishlist_items)) : ?>
        <div class="nasa-tbody nasa-cart-wishlist-slider owl-carousel" data-columns-max="8">
            <?php
            foreach ($wishlist_items as $item) :
                global $product;
                $product = wc_get_product($item);
                
                if (empty($product)) :
                    continue;
                endif;
                
                $productId = $product->get_id();
                $status = $product->get_status();
                
               if (!$product->is_visible() || $status != 'publish') : ?>
                    <div class="nasa-tr-wishlist-item hidden-tag item-invisible" id="nasa-wishlist-row-<?php echo (int) $productId; ?>" data-row-id="<?php echo (int) $productId; ?>">
                        <div class="product-remove">
                            <a href="javascript:void(0);" class="remove nasa-remove_from_wishlist btn-wishlist btn-nasa-wishlist nasa-added" title="<?php esc_attr_e('Remove this product', 'zella-theme'); ?>" data-prod="<?php echo (int) $productId; ?>">
                                <?php esc_html_e('Remove', 'zella-theme') ?>
                            </a>
                        </div>
                    </div>
                    <?php
                    continue;
                endif;

                $availability = $product->get_availability();
                $stock_status = isset($availability['class']) ? $availability['class'] : 'in-stock';
                ?>
                <div class="nasa-tr-wishlist-item" id="nasa-wishlist-row-<?php echo (int) $productId; ?>" data-row-id="<?php echo (int) $productId; ?>">
                    <div class="product-wishlist-info">
                        <div class="wishlist-item-warper nasa-relative">
                            <div class="row wishlist-item">
                                <div class="image-wishlist large-4 small-4 columns padding-left-0">
                                    <a href="<?php echo esc_url(get_permalink(apply_filters('woocommerce_in_cart_product', $productId))); ?>">
                                        <?php echo zella_str($product->get_image('thumbnail')); ?>
                                    </a>
                                </div>

                                <div class="info-wishlist large-8 small-8 columns padding-right-0">
                                    <div class="row">
                                        <div class="large-12 columns nasa-wishlist-title">
                                            <a href="<?php echo esc_url(get_permalink(apply_filters('woocommerce_in_cart_product', $productId))); ?>">
                                                <?php echo apply_filters('woocommerce_in_cartproduct_obj_title', $product->get_name(), $product); ?>
                                            </a>
                                        </div>

                                        <div class="wishlist-price large-12 columns">
                                            <span class="price">
                                                <?php echo zella_str($product->get_price_html()); ?>
                                            </span>
                                            <?php
                                            if ($stock_status == 'out-of-stock') :
                                                echo '<span class="wishlist-out-of-stock">' . esc_html__(' - Out of Stock', 'zella-theme') . '</span>';
                                            else :
                                                echo '<span class="wishlist-in-stock">' . esc_html__(' - In Stock', 'zella-theme') . '</span>';
                                            endif;
                                            ?>
                                        </div>

                                        <?php if (!isset($nasa_opt['disable-cart']) || !$nasa_opt['disable-cart']) : ?>
                                            <div class="add-to-cart-wishlist large-12 columns">
                                                <?php
                                                if ($stock_status != 'out-of-stock'):
                                                    echo zella_add_to_cart_in_wishlist();
                                                endif;
                                                ?>
                                                <div class="quick-view nasa-view-from-wishlist hidden-tag" data-prod="<?php echo (int) $productId; ?>" data-tip="<?php echo esc_attr__('Quick View', 'zella-theme'); ?>" title="<?php echo esc_attr__('Quick View', 'zella-theme'); ?>" data-from_wishlist="1">
                                                    <div class="btn-link">
                                                        <div class="quick-view-icon">
                                                            <span class="nasa-icon-text">
                                                                <i class="pe-icon pe-7s-look"></i>
                                                            </span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="product-remove">
                        <div>
                            <a href="javascript:void(0);" class="remove nasa-remove_from_wishlist btn-wishlist btn-nasa-wishlist nasa-added" title="<?php echo esc_attr__('Remove this product', 'zella-theme'); ?>" data-prod="<?php echo (int) $productId ?>"><i class="pe-7s-close"></i></a>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
    <?php else: ?>
        <div class="pagination-row">
            <div class="wishlist-empty">
                <p class="empty">
                    <i class="nasa-empty-icon icon-nasa-like"></i>
                    <?php esc_html_e('No products added to the wishlist.', 'zella-theme') ?>
                    <a href="javascript:void(0);" class="button small nasa-sidebar-return-shop">
                        <?php echo esc_html__('RETURN TO SHOP', 'zella-theme'); ?>
                    </a>
                </p>
            </div>
        </div>
    <?php endif; ?>
</div>
