PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.8.7
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.8.7
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 / core / page-templates / hooks / cart.php
shopengine / core / page-templates / hooks Last commit date
archive.php 7 months ago base-content.php 2 years ago base.php 1 year ago cart.php 7 months ago checkout.php 7 months ago shop.php 4 years ago single.php 7 months ago
cart.php
93 lines
1 <?php
2
3 namespace ShopEngine\Core\Page_Templates\Hooks;
4
5 defined('ABSPATH') || exit;
6
7 use ShopEngine\Core\Builders\Templates;
8 use ShopEngine\Utils\Shipping_Calculation;
9
10 class Cart extends Base {
11
12 protected $page_type = 'cart';
13 protected $template_part = 'content-cart.php';
14
15 public function init() : void {
16
17 add_action('woocommerce_shipping_init', function () {
18 \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_filter();
19 });
20
21 add_action('template_redirect', function () {
22 Shipping_Calculation::output();
23 });
24
25 // add_action('wp_loaded', [$this, 'delayed_hook_conflicts'], 9999);
26 $this->delayed_hook_conflicts();
27
28 do_action( 'woocommerce_check_cart_items' );
29
30 // Dequeue Facebook Pixel script if active
31 add_action('wp_enqueue_scripts', function () {
32 if(is_plugin_active('pixelyoursite/facebook-pixel-master.php')) {
33
34 wp_dequeue_script('pys');
35 }
36
37 $themeName = get_template();
38 if ($themeName == 'phlox-pro') {
39
40 wp_dequeue_style('auxin-elementor-base');
41 }
42
43 }, 20);
44 }
45
46 public function delayed_hook_conflicts() {
47
48 $themeName = get_template();
49
50 if ( $themeName == 'porto' ) {
51 remove_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display', 20 );
52 }
53
54
55 if( $themeName == 'woostify' ) {
56 remove_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display' );
57 remove_filter( 'woocommerce_cross_sells_columns', 'woostify_cross_sell_display_columns' );
58 }
59
60 // revert this hook for cart page and editor mode
61 if ( $themeName == 'flatsome' || $themeName == 'hestia' ) {
62 add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
63 remove_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display' );
64 }
65
66 if ( is_plugin_active( 'auxin-shop/auxin-shop.php' ) ) {
67
68 remove_filter('wc_get_template', 'auxshp_get_wc_template', 11, 2);
69
70 // Remove Auxin Shop template loader filter
71 global $wp_filter;
72 if (isset($wp_filter['woocommerce_locate_template'])) {
73 foreach ($wp_filter['woocommerce_locate_template']->callbacks as $priority => $callbacks) {
74 foreach ($callbacks as $key => $callback) {
75 if (is_array($callback['function']) &&
76 is_object($callback['function'][0]) &&
77 get_class($callback['function'][0]) === 'AUXSHP_Template_Loader' &&
78 $callback['function'][1] === 'load_templates') {
79 unset($wp_filter['woocommerce_locate_template']->callbacks[$priority][$key]);
80 }
81 }
82 }
83 }
84 }
85 }
86
87 protected function template_include_pre_condition(): bool {
88 //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here
89 return (is_cart() || (isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] == 'update_shipping_method'));
90 }
91
92 }
93