PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.1
ShopBuilder – WooCommerce Builder For Elementor v3.2.1
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.2.1, at app/Elementor/Widgets/Checkout/OrderReview.php

94 lines 2.0 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\Elementor\Widgets\Controls\OrderReviewSettings;
13
14 // Do not allow directly accessing this file.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit( 'This script cannot be accessed directly.' );
17 }
18
19 /**
20 * Product Description class
21 */
22 class OrderReview extends ElementorWidgetBase {
23 /**
24 * Construct function
25 *
26 * @param array $data default array.
27 * @param mixed $args default arg.
28 */
29 public function __construct( $data = [], $args = null ) {
30 $this->rtsb_name = esc_html__( 'Order Review', 'shopbuilder' );
31 $this->rtsb_base = 'rtsb-order-review';
32 parent::__construct( $data, $args );
33 }
34
35 /**
36 * Widget Field
37 *
38 * @return array
39 */
40 public function widget_fields() {
41 return OrderReviewSettings::widget_fields( $this );
42 }
43
44 /**
45 * Widget Field.
46 *
47 * @return void
48 */
49 public function apply_hooks() {
50 // Remove Payment Button.
51 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment' );
52 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
53 // Germanized for WooCommerce.
54 if ( function_exists( 'woocommerce_gzd_template_order_submit' ) ) {
55 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_gzd_template_order_submit', 21 );
56 }
57 }
58
59 /**
60 * Set Widget Keyword.
61 *
62 * @return array
63 */
64 public function get_keywords() {
65 return [ 'Checkout' ] + parent::get_keywords();
66 }
67
68 /**
69 * Render Function
70 *
71 * @return void
72 */
73 protected function render() {
74 if ( $this->has_checkout_restriction() ) {
75 return;
76 }
77 $this->apply_hooks();
78 $this->theme_support();
79
80 $data = [
81 'template' => 'elementor/checkout/order-review',
82 'controllers' => $this->get_settings_for_display(),
83 ];
84
85 if ( $this->is_builder_mode() ) {
86 wc_load_cart();
87 }
88
89 Fns::load_template( $data['template'], $data );
90
91 $this->theme_support( 'render_reset' );
92 }
93 }
94