79 lines
2.4 KiB
PHP
79 lines
2.4 KiB
PHP
<?php
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
use Elementor\Controls_Manager;
|
|
use Elementor\Icons_Manager;
|
|
use Elementor\Repeater;
|
|
use Elementor\Utils;
|
|
|
|
class Elementor_ACF_Product_Parameters extends \Elementor\Widget_Base {
|
|
|
|
public function get_name() {
|
|
return 'acf-product-parameters';
|
|
}
|
|
|
|
public function get_title() {
|
|
return esc_html__('ACF Product Parameters', 'elementor-addon');
|
|
}
|
|
|
|
public function get_icon() {
|
|
return 'eicon-code';
|
|
}
|
|
|
|
public function get_categories() {
|
|
return ['basic'];
|
|
}
|
|
|
|
public function get_keywords() {
|
|
return ['global', 'login'];
|
|
}
|
|
|
|
protected function register_controls() {
|
|
$this->start_controls_section(
|
|
'list_section',
|
|
[
|
|
'label' => esc_html__('List', 'elementor-addon'),
|
|
]
|
|
);
|
|
|
|
$this->end_controls_section();
|
|
}
|
|
|
|
protected function render() {
|
|
$settings = $this->get_settings_for_display();
|
|
$acf_product_parameters = get_field('parametry_produktu');
|
|
|
|
if (empty($acf_product_parameters)) {
|
|
return;
|
|
}
|
|
?>
|
|
<ul class="product-parameters">
|
|
<?php foreach ($acf_product_parameters as $parameter) : ?>
|
|
<li>
|
|
<div class="product-parameters__img">
|
|
<img src="<?php echo $parameter['obrazek']; ?>" alt="">
|
|
</div>
|
|
<div class="product-parameters__content">
|
|
<? if ($parameter['link']) : ?>
|
|
<p class="product-parameters__title">
|
|
<a href="<?php echo $parameter['link']['url']; ?>" <?php if ($parameter['link']['target']) : ?>target="_blank"<?php endif; ?>>
|
|
<?php echo $parameter['tytul']; ?>
|
|
</a>
|
|
</p>
|
|
<? else : ?>
|
|
<p class="product-parameters__title">
|
|
<?php echo $parameter['tytul']; ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
<p class="product-parameters__description">
|
|
<?php echo $parameter['tekst']; ?>
|
|
</p>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php
|
|
}
|
|
}
|