|
31 | 31 | use Mageplaza\Productslider\Helper\Data;
|
32 | 32 | use Mageplaza\Productslider\Model\Config\Source\Additional;
|
33 | 33 | use Mageplaza\Productslider\Model\Slider;
|
| 34 | +use function Ramsey\Uuid\v1; |
34 | 35 |
|
35 | 36 | /**
|
36 | 37 | * Class Design
|
@@ -98,49 +99,59 @@ protected function _prepareForm()
|
98 | 99 | );
|
99 | 100 |
|
100 | 101 | $fieldset->addField('title', 'text', [
|
101 |
| - 'name' => 'title', |
| 102 | + 'name' => 'title', |
102 | 103 | 'label' => __('Title'),
|
103 | 104 | 'title' => __('Title'),
|
104 | 105 | ]);
|
105 | 106 | $fieldset->addField('description', 'textarea', [
|
106 |
| - 'name' => 'description', |
| 107 | + 'name' => 'description', |
107 | 108 | 'label' => __('Description'),
|
108 | 109 | 'title' => __('Description'),
|
109 | 110 | ]);
|
110 | 111 | $fieldset->addField('limit_number', 'text', [
|
111 |
| - 'name' => 'limit_number', |
| 112 | + 'name' => 'limit_number', |
112 | 113 | 'label' => __('Limit the number of products'),
|
113 | 114 | 'title' => __('Limit the number of products'),
|
114 | 115 | 'class' => 'validate-digits'
|
115 | 116 | ]);
|
116 | 117 |
|
117 | 118 | $fieldset->addField('display_additional', 'multiselect', [
|
118 |
| - 'name' => 'display_additional', |
119 |
| - 'label' => __('Display additional information'), |
120 |
| - 'title' => __('Display additional information'), |
| 119 | + 'name' => 'display_additional', |
| 120 | + 'label' => __('Display additional information'), |
| 121 | + 'title' => __('Display additional information'), |
121 | 122 | 'values' => $this->_additional->toOptionArray(),
|
122 |
| - 'note' => __('Select information or button(s) to display with products.') |
| 123 | + 'note' => __('Select information or button(s) to display with products.') |
123 | 124 | ]);
|
124 | 125 |
|
125 | 126 | $isResponsive = $fieldset->addField('is_responsive', 'select', [
|
126 |
| - 'name' => 'is_responsive', |
127 |
| - 'label' => __('Is Responsive'), |
128 |
| - 'title' => __('Is Responsive'), |
| 127 | + 'name' => 'is_responsive', |
| 128 | + 'label' => __('Is Responsive'), |
| 129 | + 'title' => __('Is Responsive'), |
129 | 130 | 'options' => [
|
130 | 131 | '1' => __('Yes'),
|
131 | 132 | '0' => __('No'),
|
132 | 133 | '2' => __('Use Config')
|
133 | 134 | ]
|
134 | 135 | ]);
|
135 | 136 |
|
| 137 | + $isHyvaThemeAdmin = $this->_helperData->isHyvaThemeAdmin(); |
| 138 | + if ($isHyvaThemeAdmin) { |
| 139 | + $note = 'When the screen size is smaller than <strong>Screen size max</strong>, the number of products on the slider will change according to <strong>Number of items</strong>. |
| 140 | + Default: 3 items.'; |
| 141 | + |
| 142 | + } else { |
| 143 | + $note = 'When the screen size is larger than <strong>Screen size max</strong>, the number of products on the slider will change according to <strong>Number of items</strong> |
| 144 | + Default: 3 items.'; |
| 145 | + } |
| 146 | + |
136 | 147 | $responsiveItem = $fieldset->addField(
|
137 | 148 | 'responsive_items',
|
138 | 149 | 'Mageplaza\Productslider\Block\Adminhtml\Slider\Edit\Tab\Renderer\Responsive',
|
139 | 150 | [
|
140 | 151 | 'name' => 'responsive_items',
|
141 | 152 | 'label' => __('Max Items slider'),
|
142 | 153 | 'title' => __('Max Items slider'),
|
143 |
| - 'note' => __('Default: 3 items.') |
| 154 | + 'note' => __($note) |
144 | 155 | ]
|
145 | 156 | );
|
146 | 157 |
|
|
0 commit comments