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