s22_tech Moderator Od United States Člen od okt 2019 s22_tech 7 feb 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 Od Sweden Člen od máj 2013 tim 8 feb 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'))) {