Editor - Extensions

This view Manage delivery times, taxes, offers, coupons and services. This view opens with the function showExtensions() in the view theme/views/editor/business.html

Main Models

  • deal.tax_type: mark 1 if the tax is in percentage and 2 if it is fixed
  • deal.tax: mark the value or percentage of the tax
  • curDeliveryTime
  • curDeliveryTime.hour: It contains quantity hours of delivery time
  • `curDeliveryTime.minute: Contains the number of minutes of delivery time
  • hours: contains a time list depending on the 24 or 12 format
  • minutes: contains a list of minutes from 00 to 59
  • curPickupTime
  • curPickupTime.minute: number of hours of collection time
  • curPickupTime.hour: number of minutes of collection time 0
  • deal.offers: contains all the business offers
  • deal.minimum: contains the minimum purchase value of a business
  • curCollapse: useful to section by pesañas or accordions.
  • deal.service_fee: contains the percentage of the service value
  • deal.featured: a Boolean that marks whether the business is promoted or not
  • curCoupon
  • curCoupon.limit: limit of use of this coupon code
  • curCoupon.minimum: minimum purchase for the coupon to be valid
  • curCoupon.coupon: Coupon code
  • curOffer
  • curOffer.limit: limit of uses of the offer
  • curOffer.minimum: minimum purchase for the offer to be valid
  • curOffer.name: name of the offer

Utility Functions

  • changeCollapseExt(tab): Useful function for sectioning content such as accordions or tabs
  • changeTax(): Function used to update tax and tax_type
  • changeDeliveryTime(): Function to change the delivery time of the business
  • changePickupTime(): function to change the business pick-up time
  • removeOffer(offer): It serves to eliminate an offer
  • showOfferSetting(offer): open a modal with the details of the offer that is sent in the parameter
  • updateOffer(offer): serves to update an offer
  • changeMinimunPurchased(): serves to change the minimum purchase of a business
  • changeServiceFee(): serves to change the percentage of the value of the business service
  • changeFeature(): update the business's featured parameter OPTION only for ADMINISTRATORS

Example of base theme

602
  1. tabs sectcion works with the function changeCollapseExt(tab)
  2. offers type 2 section
  3. updateOffer(offer)
  4. showOfferSetting(offer)
  5. removeOffer(offer)
  6. showOfferSetting(curOffer) to add a new offer with this model
  7. curOffer model