Server IP : 15.235.198.142 / Your IP : 216.73.216.190 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/yme/wp-content/themes/oceanwp/woocommerce/single-product/ |
Upload File : |
<?php /** * Single Product Image * * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 9.7.0 */ defined( 'ABSPATH' ) || exit; // Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC. if ( ! function_exists( 'wc_get_gallery_image_html' ) ) { return; } global $product; $columns = apply_filters( 'woocommerce_product_thumbnails_columns', 4 ); $post_thumbnail_id = $product->get_image_id(); $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_classes', array( 'woocommerce-product-gallery', 'woocommerce-product-gallery--' . ( $post_thumbnail_id ? 'with-images' : 'without-images' ), 'woocommerce-product-gallery--columns-' . absint( $columns ), 'images', ) ); ?> <div class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $wrapper_classes ) ) ); ?>" data-columns="<?php echo esc_attr( $columns ); ?>" style="opacity: 0; transition: opacity .25s ease-in-out;"> <?php if ( class_exists( 'Custom_Product_Badges' ) ) { Custom_Product_Badges::oec_custom_product_badge_display_single(); } ?> <figure class="woocommerce-product-gallery__wrapper"> <?php if ( $post_thumbnail_id ) { $html = wc_get_gallery_image_html( $post_thumbnail_id, true ); } else { $wrapper_classname = $product->is_type( 'variable' ) && ! empty( $product->get_available_variations( 'image' ) ) ? 'woocommerce-product-gallery__image woocommerce-product-gallery__image--placeholder' : 'woocommerce-product-gallery__image--placeholder'; $html = sprintf( '<div class="%s">', esc_attr( $wrapper_classname ) ); $html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src( 'woocommerce_single' ) ), esc_html__( 'Awaiting product image', 'woocommerce' ) ); $html .= '</div>'; } echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id ); // phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped do_action( 'woocommerce_product_thumbnails' ); ?> </figure> </div>