Enhance product management and coupon features
- Added styling for input group add-ons and additional fields in SCSS. - Updated shop coupon view to include a new column for usage count. - Display coupon code and amount in order details if applicable. - Improved product edit template to handle custom fields with required validation. - Modified product save logic to include custom field requirements. - Enhanced decimal normalization function for better input handling. - Implemented checkbox normalization for form submissions. - Updated custom fields in product templates to reflect required status. - Fixed URL for fetching changelog updates.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<? if ( is_array( $this -> custom_fields ) ): foreach ( $this -> custom_fields as $custom_field ):?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?= $custom_field['name'];?>:
|
||||
<?= $custom_field['name'];?><? if ( !empty( $custom_field['is_required'] ) ): ?>*<? endif; ?>:
|
||||
</div>
|
||||
<div class="_input">
|
||||
<div class="grow-wrap">
|
||||
<textarea name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" onInput="this.parentNode.dataset.replicatedValue = this.value"></textarea>
|
||||
<textarea name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" onInput="this.parentNode.dataset.replicatedValue = this.value" <? if ( !empty( $custom_field['is_required'] ) ): ?>required<? endif; ?>></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -537,7 +537,7 @@
|
||||
}
|
||||
|
||||
// dodatkowe pola muszą być uzupełnione
|
||||
$( '.custom-field textarea' ).each( function( index, element )
|
||||
$( '.custom-field textarea[required]' ).each( function( index, element )
|
||||
{
|
||||
if ( $.trim( $( element ).val() ) == '' )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user