# shopbuilder/1.1.4/app/Elementor/Widgets/Cart/CartTable.php

ShopBuilder – WooCommerce Builder For Elementor, version 1.1.4. 99 lines.

- Page: https://pluginprobe.com/plugins/shopbuilder/1.1.4/code/app/Elementor/Widgets/Cart/CartTable.php
- Raw: https://pluginprobe.com/plugins/shopbuilder/1.1.4/raw/app/Elementor/Widgets/Cart/CartTable.php
- Modified: 2023-07-11T10:48:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shopbuilder/1.1.4/code/app/Elementor/Widgets/Cart/CartTable.php#L10-L20`.

```php
<?php
/**
 * Main ProductDescription class.
 *
 * @package RadiusTheme\SB
 */

namespace RadiusTheme\SB\Elementor\Widgets\Cart;

use RadiusTheme\SB\Helpers\Fns;
use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
use RadiusTheme\SB\Elementor\Widgets\Controls\CartTableSettings;

// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
	exit( 'This script cannot be accessed directly.' );
}

/**
 * Product Description class
 */
class CartTable extends ElementorWidgetBase {
	/**
	 * Construct function
	 *
	 * @param array $data default array.
	 * @param mixed $args default arg.
	 */
	public function __construct( $data = [], $args = null ) {
		$this->rtsb_name = esc_html__( 'Cart Table', 'shopbuilder' );
		$this->rtsb_base = 'rtsb-product-carttable';
		parent::__construct( $data, $args );
	}
	/**
	 * Widget Field
	 *
	 * @return array
	 */
	public function widget_fields() {
		$fields = CartTableSettings::widget_fields( $this );
		return apply_filters( 'rtsb/elements/elementor/cart/' . $this->rtsb_base, $fields, $this );
	}
	/**
	 * Set Widget Keyword.
	 *
	 * @return array
	 */
	public function get_keywords() {
		return [ 'Cart' ] + parent::get_keywords();
	}
	/**
	 * Set Widget Keyword.
	 *
	 * @return array
	 */
	public function cart_empty_message() {
		$controllers = $this->get_settings_for_display();
		return $controllers['cart_empty_message'];
	}
	/**
	 * Set Widget Keyword.
	 *
	 * @return array
	 */
	public function return_to_shop_text() {
		$controllers = $this->get_settings_for_display();
		return $controllers['return_to_shop_text'];
	}
	/**
	 * Render Function
	 *
	 * @return void
	 */
	protected function render() {
		$controllers = $this->get_settings_for_display();
        $this->theme_support();
		$data        = [
			'template'    => 'elementor/cart/cart-table',
			'controllers' => $controllers,
			'is_builder'  => $this->is_builder_mode(),
		];
		if ( $data['is_builder'] ) {
			wc_load_cart();
		}

		if ( ! empty( $controllers['cart_empty_message'] ) ) {
			add_filter( 'wc_empty_cart_message', [ $this, 'cart_empty_message' ] );
		}

		if ( ! empty( $controllers['return_to_shop_text'] ) ) {
			add_filter( 'woocommerce_return_to_shop_text', [ $this, 'return_to_shop_text' ] );
		}
		
		Fns::load_template( $data['template'], $data );
        $this->theme_support( 'render_reset' );
	}

}

```
