diff --git a/wp-content/plugins/elementor-addon/elementor-addon.php b/wp-content/plugins/elementor-addon/elementor-addon.php
index 781cadd..e863440 100644
--- a/wp-content/plugins/elementor-addon/elementor-addon.php
+++ b/wp-content/plugins/elementor-addon/elementor-addon.php
@@ -16,10 +16,12 @@ function register_hello_world_widget( $widgets_manager ) {
require_once( __DIR__ . '/widgets/images-list.php' );
require_once( __DIR__ . '/widgets/acf-product-parameters.php' );
require_once( __DIR__ . '/widgets/places-map.php' );
+ require_once( __DIR__ . '/widgets/product-featured-image.php' );
$widgets_manager->register( new \Elementor_Images_List() );
$widgets_manager->register( new \Elementor_ACF_Product_Parameters() );
$widgets_manager->register( new \Elementor_Places_Map() );
+ $widgets_manager->register( new \Elementor_Product_Featured_Image() );
}
add_action( 'elementor/widgets/register', 'register_hello_world_widget' );
diff --git a/wp-content/plugins/elementor-addon/widgets/acf-product-parameters.php b/wp-content/plugins/elementor-addon/widgets/acf-product-parameters.php
index 9af381b..f2bce30 100644
--- a/wp-content/plugins/elementor-addon/widgets/acf-product-parameters.php
+++ b/wp-content/plugins/elementor-addon/widgets/acf-product-parameters.php
@@ -44,10 +44,14 @@ class Elementor_ACF_Product_Parameters extends \Elementor\Widget_Base {
protected function render() {
$settings = $this->get_settings_for_display();
$acf_product_parameters = get_field('parametry_produktu');
+ $acf_product_parameters_status = get_field('ukryc_parametry_produktu');
if (empty($acf_product_parameters)) {
return;
}
+ if ($acf_product_parameters_status == 1) {
+ return;
+ }
?>
diff --git a/wp-content/plugins/elementor-addon/widgets/product-featured-image.php b/wp-content/plugins/elementor-addon/widgets/product-featured-image.php
new file mode 100644
index 0000000..78aca00
--- /dev/null
+++ b/wp-content/plugins/elementor-addon/widgets/product-featured-image.php
@@ -0,0 +1,126 @@
+start_controls_section(
+ 'settings_section',
+ [
+ 'label' => esc_html__('Settings', 'elementor-addon'),
+ ]
+ );
+
+ $this->end_controls_section();
+
+
+ $this->start_controls_section(
+ 'style_section',
+ [
+ 'label' => esc_html__('Style', 'elementor-addon'),
+ 'tab' => Controls_Manager::TAB_STYLE,
+ ]
+ );
+
+ $this->add_responsive_control(
+ 'width',
+ [
+ 'label' => esc_html__('Width', 'elementor-addon'),
+ 'type' => Controls_Manager::SLIDER,
+ 'default' => [
+ 'unit' => '%',
+ ],
+ 'size_units' => ['%', 'px', 'em'],
+ 'range' => [
+ '%' => [
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ 'px' => [
+ 'min' => 0,
+ 'max' => 1000,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .elementor-product-featured-image' => 'width: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+
+ $this->add_responsive_control(
+ 'max_width',
+ [
+ 'label' => esc_html__('Max Width', 'elementor-addon'),
+ 'type' => Controls_Manager::SLIDER,
+ 'default' => [
+ 'unit' => '%',
+ ],
+ 'size_units' => ['%', 'px', 'em'],
+ 'range' => [
+ '%' => [
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ 'px' => [
+ 'min' => 0,
+ 'max' => 1000,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .elementor-product-featured-image' => 'max-width: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+
+ $this->end_controls_section();
+ }
+
+ protected function render() {
+ global $post;
+ $settings = $this->get_settings_for_display();
+
+ $featured_image_status = get_field('ukryc_obrazek_wyrozniajacy', $post->ID);
+
+ if ( ! $post ) {
+ return;
+ }
+
+ if ( $featured_image_status == 1 ) {
+ return;
+ }
+
+ if ( has_post_thumbnail( $post->ID ) ) {
+ echo get_the_post_thumbnail( $post->ID, 'large', [
+ 'class' => 'elementor-product-featured-image',
+ 'loading' => 'lazy',
+ ]);
+ }
+ }
+}
\ No newline at end of file