Merge pull request #4543 from devansh-webkul/issue-4542

Fixed the issue in which user cannot apply the coupon if the start date is today regardless the time #4542
This commit is contained in:
Glenn Hermans 2021-02-02 12:46:23 +01:00 committed by GitHub
commit 528f1aef93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -581,12 +581,12 @@ class CartRule
->where('cart_rule_channels.channel_id', $channelId)
->where(function ($query1) {
/** @var Builder $query1 */
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d H:m:s'))
->orWhereNull('cart_rules.starts_from');
})
->where(function ($query2) {
/** @var Builder $query2 */
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d H:m:s'))
->orWhereNull('cart_rules.ends_till');
})
->with([