s22_tech Moderator Από United States Μέλος από Οκτ 2019 s22_tech 7 Φεβ 2024 23:04 I have a suggestion for this add-on. If the expired codes were displayed as grayed-out, it would be a great visual cue. After this line: while ($discount_code = database::fetch($discount_codes_query)) { simply add: if ($discount_code['date_valid_to'] < date('Y-m-d H:i:s') || empty($discount_code['status']) || $discount_code['status'] == '0') { $discount_code['css_class']= 'semi-transparent'; }``` Then convert the <tr> to: ```<tr class="<?php echo $discount_code['css_class']; ?>">```
tim Founder Από Sweden Μέλος από Μαΐ 2013 tim 8 Φεβ 2024 02:13 I will take it 👍 Note that these both returns true if status is 0. empty($discount_code['status']) || $discount_code['status'] == '0' I would do this instead if (!$discount_code['status'] || (isset($discount_code['date_valid_to']) && $discount_code['date_valid_to'] < date('Y-m-d H:i:s'))) {