Suggestion: Make expired codes grayed-out

Moderator
Od United States
Člen od okt 2019

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

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'))) {

vy
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.