===== Scheduled and Member Pricing ===== ==== Requirement ==== 1) Site Admin or Instructor should be able to schedule prices for items based on time. 2) Site Admin or Instructor should be able to set different prices for member and non-member users in site. ==== Implementation ==== 1) Added "Enhanced Pricing" feature to be set in the super site level. By default will be disabled for all the sites except the super site. 2) Once the option is enabled "Scheduled Pricing" and "Member Pricing" options will be available in the pricing options page. 3) Scheduled Pricing allows specifying different prices for multiple time periods. When enabled, a "Schedule" link appears next to each price, on both the Pricing Options screen as well as on the property panel of each Course, Certification, Live Event, In-Person Event, and Bundle. 4) Member Pricing allows specifying different prices for users marked as "members". When enabled, two price entry textboxes appear instead of just one, allowing for entry of both a non-member price as well as a member price. 5) Every item will have one price_schedule by default, we can also create multiple schedules. 7) The first price in the schedule should always be the "Effective now" price and the date on which it started will not be shown. 8) We don't show prices that have expired. Therefore, any other prices that appear in the schedule are prices that have yet to start. As such, the starting dates for those prices are always editable. 9) Whenever an upcoming price's start date is reached, that price becomes the "Effective now" price. The previous "Effective now" price is no longer displayed. ==== Database Changes ==== Add a new table to capture the price schedules Table name - price_schedules ^ Column_name ^Type ^ Description ^ | id | integer | primary key | | item_id | integer | item id to which it belongs to | | item_type | string | item type to which it belongs to | | created_at| date_time |created date | | updated_at| date_time|updated date | | price | decimal | price in dollars | | member_price | decimal | price in dollars | | free | boolean | default is true | | schedul_start_date | datetime | date when the price should reflect |