Shop
extends AbstractBase
in package
YetiForce shop class.
Table of Contents
- PREMIUM_ICONS = [1 => 'yfi-premium color-red-600', 2 => 'yfi-enterprise color-yellow-600', 3 => 'yfi-partners color-grey-600']
- PRODUCT_CATEGORIES = ['All' => ['label' => 'LBL_CAT_ALL', 'icon' => 'yfi-all-shop'], 'Extensions' => ['label' => 'LBL_CAT_ADDONS', 'icon' => 'yfi-adds-on-shop'], 'Integrations' => ['label' => 'LBL_CAT_INTEGRATIONS', 'icon' => 'yfi-integration-shop']]
- URL = 'https://api.yetiforce.eu/store'
- $productCache : array<string|int, mixed>
- Product instance cache.
- $error : string|null
- $success : bool
- check() : bool
- Verification of product.
- checkAlert() : string
- checkWithMessage() : array<string|int, mixed>
- Verification of product with a message.
- getError() : string
- Get last error.
- getPaypalUrl() : string
- Get paypal URL.
- getProduct() : AbstractBaseProduct
- Get products.
- getProducts() : array<string|int, AbstractBaseProduct>
- Get products.
- getVariablePayments() : array<string|int, mixed>
- Get variable payments.
- load() : void
- Get all available products.
- loadProduct() : void
- Get product by ID.
- verify() : string
- Verify or show a message about invalid products.
- getProductClass() : string
- Get product class.
- setProducts() : void
- Set Products to cache.
Constants
PREMIUM_ICONS
public
array<string|int, string>
PREMIUM_ICONS
= [1 => 'yfi-premium color-red-600', 2 => 'yfi-enterprise color-yellow-600', 3 => 'yfi-partners color-grey-600']
Premium icons.
PRODUCT_CATEGORIES
public
array<string|int, mixed>
PRODUCT_CATEGORIES
= ['All' => ['label' => 'LBL_CAT_ALL', 'icon' => 'yfi-all-shop'], 'Extensions' => ['label' => 'LBL_CAT_ADDONS', 'icon' => 'yfi-adds-on-shop'], 'Integrations' => ['label' => 'LBL_CAT_INTEGRATIONS', 'icon' => 'yfi-integration-shop']]
Product categories.
URL
public
string
URL
= 'https://api.yetiforce.eu/store'
URL
Properties
$productCache
Product instance cache.
public
static array<string|int, mixed>
$productCache
= []
$error
protected
string|null
$error
= null
Last error.
$success
protected
bool
$success
= false
Response result
Methods
check()
Verification of product.
public
static check(string $productName) : bool
Parameters
- $productName : string
Return values
bool —checkAlert()
public
static checkAlert(string $productName) : string
Parameters
- $productName : string
Tags
Return values
string —checkWithMessage()
Verification of product with a message.
public
static checkWithMessage(string $productName) : array<string|int, mixed>
Parameters
- $productName : string
Return values
array<string|int, mixed> —getError()
Get last error.
public
getError() : string
Return values
string —getPaypalUrl()
Get paypal URL.
public
static getPaypalUrl() : string
https://www.paypal.com/cgi-bin/webscr https://www.sandbox.paypal.com/cgi-bin/webscr.
Return values
string —getProduct()
Get products.
public
static getProduct(string $name[, string $productId = '' ]) : AbstractBaseProduct
Parameters
- $name : string
- $productId : string = ''
Return values
AbstractBaseProduct —getProducts()
Get products.
public
getProducts() : array<string|int, AbstractBaseProduct>
Return values
array<string|int, AbstractBaseProduct> —getVariablePayments()
Get variable payments.
public
static getVariablePayments() : array<string|int, mixed>
Return values
array<string|int, mixed> —load()
Get all available products.
public
load() : void
Return values
void —loadProduct()
Get product by ID.
public
loadProduct(string $productId) : void
Parameters
- $productId : string
Return values
void —verify()
Verify or show a message about invalid products.
public
static verify([bool $getNames = false ]) : string
Parameters
- $getNames : bool = false
Return values
string —getProductClass()
Get product class.
private
static getProductClass(string $name) : string
Parameters
- $name : string
Return values
string —setProducts()
Set Products to cache.
private
setProducts(array<string|int, mixed> $products) : void
Parameters
- $products : array<string|int, mixed>