PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.8.1
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.8.1
4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / compatibility / conflicts / theme-hooks.php
shopengine / compatibility / conflicts Last commit date
manifest.php 4 years ago theme-hooks.php 4 years ago
theme-hooks.php
1417 lines
1 <?php
2
3 namespace ShopEngine\Compatibility\Conflicts;
4
5
6 use ShopEngine\Traits\Singleton;
7
8 class Theme_Hooks {
9
10 use Singleton;
11
12 public function force_load_woocommerce_css($styles) {
13
14 if(!isset($styles['woocommerce-layout'])) {
15
16 $styles['woocommerce-layout'] = [
17 'src' => WC()->plugin_url() . '/assets/css/woocommerce-layout.css',
18 'deps' => '',
19 'version' => \Automattic\Jetpack\Constants::get_constant('WC_VERSION'),
20 'media' => 'all',
21 'has_rtl' => true,
22 ];
23 }
24
25
26 if(!isset($styles['woocommerce-general'])) {
27
28 $styles['woocommerce-general'] = [
29 'src' => WC()->plugin_url() . '/assets/css/woocommerce.css',
30 'deps' => '',
31 'version' => \Automattic\Jetpack\Constants::get_constant('WC_VERSION'),
32 'media' => 'all',
33 'has_rtl' => true,
34 ];
35 }
36
37
38 return $styles;
39 }
40
41
42 public function theme__conflicts__shop_and_archive() {
43 /**
44 * Common in multiple theme
45 *
46 */
47 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
48 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
49
50
51 /*******************************************************
52 * Storefront theme hook reverting...
53 *
54 ******************************************************/
55
56 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_sorting_wrapper', 9);
57 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_sorting_wrapper_close', 31);
58 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_woocommerce_pagination', 30);
59 $this->remove_action_if_exists('woocommerce_after_shop_loop', 'woocommerce_result_count', 20);
60
61 /**
62 * End of Storefront theme hook reverting
63 ******************************************************/
64
65 /*******************************************************
66 * xStore theme hook reverting in shop & archive page
67 *
68 ******************************************************/
69
70 $this->remove_action_if_exists('woocommerce_sale_flash', 'etheme_woocommerce_sale_flash', 20);
71 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'etheme_grid_list_switcher', 35);
72 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'etheme_products_per_page_select', 37);
73 $this->remove_action_if_exists('woocommerce_after_shop_loop', 'woocommerce_result_count', 5);
74
75 /**
76 * End of xStore theme hook reverting
77 ******************************************************/
78
79
80 /*******************************************************
81 * Astra theme hook reverting...
82 *
83 ******************************************************/
84
85 if(has_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper') === false) {
86 add_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
87 }
88
89 if(has_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end') === false) {
90 add_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
91 }
92
93 if(has_action('woocommerce_sidebar', 'woocommerce_get_sidebar') === false) {
94 add_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
95 }
96
97 if(has_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title') === false) {
98 add_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
99 }
100
101 if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') === false) {
102 add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
103 }
104
105 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash') === false) {
106 add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
107 }
108
109 if(has_action('woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start') !== false) {
110 remove_action('woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6);
111 }
112
113 if(has_action('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash') !== false) {
114 remove_action('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash', 9);
115 }
116
117 if(has_action('woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end') !== false) {
118 remove_action('woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8);
119 }
120
121 if(has_action('woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock') !== false) {
122 remove_action('woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock', 8);
123 }
124
125 if(has_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart') === false) {
126 add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
127 }
128
129 if(has_action('woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content') !== false) {
130 remove_action('woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content');
131 }
132
133 /**
134 * End of astra theme hook reverting
135 ******************************************************/
136
137
138 /*******************************************************
139 * Hestia theme hook reverting...
140 *
141 ******************************************************/
142 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_thumbnail', 10);
143 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'hestia_woocommerce_before_shop_loop_item', 10);
144 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'hestia_woocommerce_after_shop_loop_item', 20);
145 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_title', 10);
146
147
148 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail') === false) {
149 add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
150 }
151
152 if(has_action('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open') === false) {
153 add_action('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
154 }
155
156 if(has_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close') === false) {
157 add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
158 }
159
160 if(has_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart') === false) {
161 add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
162 }
163
164 if(has_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title') === false) {
165 add_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
166 }
167
168
169 if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') === false) {
170 add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
171 }
172
173 /**
174 * End of hestia theme hook reverting
175 ******************************************************/
176
177
178 /*******************************************************
179 * Flatsome theme hook reverting...
180 *
181 ******************************************************/
182
183
184 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'flatsome_woocommerce_shop_loop_category', 0);
185 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash');
186 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_result_count');
187 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_result_count', 20);
188
189 /**
190 * End of Flatsome theme hook reverting
191 ******************************************************/
192
193
194 /*******************************************************
195 * Neve theme hook reverting...
196 *
197 ******************************************************/
198
199
200 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\Neve\Views\Product_Layout', 'card_content_wrapper');
201 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\Neve\Views\Product_Layout', 'wrapper_close_div');
202 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'product_image_wrap');
203 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'out_of_stock_badge');
204 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'wrapper_close_div');
205
206
207 /**
208 * End of Neve theme hook reverting
209 ******************************************************/
210
211
212 /*******************************************************
213 * Woodmart theme hook reverting in shop & archive
214 *
215 ******************************************************/
216
217 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail');
218 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail');
219 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woodmart_products_per_page_select', 25);
220
221 /**
222 * End of Woodmart theme hook reverting in shop & archive
223 ******************************************************/
224
225
226 /*******************************************************
227 * OceanWP theme hook reverting...
228 *
229 ******************************************************/
230
231 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'add_shop_loop_div');
232 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'close_shop_loop_div');
233 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'grid_list_buttons');
234 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'result_count');
235
236 $this->add_action_if_not_exists('woocommerce_before_shop_loop', 'woocommerce_result_count');
237
238 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
239 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
240 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
241 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
242
243 /**
244 * End of OceanWP theme hook reverting
245 ******************************************************/
246
247
248 /*******************************************************
249 * Porto theme hook reverting...
250 *
251 ******************************************************/
252
253 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail') !== false) {
254 remove_action('woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10);
255 }
256
257 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open') !== false) {
258 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1);
259
260 }
261
262 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close') !== false) {
263 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100);
264 }
265
266 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title') !== false) {
267 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title');
268 }
269
270 if(has_action('woocommerce_before_shop_loop', 'woocommerce_pagination') !== false) {
271 remove_action('woocommerce_before_shop_loop', 'woocommerce_pagination', 50);
272 }
273
274 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail') === false) {
275 add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
276 }
277
278 $this->remove_action_if_exists( 'woocommerce_before_shop_loop', 'porto_grid_list_toggle', 70 );
279 /*******************************************************
280 * End of porto theme hook reverting...
281 *
282 ******************************************************/
283
284 /*******************************************************
285 * Electro theme hook reverting in shop & archive page
286 *
287 ******************************************************/
288
289
290 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'electro_shop_control_bar', 11);
291 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
292 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'redux_apply_catalog_mode_for_product_loop', 85);
293
294 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
295 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
296 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
297 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
298 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
299 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
300 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
301 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
302 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
303 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
304 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
305 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
306 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
307 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
308 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
309 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
310 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
311 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
312 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
313 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
314 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
315 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
316 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
317 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
318 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
319 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
320 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
321 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
322 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'electro_wc_loop_title', 10);
323 $this->remove_action_if_exists('woocommerce_get_price_html', 'electro_wrap_price_html', 90);
324 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
325 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
326
327 // Storefront Theme
328 $this->remove_action_if_exists('woocommerce_before_main_content', 'storefront_before_content', 10 );
329 $this->remove_action_if_exists('woocommerce_after_main_content', 'storefront_after_content', 10 );
330 }
331
332 /**
333 * This method is called from badge module.
334 *
335 */
336 public function theme_conflicts__shop_and_archive_for_badge_module() {
337
338 $this->remove_action_if_exists( 'woocommerce_sale_flash', 'woodmart_product_label', 10 );
339 }
340
341 public function theme__conflicts__single_page() {
342
343 /**
344 * Woodmart theme dequeueing this so we are enqueueing again.
345 */
346 wp_enqueue_script('flexslider');
347
348
349 /*******************************************************
350 * Woodmart theme hook reverting...
351 *
352 ******************************************************/
353
354 if(has_action('woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail') !== false) {
355 remove_action('woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10);
356 }
357
358 if(has_action('woocommerce_sale_flash', 'woodmart_product_label') !== false) {
359 remove_filter('woocommerce_sale_flash', 'woodmart_product_label', 10);
360 }
361
362 $this->remove_action_if_exists( 'woocommerce_product_tabs', 'woodmart_custom_product_tabs' );
363 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail');
364
365 /**
366 * End of Woodmart theme hook reverting
367 ******************************************************/
368
369 /*******************************************************
370 * Astra theme hook reverting...
371 *
372 ******************************************************/
373
374 if(has_action('woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start') !== false) {
375 remove_action('woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6);
376 }
377
378 if(has_action('woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end') !== false) {
379 remove_action('woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8);
380 }
381
382 if(has_action('woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content') !== false) {
383 remove_action('woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content');
384 }
385
386 if(has_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart') === false) {
387
388 add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
389 }
390
391 if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating') === false) {
392
393 add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
394 }
395
396 if(has_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title') === false) {
397
398 add_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
399 }
400
401 if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') === false) {
402
403 add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
404 }
405
406 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash') === false) {
407
408 add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
409 }
410
411 if(has_action('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash') !== false) {
412
413 remove_action('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash', 9);
414 }
415
416 /**
417 * End of Astra theme hook reverting
418 ******************************************************/
419
420 /*******************************************************
421 * Electro theme hook reverting...
422 *
423 ******************************************************/
424
425 if(has_filter('woocommerce_sale_flash', 'electro_get_sale_flash') !== false) {
426 remove_filter('woocommerce_sale_flash', 'electro_get_sale_flash', 20);
427 }
428
429 if(has_filter('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link') !== false) {
430 remove_filter('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
431 }
432
433 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
434
435 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner');
436
437 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
438 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
439 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
440 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
441 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
442 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
443 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
444 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
445
446 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
447 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
448 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
449 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
450 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
451 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
452 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
453 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
454 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
455 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
456 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
457 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
458 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
459 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
460 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
461 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
462 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
463 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
464 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
465 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
466 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
467 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
468 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
469 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
470 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
471 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
472 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
473 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
474 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
475 $this->remove_action_if_found_14('woocommerce_product_tabs', 'Electro_WooCommerce', 'modify_product_tabs');
476 /**
477 * End of Electro theme hook reverting
478 ******************************************************/
479
480
481 /*******************************************************
482 * flatsome theme hook reverting...
483 *
484 ******************************************************/
485
486 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'flatsome_woocommerce_shop_loop_category', 0);
487 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash');
488
489 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open');
490 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close');
491 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash');
492
493
494 /**
495 * End of flatsome theme hook reverting
496 ******************************************************/
497
498
499 /*******************************************************
500 * Porto theme hook reverting...
501 *
502 ******************************************************/
503
504 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail') !== false) {
505 remove_action('woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10);
506 }
507
508 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open') !== false) {
509 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1);
510
511 }
512
513 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close') !== false) {
514 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100);
515 }
516
517 if(has_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title') !== false) {
518 remove_action('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title');
519 }
520
521 if(has_action('woocommerce_before_shop_loop', 'woocommerce_pagination') !== false) {
522 remove_action('woocommerce_before_shop_loop', 'woocommerce_pagination', 50);
523 }
524
525 if(has_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail') === false) {
526 add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
527 }
528
529 $this->remove_action_if_exists( 'woocommerce_after_add_to_cart_button', 'porto_view_cart_after_add', 35 );
530 /**
531 * End of porto theme hook reverting
532 ******************************************************/
533
534
535 /*******************************************************
536 * Neve theme hook reverting...
537 *
538 ******************************************************/
539
540 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\Neve\Views\Product_Layout', 'card_content_wrapper');
541 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\Neve\Views\Product_Layout', 'wrapper_close_div');
542
543 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'product_image_wrap');
544 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'out_of_stock_badge');
545 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\Neve\Views\Product_Layout', 'wrapper_close_div');
546
547
548 /**
549 * End of Neve theme hook reverting
550 ******************************************************/
551
552
553 /*******************************************************
554 * xStore theme hook reverting...
555 *
556 ******************************************************/
557
558 if(has_filter('woocommerce_sale_flash', 'etheme_woocommerce_sale_flash') !== false) {
559 remove_filter('woocommerce_sale_flash', 'etheme_woocommerce_sale_flash', 20);
560 }
561
562 /**
563 * End of xStore theme hook reverting
564 ******************************************************/
565
566
567 /*******************************************************
568 * Storefront theme hook reverting...
569 *
570 ******************************************************/
571
572 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
573 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6);
574
575 /**
576 * End of Storefront theme hook reverting
577 ******************************************************/
578
579
580 /*******************************************************
581 * Hestia theme hook reverting...
582 *
583 ******************************************************/
584
585 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
586 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 20);
587 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_thumbnail', 10);
588 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'hestia_woocommerce_before_shop_loop_item', 10);
589 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'hestia_woocommerce_after_shop_loop_item', 20);
590 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_title', 10);
591 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
592 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
593 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
594 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
595 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
596 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
597 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
598 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
599
600 /**
601 * End of hestia theme hook reverting
602 ******************************************************/
603
604 /*******************************************************
605 * OceanWP theme hook reverting...
606 *
607 ******************************************************/
608
609 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
610 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
611 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
612 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
613
614 /**
615 * End of hestia theme hook reverting
616 ******************************************************/
617
618 /*******************************************************
619 * Porto theme hook reverting
620 ******************************************************/
621 $this->remove_action_if_exists('woocommerce_after_single_product_summary', 'porto_woocommerce_output_related_products', 20);
622 $this->remove_action_if_exists('porto_after_content_bottom', 'porto_woocommerce_output_related_products', 8);
623 /**
624 * End of Porto theme hook reverting
625 ******************************************************/
626
627 /*******************************************************
628 * Astra theme hook reverting
629 ******************************************************/
630 $this->remove_action_if_found_14('woocommerce_product_get_rating_html', '\Astra_Woocommerce', 'rating_markup');
631 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
632 /**
633 * End of Astra theme hook reverting
634 ******************************************************/
635
636 }
637
638 public function theme_conflicts_in_editor__product_tabs_widget() {
639
640 // Electro Theme
641 $this->remove_action_if_found_14('woocommerce_product_tabs', 'Electro_WooCommerce', 'modify_product_tabs');
642 }
643
644
645 public function theme_conflicts_cart_page() {
646 // common
647 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
648 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
649 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
650 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
651 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
652
653 /*******************************************************
654 * OceanWP theme cart page hook for cross-sell reverting...
655 *
656 ******************************************************/
657
658 $this->remove_action_if_found_14('ocean_after_product_entry_slider', '\OceanWP_WooCommerce_Config', 'quick_view_button');
659 $this->remove_action_if_found_14('ocean_after_product_entry_image', '\OceanWP_WooCommerce_Config', 'quick_view_button');
660 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
661 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
662 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
663 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
664
665
666 /**
667 * End of OceanWP theme hook reverting
668 ******************************************************/
669
670 /*******************************************************
671 * Astra theme cart page hook for cross-sell reverting...
672 *******************************************************/
673
674 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6);
675 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8);
676 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content');
677 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
678 $this->remove_action_if_found_14('woocommerce_product_get_rating_html', '\Astra_Woocommerce', 'rating_markup' );
679 /**
680 * End of Astra theme hook reverting
681 ******************************************************/
682
683 /*******************************************************
684 * Hestia theme cart page hook for cross-sell reverting...
685 *******************************************************/
686
687 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_thumbnail', 10);
688 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'hestia_woocommerce_before_shop_loop_item', 10);
689 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'hestia_woocommerce_after_shop_loop_item', 20);
690 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'hestia_woocommerce_template_loop_product_title', 10);
691
692 /**
693 * End of Hestia theme hook reverting
694 ******************************************************/
695
696 /*******************************************************
697 * Porto theme cart page hook for cross-sell reverting...
698 *
699 ******************************************************/
700
701 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10);
702 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1);
703 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100);
704 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title');
705
706 /**
707 * End of Porto theme hook reverting
708 ******************************************************/
709
710 /*******************************************************
711 * Woodmart theme cart page hook for cross-sell reverting...
712 *******************************************************/
713
714 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10);
715
716 /**
717 * End of Woodmart theme hook reverting
718 ******************************************************/
719
720 /*******************************************************
721 * Flatsome theme hook reverting
722 ******************************************************/
723 $this->add_action_if_not_exists( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
724 $this->remove_action_if_exists( 'woocommerce_after_cart_table', 'woocommerce_cross_sell_display' );
725 /**
726 * End of Flatsome theme hook reverting
727 ******************************************************/
728
729 }
730
731
732 public function theme_conflicts_empty_cart_page() {
733
734 $this->remove_action_if_exists('woocommerce_cart_is_empty', 'woodmart_wc_empty_cart_message', 10);
735 $this->remove_action_if_exists('woocommerce_cart_is_empty', 'woodmart_empty_cart_text', 20);
736 $this->add_action_if_not_exists('woocommerce_cart_is_empty', 'wc_empty_cart_message', 10);
737
738 add_filter('woocommerce_cart_product_cannot_be_purchased_message', function () {
739 return;
740 }, 10);
741 }
742
743
744 public function theme_conflicts_in_elementor_editor_cross_sells() {
745
746 /*******************************************************
747 * OceanWP theme cart page hook for cross-sell reverting..
748 ******************************************************/
749
750 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
751 $this->add_action_if_not_exists('woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);
752
753 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
754
755 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
756
757 $this->remove_action_if_found_14('woocommerce_cart_collaterals', '\OceanWP_WooCommerce_Config', 'cross_sell_display');
758 $this->remove_action_if_found_14('woocommerce_after_single_product_summary', '\OceanWP_WooCommerce_Config', 'upsell_display');
759 $this->remove_action_if_found_14('ocean_after_product_entry_image', '\OceanWP_WooCommerce_Config', 'quick_view_button');
760 $this->remove_action_if_found_14('ocean_after_product_entry_slider', '\OceanWP_WooCommerce_Config', 'quick_view_button');
761
762 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
763 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
764 $this->remove_action_if_found_14('woocommerce_before_template_part', '\OceanWP_WooCommerce_Config', 'before_template_part');
765 $this->add_action_if_not_exists('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display');
766 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
767 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
768 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
769 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
770 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
771 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
772 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
773 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
774
775 /**
776 * End of OceanWP theme hook reverting
777 ******************************************************/
778
779
780
781 /*******************************************************
782 * Porto theme cart page hook for cross-sell reverting...
783 *
784 ******************************************************/
785
786 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10 );
787 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1 );
788 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100 );
789 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title' );
790 $this->remove_action_if_exists( 'woocommerce_before_shop_loop', 'woocommerce_pagination', 50 );
791 $this->add_action_if_not_exists( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
792
793 /**
794 * End of Porto theme hook reverting
795 ******************************************************/
796
797 /*******************************************************
798 * Woodmart theme cart page hook for cross-sell reverting...
799 *******************************************************/
800
801 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10 );
802
803 /**
804 * End of Woodmart theme hook reverting
805 ******************************************************/
806
807 /*******************************************************
808 * Astra theme hook reverting
809 ******************************************************/
810 $this->remove_action_if_found_14( 'woocommerce_product_get_rating_html', '\Astra_Woocommerce', 'rating_markup' );
811 $this->add_action_if_not_exists( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
812 /**
813 * End of Astra theme hook reverting
814 ******************************************************/
815
816 /*******************************************************
817 * Flatsome theme hook reverting
818 ******************************************************/
819 $this->add_action_if_not_exists( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
820 $this->remove_action_if_exists( 'woocommerce_after_cart_table', 'woocommerce_cross_sell_display' );
821 /**
822 * End of Flatsome theme hook reverting
823 ******************************************************/
824
825 /*******************************************************
826 * Electro theme hook reverting
827 ******************************************************/
828 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
829
830 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
831 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
832
833 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
834 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
835
836 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
837 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
838 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
839 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
840 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
841
842 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
843 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
844 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
845 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
846
847 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
848 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
849 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
850 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
851 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
852
853 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
854 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
855 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
856 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
857 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
858
859 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
860 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
861 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
862 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
863
864 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
865 $this->remove_action_if_exists('woocommerce_get_price_html', 'electro_wrap_price_html', 90);
866 /**
867 * Electro of Neve theme hook reverting
868 ******************************************************/
869
870 }
871
872 public function theme_conflicts_in_elementor_editor_up_sells() {
873
874 /*******************************************************
875 * OceanWP theme cart page hook for cross-sell reverting..
876 ******************************************************/
877
878 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
879 $this->add_action_if_not_exists('woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);
880
881 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
882
883 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
884
885 $this->remove_action_if_found_14('woocommerce_cart_collaterals', '\OceanWP_WooCommerce_Config', 'cross_sell_display');
886 $this->remove_action_if_found_14('woocommerce_after_single_product_summary', '\OceanWP_WooCommerce_Config', 'upsell_display');
887 $this->remove_action_if_found_14('ocean_after_product_entry_image', '\OceanWP_WooCommerce_Config', 'quick_view_button');
888 $this->remove_action_if_found_14('ocean_after_product_entry_slider', '\OceanWP_WooCommerce_Config', 'quick_view_button');
889
890 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
891 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
892 $this->remove_action_if_found_14('woocommerce_before_template_part', '\OceanWP_WooCommerce_Config', 'before_template_part');
893 $this->add_action_if_not_exists('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display');
894 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
895 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
896 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
897 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
898 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
899 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
900 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
901 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
902
903 /**
904 * End of OceanWP theme hook reverting
905 ******************************************************/
906
907
908 /*******************************************************
909 * Porto theme cart page hook for cross-sell reverting...
910 *
911 ******************************************************/
912
913 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10) ;
914 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1);
915 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100);
916 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title');
917 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_pagination', 50);
918 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
919
920 /**
921 * End of Porto theme hook reverting
922 ******************************************************/
923
924 /*******************************************************
925 * Woodmart theme cart page hook for cross-sell reverting...
926 *******************************************************/
927
928 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10 );
929
930 /**
931 * End of Woodmart theme hook reverting
932 ******************************************************/
933
934 /*******************************************************
935 * Electro theme hook reverting
936 ******************************************************/
937 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
938
939 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
940 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
941
942 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
943 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
944
945 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
946 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
947 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
948 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
949 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
950
951 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
952 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
953 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
954 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
955
956 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
957 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
958 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
959 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
960 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
961
962 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
963 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
964 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
965 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
966 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
967
968 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
969 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
970 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
971 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
972
973 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
974 $this->remove_action_if_exists('woocommerce_get_price_html', 'electro_wrap_price_html', 90);
975 /**
976 * Electro of Neve theme hook reverting
977 ******************************************************/
978 }
979
980 public function theme_conflicts_in_elementor_editor_related_products() {
981
982 /*******************************************************
983 * OceanWP theme cart page hook for cross-sell reverting..
984 ******************************************************/
985
986 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
987 $this->add_action_if_not_exists('woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);
988
989 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
990
991 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
992
993 $this->remove_action_if_found_14('woocommerce_cart_collaterals', '\OceanWP_WooCommerce_Config', 'cross_sell_display');
994 $this->remove_action_if_found_14('woocommerce_after_single_product_summary', '\OceanWP_WooCommerce_Config', 'upsell_display');
995 $this->remove_action_if_found_14('ocean_after_product_entry_image', '\OceanWP_WooCommerce_Config', 'quick_view_button');
996 $this->remove_action_if_found_14('ocean_after_product_entry_slider', '\OceanWP_WooCommerce_Config', 'quick_view_button');
997
998 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
999 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
1000 $this->remove_action_if_found_14('woocommerce_before_template_part', '\OceanWP_WooCommerce_Config', 'before_template_part');
1001 $this->add_action_if_not_exists('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display');
1002 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10);
1003 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5);
1004 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
1005 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
1006 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
1007 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
1008 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
1009 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
1010
1011 /**
1012 * End of OceanWP theme hook reverting
1013 ******************************************************/
1014
1015
1016
1017 /*******************************************************
1018 * Porto theme cart page hook for cross-sell reverting...
1019 *
1020 ******************************************************/
1021
1022 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10 );
1023 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1 );
1024 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100 );
1025 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title' );
1026 $this->remove_action_if_exists( 'woocommerce_before_shop_loop', 'woocommerce_pagination', 50 );
1027 $this->add_action_if_not_exists( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
1028
1029 /**
1030 * End of Porto theme hook reverting
1031 ******************************************************/
1032
1033 /*******************************************************
1034 * Woodmart theme cart page hook for cross-sell reverting...
1035 *******************************************************/
1036
1037 $this->remove_action_if_exists( 'woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10 );
1038
1039 /**
1040 * End of Woodmart theme hook reverting
1041 ******************************************************/
1042
1043 /*******************************************************
1044 * Astra theme hook reverting
1045 ******************************************************/
1046 $this->remove_action_if_found_14( 'woocommerce_product_get_rating_html', '\Astra_Woocommerce', 'rating_markup' );
1047 $this->add_action_if_not_exists( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
1048 /**
1049 * End of Astra theme hook reverting
1050 ******************************************************/
1051
1052 /*******************************************************
1053 * Neve theme hook reverting
1054 ******************************************************/
1055 $this->remove_action_if_found_14( 'woocommerce_before_shop_loop_item','\Neve\Views\Product_Layout', 'card_content_wrapper' );
1056 $this->remove_action_if_found_14( 'woocommerce_before_shop_loop_item_title','\Neve\Views\Product_Layout', 'product_image_wrap' );
1057 $this->remove_action_if_found_14( 'woocommerce_before_shop_loop_item','\Neve\Views\Product_Layout', 'card_content_wrapper', 1);
1058 $this->remove_action_if_found_14( 'woocommerce_after_shop_loop_item','\Neve\Views\Product_Layout', 'wrapper_close_div', 100);
1059 $this->remove_action_if_found_14( 'woocommerce_before_shop_loop_item_title','\Neve\Views\Product_Layout', 'out_of_stock_badge' );
1060 $this->remove_action_if_found_14( 'woocommerce_before_shop_loop_item_title','\Neve\Views\Product_Layout', 'wrapper_close_div' );
1061 /**
1062 * End of Neve theme hook reverting
1063 ******************************************************/
1064
1065 /*******************************************************
1066 * Electro theme hook reverting
1067 ******************************************************/
1068 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
1069
1070 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
1071 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
1072
1073 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
1074 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
1075
1076 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
1077 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
1078 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
1079 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
1080 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
1081
1082 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
1083 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
1084 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
1085 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
1086
1087 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
1088 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
1089 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
1090 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
1091 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
1092
1093 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
1094 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
1095 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
1096 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
1097 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
1098
1099 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
1100 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
1101 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
1102 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
1103
1104 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
1105 $this->remove_action_if_exists('woocommerce_get_price_html', 'electro_wrap_price_html', 90);
1106 /**
1107 * Electro of Neve theme hook reverting
1108 ******************************************************/
1109
1110 }
1111
1112
1113 public function theme_conflicts_my_account_page() {
1114
1115 $this->remove_action_if_exists('woocommerce_account_dashboard', 'woodmart_my_account_links');
1116 $this->remove_action_if_exists('woocommerce_account_dashboard', 'flatsome_my_account_dashboard');
1117 }
1118
1119
1120 public function theme_conflicts__archive_products_widget_during_render() {
1121
1122 $this->remove_action_if_exists('woocommerce_shop_loop', 'electro_shop_loop');
1123
1124 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_open', 1 );
1125 $this->remove_action_if_exists( 'woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title_close', 100 );
1126 }
1127
1128
1129 public function theme_conflicts_in_specific_footer_area() {
1130
1131 $this->remove_action_if_found_14('wp_footer', '\OceanWP_WooCommerce_Config', 'get_mini_cart_sidebar');
1132 }
1133
1134
1135 public function theme_conflicts_archive_page_after_wp_loaded() {
1136
1137 /**
1138 * Neve theme
1139 */
1140 $this->remove_action_if_exists('neve_bc_count', 'woocommerce_result_count');
1141 $this->remove_action_if_exists('nv_woo_header_bits', 'woocommerce_catalog_ordering', 30);
1142 $this->remove_action_if_exists('neve_bc_count', 'woocommerce_breadcrumb');
1143
1144 /**
1145 * Hestia theme
1146 */
1147 $this->remove_action_if_exists('woocommerce_before_main_content', 'hestia_woocommerce_before_main_content', 10);
1148 $this->remove_action_if_exists('woocommerce_after_main_content', 'hestia_woocommerce_after_main_content', 9);
1149
1150
1151 /**
1152 * flatsome header hooks reverting to remove the woocommerce default sorting
1153 */
1154 $this->remove_action_if_exists('flatsome_breadcrumb', 'woocommerce_breadcrumb', 20);
1155 $this->remove_action_if_exists('flatsome_after_header', 'flatsome_category_header');
1156
1157 /**
1158 * Electro theme
1159 */
1160 //$this->remove_action_if_exists('woocommerce_shop_loop', 'electro_shop_loop', 10);
1161 }
1162
1163
1164 public function theme_conflicts_in_editor__archive_products_widget() {
1165
1166 /**
1167 * Storefront theme
1168 */
1169 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_sorting_wrapper', 9);
1170 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10);
1171 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_result_count', 20);
1172 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_woocommerce_pagination', 30);
1173 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'storefront_sorting_wrapper_close', 31);
1174
1175 /**
1176 * Porto Theme
1177 */
1178 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'porto_woocommerce_open_before_clearfix_div', 11);
1179 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'porto_woocommerce_close_before_clearfix_div', 80);
1180 $this->remove_action_if_exists('woocommerce_after_shop_loop', 'porto_woocommerce_open_after_clearfix_div', 1);
1181 $this->remove_action_if_exists('woocommerce_after_shop_loop', 'porto_woocommerce_close_after_clearfix_div', 999);
1182 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'porto_grid_list_toggle', 70);
1183 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woocommerce_pagination', 50);
1184 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'porto_loop_product_thumbnail', 10);
1185 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'porto_woocommerce_shop_loop_item_title');
1186 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail');
1187 $this->add_action_if_not_exists('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open');
1188 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close');
1189
1190 /**
1191 * xstore theme
1192 */
1193 $this->remove_action_if_exists('woocommerce_sale_flash', 'etheme_woocommerce_sale_flash', 20);
1194 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'etheme_grid_list_switcher', 35);
1195 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'etheme_products_per_page_select', 37);
1196
1197
1198 /**
1199 * oceanwp theme
1200 */
1201 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'add_shop_loop_div');
1202 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'close_shop_loop_div');
1203 $this->remove_action_if_found_14('woocommerce_before_template_part', '\OceanWP_WooCommerce_Config', 'before_template_part');
1204 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'grid_list_buttons');
1205 $this->remove_action_if_found_14('woocommerce_before_shop_loop', '\OceanWP_WooCommerce_Config', 'result_count');
1206 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item', '\OceanWP_WooCommerce_Config', 'add_shop_loop_item_inner_div');
1207 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'close_shop_loop_item_inner_div');
1208 $this->remove_action_if_found_14('woocommerce_before_shop_loop_item_title', '\OceanWP_WooCommerce_Config', 'loop_product_thumbnail');
1209 $this->remove_action_if_found_14('woocommerce_after_shop_loop_item', '\OceanWP_WooCommerce_Config', 'archive_product_content');
1210
1211 $this->add_action_if_not_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
1212 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
1213 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
1214 $this->add_action_if_not_exists('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
1215
1216 /**
1217 * woodmart theme
1218 */
1219 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woodmart_show_sidebar_btn', 25);
1220 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'woodmart_products_per_page_select', 25);
1221 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10);
1222
1223 /**
1224 * Electro theme
1225 */
1226 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'electro_shop_control_bar', 11);
1227 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'electro_wrap_add_to_cart_link', 90);
1228 $this->remove_action_if_exists('woocommerce_loop_add_to_cart_link', 'redux_apply_catalog_mode_for_product_loop', 85);
1229
1230 $this->remove_action_if_exists('electro_product_item_hover_area', 'electro_loop_action_buttons', 10);
1231 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_outer', 0);
1232 $this->remove_action_if_exists('woocommerce_before_shop_loop_item', 'electro_wrap_product_inner', 10);
1233 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_header_open', 15);
1234 $this->remove_action_if_exists('woocommerce_before_shop_loop_item_title', 'electro_template_loop_categories', 20);
1235 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 25);
1236 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 30);
1237 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_product_thumbnail', 40);
1238 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 45);
1239 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_header_close', 46);
1240 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_body_open', 47);
1241 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'electro_template_loop_categories', 50);
1242 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 55);
1243 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 60);
1244 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70);
1245 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_excerpt', 80);
1246 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_product_sku', 90);
1247 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 95);
1248 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_body_close', 96);
1249 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_template_loop_footer_open', 98);
1250 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart', 100);
1251 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 110);
1252 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 120);
1253 $this->remove_action_if_exists('woocommerce_after_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 130);
1254 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_hover', 140);
1255 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_template_loop_footer_close', 145);
1256 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_inner_close', 150);
1257 $this->remove_action_if_exists('woocommerce_after_shop_loop_item', 'electro_wrap_product_outer_close', 160);
1258 $this->remove_action_if_exists('woocommerce_before_shop_loop', 'electro_wc_loop_title', 10);
1259
1260 /**
1261 * Flatsome theme
1262 */
1263 $this->remove_action_if_exists('woocommerce_shop_loop_item_title', 'flatsome_woocommerce_shop_loop_category', 0);
1264 }
1265
1266
1267 /**
1268 * This is a code of 14th class for some very tricky position we are
1269 * It is totally possible to get wrong instance priority with this function, hence the wrong action removed but practically highly unlikely :fingercross
1270 *
1271 *
1272 * @param $tag
1273 * @param $class_name - must a full qualified class name
1274 * @param $instance_method
1275 * @param int $spl_hash_length - this is 32 right now [https://github.com/php/php-src/blob/82ccd47d397314d82feeb90b055625f0fcc9bde4/ext/spl/php_spl.c], or $ln = strlen(spl_object_hash( new stdClass()))
1276 * @return bool|int|string
1277 */
1278 private function has_filter_14($tag, $class_name, $instance_method, $spl_hash_length = 32) {
1279
1280 if(has_action($tag)) {
1281
1282 global $wp_filter;
1283
1284 $callbacks = $wp_filter[$tag]->callbacks;
1285
1286 if(!empty($callbacks)) {
1287
1288 foreach($callbacks as $priority => $arr) {
1289
1290 foreach($arr as $ky => $conf) {
1291
1292 if(strpos($ky, $instance_method) !== false) {
1293
1294 if($ky == $class_name . '::' . $instance_method) {
1295 return true;
1296 }
1297
1298 if(isset($conf['function'][0]) && $conf['function'][0] instanceof $class_name) {
1299
1300 $rem = str_replace($instance_method, '', $ky);
1301
1302 return strlen($rem) == $spl_hash_length ? $priority : false;
1303 }
1304 }
1305 }
1306 }
1307 }
1308 }
1309
1310 return false;
1311 }
1312
1313 /**
1314 * @param $tag
1315 * @param $class_name
1316 * @param $instance_method
1317 * @param $priority
1318 * @param int $spl_hash_length
1319 * @return bool
1320 */
1321 private function remove_action_14($tag, $class_name, $instance_method, $priority, $spl_hash_length = 32) {
1322
1323 if($priority === false) {
1324 return false;
1325 }
1326
1327 global $wp_filter;
1328
1329 if(!empty($wp_filter[$tag]->callbacks[$priority])) {
1330
1331 foreach($wp_filter[$tag]->callbacks[$priority] as $ky => $conf) {
1332
1333 if(strpos($ky, $instance_method) !== false) {
1334
1335 if($ky == $class_name . '::' . $instance_method) {
1336
1337 unset($wp_filter[$tag]->callbacks[$priority][$ky]);
1338
1339 return true;
1340 }
1341
1342 $rem = str_replace($instance_method, '', $ky);
1343
1344 if(strlen($rem) == $spl_hash_length) {
1345
1346 unset($wp_filter[$tag]->callbacks[$priority][$ky]);
1347
1348 return true;
1349 }
1350 }
1351 }
1352 }
1353
1354 return false;
1355 }
1356
1357 /**
1358 * Are you wandering about the number 14? :D, why??
1359 * Still nosy? - because this is a hacky solution for an awkward situation we are in!
1360 *
1361 * @param $tag
1362 * @param $class_name - full qualified class name
1363 * @param $instance_method
1364 * @return bool
1365 */
1366 private function remove_action_if_found_14($tag, $class_name, $instance_method) {
1367
1368 $priority = $this->has_filter_14($tag, $class_name, $instance_method);
1369
1370
1371 return $this->remove_action_14($tag, $class_name, $instance_method, $priority);
1372 }
1373
1374
1375 private function remove_action_if_exists($tag, $func, $priority = null) {
1376
1377 if($priority === null) {
1378
1379 if(has_action($tag, $func) !== false) {
1380
1381 remove_action($tag, $func);
1382 }
1383
1384 return;
1385 }
1386
1387
1388 if(has_action($tag, $func) !== false) {
1389
1390 remove_action($tag, $func, intval($priority));
1391 }
1392
1393 return;
1394 }
1395
1396
1397 private function add_action_if_not_exists($tag, $func, $priority = null) {
1398
1399 if($priority === null) {
1400
1401 if(has_action($tag, $func) === false) {
1402
1403 add_action($tag, $func);
1404 }
1405
1406 return;
1407 }
1408
1409 if(has_action($tag, $func) === false) {
1410
1411 add_action($tag, $func, intval($priority));
1412 }
1413
1414 return;
1415 }
1416 }
1417