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