PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.2
ShopBuilder – WooCommerce Builder For Elementor v3.4.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Checkout / OrderReview.php

OrderReview.php in ShopBuilder – WooCommerce Builder For Elementor 3.4.2, at app/Elementor/Widgets/Checkout/OrderReview.php

104 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductDescription class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Checkout;
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
12 use RadiusTheme\SB\Controllers\Frontend\OrderReviewQuantity;
13 use RadiusTheme\SB\Elementor\Widgets\Controls\OrderReviewSettings;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Product Description class
22 */
23 class OrderReview extends ElementorWidgetBase {
24 /**
25 * Construct function
26 *
27 * @param array $data default array.
28 * @param mixed $args default arg.
29 */
30 public function __construct( $data = [], $args = null ) {
31 $this->rtsb_name = esc_html__( 'Order Review', 'shopbuilder' );
32 $this->rtsb_base = 'rtsb-order-review';
33 parent::__construct( $data, $args );
34 }
35
36 /**
37 * Widget Field
38 *
39 * @return array
40 */
41 public function widget_fields() {
42 return OrderReviewSettings::widget_fields( $this );
43 }
44
45 /**
46 * Widget Field.
47 *
48 * @param array $controllers Widget settings.
49 *
50 * @return void
51 */
52 public function apply_hooks( $controllers = [] ) {
53 // Editable quantity inside the review table.
54 if ( ! empty( $controllers['show_quantity'] ) ) {
55 OrderReviewQuantity::instance()->enable();
56 }
57
58 // Remove Payment Button.
59 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment' );
60 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
61 // Germanized for WooCommerce.
62 if ( function_exists( 'woocommerce_gzd_template_order_submit' ) ) {
63 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_gzd_template_order_submit', 21 );
64 }
65 }
66
67 /**
68 * Set Widget Keyword.
69 *
70 * @return array
71 */
72 public function get_keywords() {
73 return [ 'Checkout' ] + parent::get_keywords();
74 }
75
76 /**
77 * Render Function
78 *
79 * @return void
80 */
81 protected function render() {
82 if ( $this->has_checkout_restriction() ) {
83 return;
84 }
85 $controllers = $this->get_settings_for_display();
86
87 $this->apply_hooks( $controllers );
88 $this->theme_support();
89
90 $data = [
91 'template' => 'elementor/checkout/order-review',
92 'controllers' => $controllers,
93 ];
94
95 if ( $this->is_builder_mode() ) {
96 wc_load_cart();
97 }
98
99 Fns::load_template( $data['template'], $data );
100
101 $this->theme_support( 'render_reset' );
102 }
103 }
104