'woo_purchase_products' => __( 'Purchased Products', 'premium-addons-for-elementor' ),
),
),
)
);
}
$options = apply_filters( 'pa_display_conditions', $options );
$element->add_control(
'pa_display_conditions_switcher',
array(
'label' => __( 'Enable Display Conditions', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'render_type' => 'template',
'prefix_class' => 'pa-display-conditions-',
'frontend_available' => true,
)
);
$element->add_control(
'pa_display_action',
array(
'label' => __( 'Action', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'show',
'options' => array(
'show' => __( 'Show Element', 'premium-addons-for-elementor' ),
'hide' => __( 'Hide Element', 'premium-addons-for-elementor' ),
),
'condition' => array(
'pa_display_conditions_switcher' => 'yes',
),
)
);
$element->add_control(
'pa_display_when',
array(
'label' => __( 'Display When', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'any',
'options' => array(
'all' => __( 'All Conditions Are Met', 'premium-addons-for-elementor' ),
'any' => __( 'Any Condition is Met', 'premium-addons-for-elementor' ),
),
'condition' => array(
'pa_display_conditions_switcher' => 'yes',
),
)
);
$repeater = new Repeater();
$repeater->add_control(
'pa_condition_key',
array(
'label' => __( 'Type', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'groups' => $options,
'default' => 'browser',
'label_block' => true,
)
);
$options_conditions = apply_filters(
'pa_pro_display_conditions',
array(
'url_string',
'url_referer',
'shortcode',
'woo_orders',
'woo_cat_page',
'woo_category',
'woo_product_price',
'woo_product_stock',
'woo_product_cat',
'woo_last_purchase',
'woo_total_price',
'woo_purchase_products',
'woo_cart_products',
'acf_choice',
'acf_text',
'acf_boolean',
)
);
$get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'conditions-addon', 'wp-editor', 'get-pro' );
$repeater->add_control(
'display_conditions_notice',
array(
'type' => Controls_Manager::RAW_HTML,
'raw' => __( 'This option is available in Premium Addons Pro.', 'premium-addons-for-elementor' ) . '' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '',
'content_classes' => 'papro-upgrade-notice',
'condition' => array(
'pa_condition_key' => $options_conditions,
),
)
);
$controls_obj->add_repeater_source_controls( $repeater );
$repeater->add_control(
'pa_condition_operator',
array(
'type' => Controls_Manager::SELECT,
'default' => 'is',
'label_block' => true,
'options' => array(
'is' => __( 'Is', 'premium-addons-for-elementor' ),
'not' => __( 'Is Not', 'premium-addons-for-elementor' ),
),
'condition' => array(
'pa_condition_key!' => $options_conditions,
),
)
);
$controls_obj->add_repeater_compare_controls( $repeater );
$repeater->add_control(
'pa_condition_timezone',
array(
'label' => 'Timezone',
'type' => Controls_Manager::SELECT,
'default' => 'server',
'label_block' => true,
'options' => array(
'local' => __( 'Local Time', 'premium-addons-for-elementor' ),
'server' => __( 'Server Timezone', 'premium-addons-for-elementor' ),
),
'condition' => array(
'pa_condition_key' => array( 'date_range', 'time_range', 'date', 'day' ),
),
)
);
$repeater->add_control(
'pa_condition_loc_method',
array(
'label' => __( 'Location Detect Method', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'old',
'label_block' => true,
'options' => array(
'old' => __( 'Old', 'premium-addons-for-elementor' ),
'new' => __( 'New', 'premium-addons-for-elementor' ),
),
'condition' => array(
'pa_condition_key' => 'ip_location',
),
)
);
$should_apply = apply_filters( 'pa_display_conditions_values', true );
$values = $repeater->get_controls();
if ( $should_apply ) {
// $values = array_values( $values );
}
$element->add_control(
'pa_condition_repeater',
array(
'label' => __( 'Conditions', 'premium-addons-for-elementor' ),
'type' => Controls_Manager::REPEATER,
'label_block' => true,
'fields' => $values,
'title_field' => '<# print( pa_condition_key.replace(/_/g, " ").split(" ").map((s) => s.charAt(0).toUpperCase() + s.substring(1)).join(" ")) #>',
'prevent_empty' => false,
'condition' => array(
'pa_display_conditions_switcher' => 'yes',
),
)
);
$this->add_helpful_information( $element );
$element->end_controls_section();
}
/**
* Add Help & Docs
*
* @since 4.9.39
* @access private
* @param object $element for current element.
*/
private function add_helpful_information( $element ) {
$element->add_control(
'pa_condition_info',
array(
'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
'separator' => 'before',
'type' => Controls_Manager::HEADING,
'condition' => array(
'pa_display_conditions_switcher' => 'yes',
),
)
);
$docs = array(
'https://premiumaddons.com/docs/elementor-display-conditions-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
'https://premiumaddons.com/docs/elementor-editor-not-loading-with-display-conditions/' => __( 'Fix editor not loading with Display Conditions enabled »', 'premium-addons-for-elementor' ),
'https://premiumaddons.com/docs/how-to-show-hide-element-based-on-browser-elementor-display-conditions/' => __( 'Show/Hide Element Based on Browser »', 'premium-addons-for-elementor' ),
'https://premiumaddons.com/docs/how-to-show-hide-element-on-specific-time-range-elementor-display-conditions/' => __( 'Show/Hide Element Based on Time Range »', 'premium-addons-for-elementor' ),
'https://premiumaddons.com/docs/how-to-show-hide-element-with-location-elementor-display-conditions/' => __( 'Show/Hide Element Based on Location »', 'premium-addons-for-elementor' ),
);
$doc_index = 1;
foreach ( $docs as $url => $title ) {
$doc_url = Helper_Functions::get_campaign_link( $url, 'conditions-addon', 'wp-editor', 'get-support' );
$element->add_control(
'pa_condition_doc_' . $doc_index,
array(
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf( '%s', $doc_url, $title ),
'content_classes' => 'editor-pa-doc',
'condition' => array(
'pa_display_conditions_switcher' => 'yes',
),
)
);
++$doc_index;
}
}
/**
* Check Script Enqueue
*
* Check if the script files should be loaded.
*
* @since 4.9.21
* @access public
*
* @param object $element for current element.
*/
public function check_script_enqueue( $element ) {
if ( self::$load_script ) {
return;
}
$settings = $element->get_active_settings();
if ( ! empty( $settings[ 'pa_display_conditions_switcher' ] ) ) {
$this->enqueue_scripts();
self::$load_script = true;
remove_action( 'elementor/frontend/before_render', array( $this, 'check_script_enqueue' ) );
}
}
/**
* Returns an instance of this class.
*
* @access public
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
}
Fatal error: Uncaught Error: Class 'PremiumAddons\Modules\PA_Display_Conditions\Module' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/premium-addons-for-elementor/includes/addons-integration.php:1727
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/premium-addons-for-elementor/includes/addons-integration.php(111): PremiumAddons\Includes\Addons_Integration->load_pa_extensions()
#1 /var/www/html/dportilho.com.br/web/wp-content/plugins/premium-addons-for-elementor/includes/addons-integration.php(1790): PremiumAddons\Includes\Addons_Integration->__construct()
#2 /var/www/html/dportilho.com.br/web/wp-content/plugins/premium-addons-for-elementor/includes/class-pa-core.php(102): PremiumAddons\Includes\Addons_Integration::get_instance()
#3 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(324): PremiumAddons\Includes\PA_Core->pa_init('')
#4 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#5 /var/www/html/dportilho.c in /var/www/html/dportilho.com.br/web/wp-content/plugins/premium-addons-for-elementor/includes/addons-integration.php on line 1727