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