- Posts: 13
- Thank you received: 0
Early Bird Discount display issue
- theophila
- Topic Author
- Offline
- New Member
-
Less
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:
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:
So would it help it I replaced:
with:
OR I could define the variable as:
Would either work? Or which would be better?
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)) {
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())) {
Code:
($row->date_diff >=0)
Code:
(strtotime($row->early_bird_discount_date) >= mktime())
Code:
$row->date_diff = $row->early_bird_discount_date - mktime();
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
-
Less
More
- Posts: 13
- Thank you received: 0
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:
with
in models/events.php, models/category.php, models/location.php, and models/search.php
Everything seems to be working fine now!
Code:
if (($row->early_bird_discount_date != $nullDate) && ($row->date_diff >=0)) {
Code:
if (($row->early_bird_discount_date != $nullDate) && (strtotime($row->early_bird_discount_date) >= mktime())) {
Everything seems to be working fine now!
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.