Dokan Hide No Warranty Option

38 views Asked by At

I have a code like this.

<select name="warranty_type" id="dokan-warranty-type" class="dokan-form-control">
<?php foreach ( dokan_rma_warranty_type() as $warranty_key => $warranty_value ): ?>
<option value="<?php echo $warranty_key; ?>" <?php selected( $rma_settings['type'], $warranty_key ); ?>><?php echo $warranty_value;  ?></option>
<?php endforeach ?>
</select>

There are 3 warranty keys in this code. No warranty, included_warranty and addon_warranty.

I don't want to show the no warranty option at all. I need to remove this option. Can anyone help me on this?

1

There are 1 answers

0
Yeasin Arafat On

Use the below code in your child theme's functions.php

function modify_warranty_types( $warranty_types ) {
    unset( $warranty_types['no_warranty'] );
    return $warranty_types;
}
add_filter( 'dokan_rma_warranty_type', 'modify_warranty_types' );