Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty end date in Coupons display #182

Closed
soaptray opened this issue Oct 13, 2012 · 3 comments
Closed

Empty end date in Coupons display #182

soaptray opened this issue Oct 13, 2012 · 3 comments

Comments

@soaptray
Copy link

When adding in coupons, if you leave the "Date End" field blank, to indicate that you wish to have the coupon never expire, it displays the date as "30/11/-0001" on the administrative panel.

Furthermore, when you go and edit said date, it shows up as "-0001-11-30" in the text box.

@ghost
Copy link

ghost commented Oct 16, 2012

I believe this is caused by strtotime() returning false on '0000-00-00'; Changing the coupon.php controller from:

$this->data['date_end'] = date('Y-m-d', strtotime($coupon_info['date_end']));

to:

$this->data['date_end'] = ($coupon_info['date_end'] == '0000-00-00' ? $coupon_info['date_end'] : date('Y-m-d', strtotime($coupon_info['date_end'])));

would get rid of the immediate issue in the coupon form.

@gurubobnz
Copy link

Seems to be the same issue if you leave the date available field blank on a product. I didn't look further into after I found that the github trunk wasn't stable (confirmed on another issue).

@opencart
Copy link
Collaborator

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants