This code implement happy hour functionality.
Administrator Menu > Maintenance > Resources
Add the below lines of code in event.addline resource.
import java.util.Calendar; Calendar cal = Calendar.getInstance(); int hour = cal.get(Calendar.HOUR_OF_DAY); //Discount discountrate = 0.2; //Happy hour range start = 12; end = 16; if (hour>=start && hour<end) { p = line.getPrice(); line.setSalePrice(p - (p*discountrate)); }
Save & restart