Suggestion: Make expired codes grayed-out

Moderator
Depuis United States
Membre depuis oct. 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
Depuis Sweden
Membre depuis mai 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'))) {

Vous
Ce site n'utilise aucun cookie ni aucune technologie de suivi tierce. Nous pensons pouvoir faire mieux que les autres et nous nous soucions vraiment de votre vie privée.