Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • AbstractCoupon
  • Coupon

Interfaces

  • DiscountInterface
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Interface DiscountInterface

Discount interface

Direct known implementers

Blesta\Core\Pricing\Modifier\Type\Discount\AbstractCoupon

Indirect known implementers

Blesta\Core\Pricing\Modifier\Type\Discount\Coupon
Namespace: Blesta\Core\Pricing\Modifier\Type\Discount
Package: blesta\core\Pricing\Modifier\Type\Discount
Copyright: Copyright (c) 2019, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at core/Pricing/Modifier/Type/Discount/DiscountInterface.php
Methods summary
public boolean
# active( )

Determines whether the coupon is active

Determines whether the coupon is active

Returns

boolean
True if the coupon is active, or false otherwise
public boolean
# applies( array $packageIds, boolean $options = false, boolean $recurs = false )

Determines whether the coupon applies to the given packages, their options, whether added new or recurring

Determines whether the coupon applies to the given packages, their options, whether added new or recurring

Parameters

$packageIds

One of the following:

  • An array of package IDs that the coupon must apply to
  • An array of package IDs mapped to periods and terms [packageID => [period => [term, term]]] that the coupon must apply to
$options
Whether or not the coupon must apply to package options (optional, default false)
$recurs
Whether or not the coupon is being used to recur or not (optional, default false)

Returns

boolean
True if the coupon applies, or false otherwise
public array
# amount( string $currency )

Retrieves the amount from the discount that applies for the given currency

Retrieves the amount from the discount that applies for the given currency

Parameters

$currency
The ISO 4217 currency code

Returns

array
An array of key/value pairs representing the discount amount for the given currency
public array
# packages( )

Retrieves the package IDs of all packages that the coupon supports

Retrieves the package IDs of all packages that the coupon supports

Returns

array
An array of package IDs
Blesta API documentation generated by ApiGen