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

Class AbstractCoupon

Abstract class for coupon discounts

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

Direct known subclasses

Blesta\Core\Pricing\Modifier\Type\Discount\Coupon
Abstract
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/AbstractCoupon.php
Methods summary
public
# __construct( Minphp\Date\Date $date, Blesta\Items\Item\ItemInterface $coupon, integer|string $timeStamp )

Initializes the coupon fields, applying currency, and applicable date

Initializes the coupon fields, applying currency, and applicable date

Parameters

$date
Date object
$coupon
The coupon item
$timeStamp
date timestamp at which the coupon must apply
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

Implementation of

Blesta\Core\Pricing\Modifier\Type\Discount\DiscountInterface::active()
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

Implementation of

Blesta\Core\Pricing\Modifier\Type\Discount\DiscountInterface::amount()
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

Implementation of

Blesta\Core\Pricing\Modifier\Type\Discount\DiscountInterface::packages()
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

Implementation of

Blesta\Core\Pricing\Modifier\Type\Discount\DiscountInterface::applies()
Properties summary
protected array $fields

The coupon fields

The coupon fields

#
protected Minphp\Date\Date $date

An instance of the date

An instance of the date

#
protected string $timeStamp

The date timestamp the coupon should apply to

The date timestamp the coupon should apply to

#
Blesta API documentation generated by ApiGen