Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
home
/
drleilu
/
www
/
wp-content
/
themes
/
luxia
/
inc
/
includes
/
integrations
/
elementor
/
widgets
/
✏️
Editing: product.php
<?php namespace Elementor; if (!defined('ABSPATH')) exit; // Exit if accessed directly class Elementor_product extends Widget_Base { public function get_name() { return 'Elementor-product-widget'; } public function get_title() { return __('Zc > Product', 'luxia'); } public function get_icon() { return 'eicon-icon-box'; } protected function _register_controls() { $traits = new \luxia_Elementor_Traits($this); $this->start_controls_section('section_tab', ['label' => esc_html__('Product', 'luxia'),]); $this->add_control( 'text_heading', [ 'label' => esc_html__( 'Text Heading' ,'luxia'), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'symbol_img', [ 'label' => esc_html__( 'Symbol Image' ,'luxia'), 'type' => Controls_Manager::MEDIA, ] ); $this->add_control( 'posts_per_page', [ 'label' => esc_html__( 'Number of items to show', 'luxia' ), 'type' => Controls_Manager::NUMBER, 'default' => 6, ] ); $this->add_control( 'style', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__('Choose Style', 'luxia'), 'default' => 'style1', 'label_block' => true, 'options' => [ 'style1' => esc_html__('Product Normal', 'luxia'), 'style2' => esc_html__('Product Filter', 'luxia'), 'style3' => esc_html__('Product Carousel', 'luxia'), ], ] ); $this->end_controls_section(); } protected function render($instance = []) { $settings = $this->get_settings(); $text_heading = $settings[ 'text_heading' ]; $symbol_img = $settings[ 'symbol_img' ]; $posts_per_page = $settings['posts_per_page']; $style = $settings['style']; switch ($style) { case 'style1': require get_template_directory() . '/inc/sections/product/style1.php'; break; case 'style2': require get_template_directory() . '/inc/sections/prouct/style2.php'; break; case 'style3': require get_template_directory() . '/inc/sections/product/style3.php'; break; } } protected function content_template() {} public function render_plain_content() {} } Plugin::instance()->widgets_manager->register_widget_type(new Elementor_product());
💾 Save
❌ Cancel