Changeset 3337851
- Timestamp:
- 08/01/2025 01:27:44 PM (5 months ago)
- Location:
- product-gallery-swiper-for-woocommerce
- Files:
-
- 39 added
- 4 edited
-
tags/1.5.10 (added)
-
tags/1.5.10/LICENSE.txt (added)
-
tags/1.5.10/README.txt (added)
-
tags/1.5.10/admin (added)
-
tags/1.5.10/admin/class-wdevs-gallery-swiper-admin.php (added)
-
tags/1.5.10/admin/index.php (added)
-
tags/1.5.10/admin/js (added)
-
tags/1.5.10/admin/js/wdevs-gallery-swiper-admin.js (added)
-
tags/1.5.10/includes (added)
-
tags/1.5.10/includes/class-wdevs-gallery-swiper-activator.php (added)
-
tags/1.5.10/includes/class-wdevs-gallery-swiper-deactivator.php (added)
-
tags/1.5.10/includes/class-wdevs-gallery-swiper-loader.php (added)
-
tags/1.5.10/includes/class-wdevs-gallery-swiper-woocommerce.php (added)
-
tags/1.5.10/includes/class-wdevs-gallery-swiper.php (added)
-
tags/1.5.10/includes/index.php (added)
-
tags/1.5.10/languages (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-en_US.l10n.php (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-en_US.mo (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-en_US.po (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-nl_NL.l10n.php (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-nl_NL.mo (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce-nl_NL.po (added)
-
tags/1.5.10/languages/product-gallery-swiper-for-woocommerce.pot (added)
-
tags/1.5.10/public (added)
-
tags/1.5.10/public/class-wdevs-gallery-swiper-public.php (added)
-
tags/1.5.10/public/css (added)
-
tags/1.5.10/public/css/wdevs-gallery-swiper-public.css (added)
-
tags/1.5.10/public/index.php (added)
-
tags/1.5.10/public/js (added)
-
tags/1.5.10/public/js/wdevs-gallery-swiper-public.js (added)
-
tags/1.5.10/public/js/woo-product-filter-by-wbw.js (added)
-
tags/1.5.10/public/js/xstore-theme.js (added)
-
tags/1.5.10/public/js/yith-infinite-scrolling.js (added)
-
tags/1.5.10/public/vendor (added)
-
tags/1.5.10/public/vendor/swiper (added)
-
tags/1.5.10/public/vendor/swiper/swiper-bundle.min.css (added)
-
tags/1.5.10/public/vendor/swiper/swiper-bundle.min.js (added)
-
tags/1.5.10/uninstall.php (added)
-
tags/1.5.10/wdevs-gallery-swiper.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/public/class-wdevs-gallery-swiper-public.php (modified) (3 diffs)
-
trunk/public/css/wdevs-gallery-swiper-public.css (modified) (1 diff)
-
trunk/wdevs-gallery-swiper.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
product-gallery-swiper-for-woocommerce/trunk/README.txt
r3334031 r3337851 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 1.5. 96 Stable tag: 1.5.10 7 7 Requires PHP: 7.2 8 8 License: GPL-2.0+ … … 65 65 66 66 == Changelog == 67 = 1.5.10 = 68 * Improved compatibility for XStore theme 69 67 70 = 1.5.9 = 68 71 * Added WooCommerce ProductImage block integration -
product-gallery-swiper-for-woocommerce/trunk/public/class-wdevs-gallery-swiper-public.php
r3334031 r3337851 235 235 ], $this->version, true ); 236 236 wp_enqueue_script( 'wdevs-gallery-swiper-xstore-theme' ); 237 238 // Hook into XStore product grid element rendering 239 add_filter( 'etheme_product_grid_list_product_element_image', [ $this, 'xstore_product_grid_gallery_integration' ], PHP_INT_MIN, 3 ); 237 240 } 238 241 } … … 398 401 * @since 1.4.0 399 402 */ 400 public function finish_gallery_rendering( ) {403 public function finish_gallery_rendering( $product = null ) { 401 404 if ( $this->should_display_gallery() && ! $this->executed_block_integration() ) { 402 405 echo '</div>'; 403 406 404 $product = wc_get_product(); 405 if ( $product ) { 406 foreach ( $product->get_gallery_image_ids() as $attachment_id ) { 407 echo $this->wrap_in_slide( $this->get_product_image( $product, $attachment_id ) ); 408 } 409 410 if ( $product->is_type( 'variable' ) ) { 411 if ( $this->should_include_variation_images() ) { 412 $variation_images = []; 413 $variations = $product->get_available_variations(); 414 415 foreach ( $variations as $variation ) { 416 if ( ! empty( $variation['image_id'] ) && ! in_array( $variation['image_id'], $variation_images, true ) ) { 417 echo $this->wrap_in_slide( $this->get_product_image( $product, $variation['image_id'] ) ); 418 $variation_images[] = $variation['image_id']; 419 } 420 } 421 } 422 } 423 } 407 $this->render_gallery_images( $product ); 424 408 425 409 echo $this->build_swiper_closing_tag(); … … 763 747 return ( get_option( 'wdevs_gallery_swiper_variation_images', 'no' ) === 'yes' ); 764 748 } 749 750 /** 751 * Render gallery images and variations for a specific product. 752 * 753 * @param WC_Product|null $product Product object, uses current product if null. 754 * @return void 755 * @since 1.5.10 756 */ 757 private function render_gallery_images( $product = null ) { 758 if ( ! $product ) { 759 $product = wc_get_product(); 760 } 761 762 if ( ! $product ) { 763 return; 764 } 765 766 foreach ( $product->get_gallery_image_ids() as $attachment_id ) { 767 echo $this->wrap_in_slide( $this->get_product_image( $product, $attachment_id ) ); 768 } 769 770 if ( $product->is_type( 'variable' ) && $this->should_include_variation_images() ) { 771 $variation_images = []; 772 $variations = $product->get_available_variations(); 773 774 foreach ( $variations as $variation ) { 775 if ( ! empty( $variation['image_id'] ) && ! in_array( $variation['image_id'], $variation_images, true ) ) { 776 echo $this->wrap_in_slide( $this->get_product_image( $product, $variation['image_id'] ) ); 777 $variation_images[] = $variation['image_id']; 778 } 779 } 780 } 781 } 782 783 /** 784 * XStore product grid gallery integration. 785 * 786 * @param string $original_image_html The original image HTML from XStore. 787 * @param WC_Product $product The product object. 788 * @param array $local_settings The XStore element settings. 789 * 790 * @return string The gallery HTML or original image HTML. 791 * @since 1.5.10 792 */ 793 public function xstore_product_grid_gallery_integration( $original_image_html, $product, $local_settings ) { 794 if ( ! $product || ! is_a( $product, 'WC_Product' ) ) { 795 return $original_image_html; 796 } 797 798 if ( ! $this->should_display_gallery( $product->get_id() ) ) { 799 return $original_image_html; 800 } 801 802 ob_start(); 803 804 $this->start_gallery_rendering(); 805 echo $original_image_html; 806 $this->finish_gallery_rendering( $product ); 807 808 return ob_get_clean(); 809 } 765 810 } -
product-gallery-swiper-for-woocommerce/trunk/public/css/wdevs-gallery-swiper-public.css
r3217195 r3337851 11 11 max-width: 100%; 12 12 } 13 14 /* XStore product grid */ 15 .etheme-product-grid-image footer{ 16 z-index: 1; 17 } -
product-gallery-swiper-for-woocommerce/trunk/wdevs-gallery-swiper.php
r3334031 r3337851 17 17 * Plugin URI: https://products.wijnberg.dev 18 18 * Description: Enhances WooCommerce product images display on product listing sections, providing a responsive and touch-friendly swiper. 19 * Version: 1.5. 919 * Version: 1.5.10 20 20 * Author: Wijnberg Developments 21 21 * License: GPL-2.0+ … … 41 41 * Rename this for your plugin and update it as you release new versions. 42 42 */ 43 define( 'WDEVS_GALLERY_SWIPER_VERSION', '1.5. 9' );43 define( 'WDEVS_GALLERY_SWIPER_VERSION', '1.5.10' ); 44 44 45 45 /**
Note: See TracChangeset
for help on using the changeset viewer.