Early Bird Discount display issue

  • theophila
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 8 months ago - 13 years 8 months ago #11064 by theophila
Early Bird Discount display issue was created by theophila
Hi! I wanted the early bird discount date to display when it was active, so I set it that way in the Configuration in the Joomla backend. However, I notice that it still displays now, when the discount date has passed. This does not happen in the cart or upon checkout, but I would still like it not to display in the event details page so as not to confuse anyone.

The code I believe is relevant is in models/event.php, Line 94:
Code:
if (($row->early_bird_discount_date != $nullDate) && ($row->date_diff >=0)) {
I've searched the entirety of the code in the com_eventbooking folder, and the problem is, I think, that $row->date_diff is never defined, nor is it in the database (I checked), thus the early bird rate will always been displayed under individual_price.

Since it works in the cart, however, I checked helper/os_cart.php and noticed that there, on Line 224, it says:
Code:
if (($event->early_bird_discount_amount > 0) && ($event->early_bird_discount_date != $nullDate) && (strtotime($event->early_bird_discount_date) >= mktime())) {
So would it help it I replaced:
Code:
($row->date_diff >=0)
with:
Code:
(strtotime($row->early_bird_discount_date) >= mktime())
OR I could define the variable as:
Code:
$row->date_diff = $row->early_bird_discount_date - mktime();
Would either work? Or which would be better?
Last edit: 13 years 8 months ago by theophila.

Please Log in or Create an account to join the conversation.

  • theophila
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 8 months ago #11067 by theophila
Replied by theophila on topic Re: Early Bird Discount display issue
Just to note, I ended up replacing:
Code:
if (($row->early_bird_discount_date != $nullDate) && ($row->date_diff >=0)) {
with
Code:
if (($row->early_bird_discount_date != $nullDate) && (strtotime($row->early_bird_discount_date) >= mktime())) {
in models/events.php, models/category.php, models/location.php, and models/search.php

Everything seems to be working fine now!

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc