default.php
140 lines
| 1 | <?php defined('ABSPATH') || exit; |
| 2 | |
| 3 | $editor_mode = (\Elementor\Plugin::$instance->editor->is_edit_mode() || is_preview()); |
| 4 | |
| 5 | if($editor_mode) { |
| 6 | |
| 7 | global $wp_query, $post; |
| 8 | $main_query = clone $wp_query; |
| 9 | $main_post = clone $post; |
| 10 | |
| 11 | $wp_query = new \WP_Query([]); |
| 12 | } |
| 13 | |
| 14 | \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_filter(); |
| 15 | |
| 16 | \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_part_filter(); |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <?php |
| 21 | // woostify theme compatibility |
| 22 | $theme_name = get_template(); |
| 23 | if ($theme_name == 'woostify') { |
| 24 | |
| 25 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_wrapper_open', 10 ); |
| 26 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_print_out_of_stock_label', 15 ); |
| 27 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_image_wrapper_open', 20 ); |
| 28 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_change_sale_flash', 23 ); |
| 29 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_product_loop_item_action', 25 ); |
| 30 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_link_open', 30 ); |
| 31 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_hover_image', 40 ); |
| 32 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_image', 50 ); |
| 33 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_link_close', 60 ); |
| 34 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_add_to_cart_on_image', 70 ); |
| 35 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_product_loop_item_wishlist_icon_bottom', 80 ); |
| 36 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_image_wrapper_close', 90 ); |
| 37 | remove_action( 'woocommerce_before_shop_loop_item_title', 'woostify_loop_product_content_open', 100 ); |
| 38 | |
| 39 | remove_action( 'woocommerce_shop_loop_item_title', 'woostify_add_template_loop_product_category', 5 ); |
| 40 | remove_action( 'woocommerce_shop_loop_item_title', 'woostify_add_template_loop_product_title', 10 ); |
| 41 | |
| 42 | remove_action( 'woocommerce_after_shop_loop_item_title', 'woostify_loop_product_rating', 2 ); |
| 43 | remove_action( 'woocommerce_after_shop_loop_item_title', 'woostify_loop_product_meta_open', 5 ); |
| 44 | remove_action( 'woocommerce_after_shop_loop_item_title', 'woostify_loop_product_price', 10 ); |
| 45 | |
| 46 | remove_action( 'woocommerce_after_shop_loop_item', 'woostify_loop_product_add_to_cart_button', 10 ); |
| 47 | remove_action( 'woocommerce_after_shop_loop_item', 'woostify_loop_product_meta_close', 20 ); |
| 48 | remove_action( 'woocommerce_after_shop_loop_item', 'woostify_loop_product_content_close', 50 ); |
| 49 | remove_action( 'woocommerce_after_shop_loop_item', 'woostify_loop_product_wrapper_close', 100 ); |
| 50 | } |
| 51 | |
| 52 | ?> |
| 53 | |
| 54 | <?php |
| 55 | if ( is_plugin_active( 'iconic-woo-image-swap/iconic-woo-image-swap.php' ) ) |
| 56 | { |
| 57 | global $iconic_woo_image_swap_class; |
| 58 | remove_action('woocommerce_before_shop_loop_item',array($iconic_woo_image_swap_class,'template_loop_product_thumbnail'),5); |
| 59 | |
| 60 | } |
| 61 | |
| 62 | if ('auxin-shop/auxin-shop.php') { |
| 63 | |
| 64 | remove_action( 'woocommerce_after_shop_loop_item_title', 'auxshp_loop_product_meta', 12 ); |
| 65 | remove_action( 'woocommerce_after_shop_loop_item' , 'auxshp_loop_product_tools', 12 ); |
| 66 | remove_action( 'woocommerce_archive_description' , 'auxshp_archive_page_title_description', 1 ); |
| 67 | remove_action( 'woocommerce_before_shop_loop_item_title', 'auxshp_get_product_thumbnail', 11 ); |
| 68 | |
| 69 | global $wp_filter; |
| 70 | if (isset($wp_filter['woocommerce_after_single_product'])) { |
| 71 | foreach ($wp_filter['woocommerce_after_single_product']->callbacks[20] as $key => $callback) { |
| 72 | if (is_array($callback['function']) && |
| 73 | is_object($callback['function'][0]) && |
| 74 | get_class($callback['function'][0]) === 'AUXSHP_Template_Loader' && |
| 75 | $callback['function'][1] === 'auxshp_related_products') { |
| 76 | unset($wp_filter['woocommerce_after_single_product']->callbacks[20][$key]); |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | ?> |
| 82 | |
| 83 | <?php |
| 84 | //blocksy theme conflict issue |
| 85 | $themeName = get_template(); |
| 86 | if($themeName == 'blocksy'):?> |
| 87 | <?php remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); ?> |
| 88 | <?php endif; |
| 89 | ?> |
| 90 | |
| 91 | <div class="shopengine-related <?php echo ($is_slider_enable ? 'slider-enabled' : 'slider-disabled'); ?>" data-controls="<?php echo esc_attr($encode_slider_options); ?>"> |
| 92 | |
| 93 | <?php |
| 94 | $relatedProduct = $args['related_products']; |
| 95 | |
| 96 | if(empty($relatedProduct)) { |
| 97 | |
| 98 | if( $shopengine_related_product_hide_if_products_not_found == 'yes' ) { |
| 99 | return; |
| 100 | } ?> |
| 101 | |
| 102 | <p style="font-size: 18px; font-weight:600"><?php echo esc_html__('No related products found.', 'shopengine'); ?></p> |
| 103 | <?php |
| 104 | } else{ |
| 105 | if( $shopengine_related_product_show_products_heading && $shopengine_related_product_show_products_heading == 'yes' ){ ?> |
| 106 | <h2 class="shopengine-related-products-heading-title"><?php echo esc_html( $shopengine_related_product_show_products_heading_title ?? ''); ?></h2> |
| 107 | <?php } |
| 108 | woocommerce_related_products($args); |
| 109 | if($is_slider_enable && $shopengine_related_product_slider_show_dots) { |
| 110 | echo '<div class="swiper-pagination" style="width: 100%;"></div>'; |
| 111 | } |
| 112 | |
| 113 | if($is_slider_enable && $shopengine_related_product_slider_show_arrows) { |
| 114 | shopengine_content_render( |
| 115 | sprintf( |
| 116 | '<div class="swiper-button-prev">%1$s</div><div class="swiper-button-next">%2$s</div>', |
| 117 | $this->get_icon_html($shopengine_related_product_slider_left_arrow_icon), |
| 118 | $this->get_icon_html($shopengine_related_product_slider_right_arrow_icon) |
| 119 | ) |
| 120 | ); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | ?> |
| 128 | </div> |
| 129 | |
| 130 | <?php |
| 131 | |
| 132 | if($editor_mode) { |
| 133 | global $wp_query, $post; |
| 134 | |
| 135 | $wp_query = $main_query; |
| 136 | $post = $main_post; |
| 137 | wp_reset_query(); |
| 138 | wp_reset_postdata(); |
| 139 | } |
| 140 |