# shopbuilder/2.1.0/app/Elementor/Widgets/General/Notice.php

ShopBuilder – WooCommerce Builder For Elementor, version 2.1.0. 85 lines.

- Page: https://pluginprobe.com/plugins/shopbuilder/2.1.0/code/app/Elementor/Widgets/General/Notice.php
- Raw: https://pluginprobe.com/plugins/shopbuilder/2.1.0/raw/app/Elementor/Widgets/General/Notice.php
- Modified: 2024-01-05T06:10:40+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/2.1.0/code/app/Elementor/Widgets/General/Notice.php#L10-L20`.

```php
<?php
/**
 * Main ProductDescription class.
 *
 * @package RadiusTheme\SB
 */

namespace RadiusTheme\SB\Elementor\Widgets\General;

use RadiusTheme\SB\Helpers\Fns;
use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
use RadiusTheme\SB\Elementor\Widgets\Controls\NoticeSettings;
use RadiusTheme\SB\Helpers\BuilderFns;

// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
	exit( 'This script cannot be accessed directly.' );
}

/**
 * Product Description class
 */
class Notice 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__( 'Notice', 'shopbuilder' );
		$this->rtsb_base = 'rtsb-wc-notice';
		parent::__construct( $data, $args );
		$this->rtsb_category = 'rtsb-shopbuilder-general';
	}
	/**
	 * Widget Field
	 *
	 * @return array
	 */
	public function widget_fields() {
		return NoticeSettings::widget_fields( $this );
	}
	/**
	 * Set Widget Keyword.
	 *
	 * @return array
	 */
	public function get_keywords() {
		return [ 'Notice' ] + parent::get_keywords();
	}
	/**
	 * Render Function
	 *
	 * @return void
	 */
	protected function render() {
		$controllers = $this->get_settings_for_display();
        $this->theme_support();
		$data        = [
			'template'    => 'elementor/general/notice',
			'controllers' => $controllers,
		];
		if ( $this->is_builder_mode() ) {  //$type = BuilderFns::builder_type( get_the_ID() ); ?>
            <div class="rtsb-notice">
                <div class="woocommerce-notices-wrapper">
                    <div class="woocommerce-message" role="alert">
                        <a href="#" tabindex="1" class="button wc-forward">
                            <?php esc_html_e( 'Demo Button', 'shopbuilder' ); ?>
                        </a>
                        <?php esc_html_e( '“Demo” This is demo preview for message notice.', 'shopbuilder' ); ?>
                    </div>
                    <ul class="woocommerce-error" role="alert">
                        <li> <strong>Error:</strong> This is demo preview for error notice</li>
                    </ul>
                </div>
            </div>
        <?php } else {
			Fns::load_template( $data['template'], $data );
		};
        $this->theme_support( 'render_reset' );
	}

}

```
