cart && !WC()->cart->is_empty()) : $enable_button_ajax = 'yes' === get_option('woocommerce_enable_ajax_add_to_cart') ? true : false; $is_change_variation_mini_cart = (isset($nasa_opt['mini_cart_change_variation_product']) && $nasa_opt['mini_cart_change_variation_product'] && $enable_button_ajax) ? true : false; $extra_mini_cart_class = 'nasa-minicart-items'; if ($is_change_variation_mini_cart) : $extra_mini_cart_class .= ' nasa-change_variation_mini_cart'; endif; $in_mobile = isset($nasa_opt['nasa_in_mobile']) && $nasa_opt['nasa_in_mobile'] ? true : false; $mini_cart_mobile_view_hide = ''; ?>
cart->get_cart(); if ($in_mobile && isset($nasa_opt['mobile_layout']) && $nasa_opt['mobile_layout'] == 'app') : $mini_cart_mobile_view_hide = isset($nasa_opt['mini_cart_mobile_view_hide']) && $nasa_opt['mini_cart_mobile_view_hide'] ? ' mini_cart_mobile_view_hidden' : ''; endif; foreach ($cart_items as $cart_item_key => $cart_item) : $_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key); $product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key); if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key)) : $variations = isset($cart_item['variation']) && $cart_item['variation'] ? $cart_item['variation'] : null; $_data_attr = ''; if (!empty($variations)) : $result = array(); foreach ($variations as $key => $variation) : $result[] = "$variation"; endforeach; $_data_attr = implode(".", $result); endif; /** * Filter the product name. * * @param string $product_name Name of the product in the cart. */ $product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key); $product_var_id = apply_filters('ns_cart_item_variation_id', $_product->get_id(), $cart_item, $cart_item_key); $thumbnail = apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key); $product_price = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $cart_item, $cart_item_key); $product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key); ?>
', esc_url(wc_get_cart_remove_url($cart_item_key)), $enable_button_ajax ? 'yes' : 'no', /* translators: %s is the product name */ esc_attr(sprintf(__('Remove %s from cart', 'elessi-theme'), $product_name)), esc_attr($product_id), esc_attr($cart_item_key), esc_attr($_product->get_sku()) ), $cart_item_key ); ?>
'; $wrap = false; $quantily_show = true; /** * Qty input * Elessi Theme Support */ if ((!isset($nasa_opt['mini_cart_qty']) || $nasa_opt['mini_cart_qty'])) : $quantily_show = false; $wrap = true; if ($_product->is_sold_individually()) : $min_quantity = 1; $max_quantity = 1; else : $min_quantity = 0; $max_quantity = $_product->get_max_purchase_quantity(); endif; $qty_args = array( 'input_name' => 'cart[' . $cart_item_key . '][qty]', 'input_value' => $cart_item['quantity'], 'max_value' => $max_quantity, 'min_value' => $min_quantity, 'product_name' => $_product->get_name(), 'mini_cart' => true ); $product_quantity = woocommerce_quantity_input($qty_args, $_product, false); echo '
'; echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item); // PHPCS: XSS ok. endif; echo apply_filters('woocommerce_widget_cart_item_quantity', '
' . ($quantily_show ? sprintf('%s × %s', $cart_item['quantity'], $product_price) : sprintf('× %s', $product_price)) . '
', $cart_item, $cart_item_key); echo $wrap ? '
' : ''; /** * SubTotal * Elessi Theme Support */ if ((!isset($nasa_opt['mini_cart_subtotal']) || $nasa_opt['mini_cart_subtotal'])) : echo '
'; echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); echo '
'; endif; echo '
'; endif; ?>