PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.6.9
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.6.9
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 2 years ago base-content.php 2 years ago base.php 3 years ago cart.php 2 years ago checkout.php 2 years ago shop.php 4 years ago single.php 2 years ago
cart.php
52 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
31 public function delayed_hook_conflicts() {
32
33 $themeName = get_template();
34
35 if ( $themeName == 'porto' ) {
36 remove_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display', 20 );
37 }
38
39 // revert this hook for cart page and editor mode
40 if ( $themeName == 'flatsome' || $themeName == 'hestia' ) {
41 add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
42 remove_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display' );
43 }
44 }
45
46 protected function template_include_pre_condition(): bool {
47 //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here
48 return (is_cart() || (isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] == 'update_shipping_method'));
49 }
50
51 }
52