Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up

Скрыть название опции если опции закончились


 Share

Recommended Posts

Подскажите пожалуйста, как скрыть название опции, если опции у товара закончились? 

1205305090_2022-06-2314_39_17.png.89f4daac0a6d8130c7c4bcb1bb29255f.png

	{% if (options or recurrings or (customTabs.popup is defined)) %}
									<div class="sku__group sku__group--options order-xl-{% if isRequired %}1{% else %}4{% endif %}">
										<div class="sku__settings">
											{% for option_row in prep_options %}
											<div class="row">
												{% for i,option in option_row %}
												<div class="{% if (option_row|length  == 2) %}col-xl-6{% else %}col-xl-12{% endif %}">
													{% if (option.type == 'select') %}
													<div class="ui-group">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-select">
														<select name="option[{{ option.product_option_id }}]" id="set-input-option{{ option.product_option_id }}">
															<option value="">{{ text_select }}</option>
															{% for option_value in option.product_option_value %} 
															<option value="{{ option_value.product_option_value_id }}">{{ option_value.name }} 
															{% if (option_value.price and opt_price) %} 
															{{ option_value.price_prefix }}{{ option_value.price }} 
															{% endif %} 
															</option>
															{% endfor %} 
														</select>
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'radio') %}
													<div class="ui-group">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<ul class="ui-checklist" id="set-input-option{{ option.product_option_id }}">
															{% for option_value in option.product_option_value %}
															<li>
																<label class="ui-check">
																	<input class="ui-check__input" type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}">
																	<span class="ui-check__option">
																		{% if option.isimage %}
																			<img src="{{ option_value.image }}" alt="{{ option_value.name }}" width="21" height="15" loading="lazy" />
																		{% endif %}
																		{{ option_value.name }}
																		{% if option_value.price %}
																		({{ option_value.price_prefix }}{{ option_value.price }})
																		{% endif %}
																	</span>
																</label>
															</li>
															{% endfor %}
														</ul>
													</div>
													{% endif %}
													{% if (option.type == 'checkbox') %}
													<div class="ui-group">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<ul class="ui-checklist" id="set-input-option{{ option.product_option_id }}">
															{% for option_value in option.product_option_value %}
															<li>
																<label class="ui-check">
																	<input class="ui-check__input" type="checkbox" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}">
																	<span class="ui-check__option">
																		{% if option.isimage %}
																			<img src="{{ option_value.image }}" alt="{{ option_value.name }}" width="21" height="15" loading="lazy" />
																		{% endif %}
																		{{ option_value.name }}
																		{% if option_value.price %}
																		({{ option_value.price_prefix }}{{ option_value.price }})
																		{% endif %}
																	</span>
																</label>
															</li>
															{% endfor %}
														</ul>
													</div>
													{% endif %}
													{% if (option.type == 'text') %}
													<div class="ui-group">
													<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="set-input-option{{ option.product_option_id }}" class="ui-input">
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'textarea') %}
													<div class="ui-group">
													<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<textarea class="ui-textarea" name="option[{{ option.product_option_id }}]" rows="3" placeholder="{{ option.name }}" id="set-input-option{{ option.product_option_id }}">{{ option.value }}</textarea>
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'file') %}
													<div class="ui-group">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<button type="button" id="button-upload{{ option.product_option_id }}" class="ui-btn ui-btn--36 ui-btn--grey ui-btn--file">{{ button_upload }}</button>
															<input type="hidden" name="option[{{ option.product_option_id }}]" value="" id="set-input-option{{ option.product_option_id }}">
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'date') %}
													<div class="ui-group ui-group--date">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="set-input-option{{ option.product_option_id }}" class="ui-input date" data-date-format="{{ date_format }}" data-toggle="datetimepicker" data-target=".date">
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'datetime') %}
													<div class="ui-group ui-group--datetime">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="set-input-option{{ option.product_option_id }}" class="ui-input datetime" data-date-format="{{ datetime_format }}" data-toggle="datetimepicker" data-target=".datetime">
														</div>
													</div>
													{% endif %}
													{% if (option.type == 'time') %}
													<div class="ui-group ui-group--time">
														<label class="ui-label{% if option.required %} required{% endif %}">{{ option.name }}</label>
														<div class="ui-field">
															<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="set-input-option{{ option.product_option_id }}" class="ui-input time" data-date-format="{{ time_format }}" data-toggle="datetimepicker" data-target=".time">
														</div>
													</div>
													{% endif %}
												</div>
												{% endfor %}
											</div>
											{% endfor %}

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.