Shop_Item_Controller
extends Core_Servant_Properties
in package
Online shop.
Доступные методы:
- count($int) количество товара в корзине
- siteuser($oSiteuser) рассчитывать цены для указанного клиента
Tags
Table of Contents
Properties
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_aPrice : array<string|int, mixed>
- Price array
- $_cacheGetShopGroupBonuses : array<string|int, mixed>
- Cache for _getShopGroupBonuses
- $_cacheGetShopGroupDiscounts : array<string|int, mixed>
- Cache for _getShopGroupDiscounts
- $_cacheGetShopProducerBonuses : array<string|int, mixed>
- Cache for _getShopProducerBonuses
- $_cacheGetShopProducerDiscounts : array<string|int, mixed>
- Cache for _getShopProducerDiscounts
- $_coupon : mixed
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_Shop_Specialprice : Shop_Specialprice_Model|null
- Last used Shop_Specialprice
- $_unlimitedProperties : bool
- Object has unlimited number of properties
Methods
- __construct() : mixed
- Constructor.
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- calculatePrice() : array<string|int, mixed>
- Calculate the cost with tax and discounts
- calculatePriceInItemCurrency() : array<string|int, mixed>
- Calculate the cost with tax and discounts in Shop_Item currency
- coupon() : mixed
- getAPrice() : array<string|int, mixed>
- Get $this->_aPrice
- getBonuses() : array<string|int, mixed>
- Calculate total bonuses for oShop_Item
- getLastShopSpecialprice() : Shop_Specialprice_Model|null
- Get last used Shop_Specialprice
- getPrice() : float
- Get price for current user
- getPrices() : array<string|int, mixed>
- Определение цены товара для заданного пользователя $this->siteuser
- getSpecialprice() : float
- Определение цены товара в соответствии с $this->count и специальными ценами
- set() : self
- Run when writing data to inaccessible properties
- setAPrice() : array<string|int, mixed>
- Set $this->_aPrice
- setUnlimitedProperties() : self
- Set unlimitedProperties
- _calculatePrice() : array<string|int, mixed>
- Calculate the cost with tax and discounts without currencies
- _getShopGroupBonuses() : array<string|int, mixed>
- Get array of Shop_Group_Bonuses for group $shop_group_id
- _getShopGroupDiscounts() : array<string|int, mixed>
- Get array of Shop_Group_Discounts for group $shop_group_id
- _getShopProducerBonuses() : array<string|int, mixed>
- Get array of Shop_Producer_Bonuses for producer $shop_producer_id
- _getShopProducerDiscounts() : array<string|int, mixed>
- Get array of Shop_Producer_Discounts for producer $shop_producer_id
Properties
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array('count', 'siteuser')
$_aPrice
Price array
protected
array<string|int, mixed>
$_aPrice
= array()
$_cacheGetShopGroupBonuses
Cache for _getShopGroupBonuses
protected
static array<string|int, mixed>
$_cacheGetShopGroupBonuses
= array()
$_cacheGetShopGroupDiscounts
Cache for _getShopGroupDiscounts
protected
static array<string|int, mixed>
$_cacheGetShopGroupDiscounts
= array()
$_cacheGetShopProducerBonuses
Cache for _getShopProducerBonuses
protected
static array<string|int, mixed>
$_cacheGetShopProducerBonuses
= array()
$_cacheGetShopProducerDiscounts
Cache for _getShopProducerDiscounts
protected
static array<string|int, mixed>
$_cacheGetShopProducerDiscounts
= array()
$_coupon
protected
static mixed
$_coupon
= \NULL
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_Shop_Specialprice
Last used Shop_Specialprice
protected
Shop_Specialprice_Model|null
$_Shop_Specialprice
= \NULL
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
Methods
__construct()
Constructor.
public
__construct() : mixed
addAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfcalculatePrice()
Calculate the cost with tax and discounts
public
calculatePrice(float $price, Shop_Item_Model $oShop_Item[, bool $bRound = TRUE ]) : array<string|int, mixed>
Parameters
- $price : float
-
price
- $oShop_Item : Shop_Item_Model
-
item
- $bRound : bool = TRUE
-
round prices
Tags
Return values
array<string|int, mixed>calculatePriceInItemCurrency()
Calculate the cost with tax and discounts in Shop_Item currency
public
calculatePriceInItemCurrency(float $price, Shop_Item_Model $oShop_Item[, bool $bRound = TRUE ]) : array<string|int, mixed>
Parameters
- $price : float
-
price
- $oShop_Item : Shop_Item_Model
-
item
- $bRound : bool = TRUE
-
round prices
Tags
Return values
array<string|int, mixed>coupon()
public
static coupon(mixed $coupon_text) : mixed
Parameters
- $coupon_text : mixed
getAPrice()
Get $this->_aPrice
public
getAPrice() : array<string|int, mixed>
Return values
array<string|int, mixed>getBonuses()
Calculate total bonuses for oShop_Item
public
getBonuses(Shop_Item_Model $oShop_Item, mixed $price) : array<string|int, mixed>
Parameters
- $oShop_Item : Shop_Item_Model
-
item
- $price : mixed
Tags
Return values
array<string|int, mixed> —array('total' => Total bonuses, 'bonuses' => array of bonuses)
getLastShopSpecialprice()
Get last used Shop_Specialprice
public
getLastShopSpecialprice() : Shop_Specialprice_Model|null
Return values
Shop_Specialprice_Model|nullgetPrice()
Get price for current user
public
getPrice(Shop_Item_Model $oShop_Item) : float
Parameters
- $oShop_Item : Shop_Item_Model
-
item
Return values
floatgetPrices()
Определение цены товара для заданного пользователя $this->siteuser
public
getPrices(Shop_Item_Model $oShop_Item[, bool $bRound = TRUE ][, bool $bCache = TRUE ]) : array<string|int, mixed>
Parameters
- $oShop_Item : Shop_Item_Model
-
товар
- $bRound : bool = TRUE
-
round prices
- $bCache : bool = TRUE
-
cache mode status
Return values
array<string|int, mixed> —возвращает массив значений цен для данного пользователя
- $price['tax'] сумма налога
- $price['rate'] размер налога
- $price['price'] цена с учетом валюты без налога
- $price['price_tax'] цена с учетом налога
- $price['price_discount'] цена с учетом налога и со скидкой
getSpecialprice()
Определение цены товара в соответствии с $this->count и специальными ценами
public
getSpecialprice(float $price, Shop_Item_Model $oShop_Item[, bool $bCache = TRUE ]) : float
Parameters
- $price : float
-
price
- $oShop_Item : Shop_Item_Model
- $bCache : bool = TRUE
-
cache mode status
Tags
Return values
floatset()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetAPrice()
Set $this->_aPrice
public
setAPrice(array<string|int, mixed> $aPrice) : array<string|int, mixed>
Parameters
- $aPrice : array<string|int, mixed>
Return values
array<string|int, mixed>setUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
self_calculatePrice()
Calculate the cost with tax and discounts without currencies
protected
_calculatePrice(Shop_Item_Model $oShop_Item) : array<string|int, mixed>
Parameters
- $oShop_Item : Shop_Item_Model
-
item
Tags
Return values
array<string|int, mixed>_getShopGroupBonuses()
Get array of Shop_Group_Bonuses for group $shop_group_id
protected
_getShopGroupBonuses(int $shop_group_id) : array<string|int, mixed>
Parameters
- $shop_group_id : int
-
Shop_Group id
Tags
Return values
array<string|int, mixed>_getShopGroupDiscounts()
Get array of Shop_Group_Discounts for group $shop_group_id
protected
_getShopGroupDiscounts(int $shop_group_id) : array<string|int, mixed>
Parameters
- $shop_group_id : int
-
Shop_Group id
Tags
Return values
array<string|int, mixed>_getShopProducerBonuses()
Get array of Shop_Producer_Bonuses for producer $shop_producer_id
protected
_getShopProducerBonuses(int $shop_producer_id) : array<string|int, mixed>
Parameters
- $shop_producer_id : int
-
Shop_Producer id
Tags
Return values
array<string|int, mixed>_getShopProducerDiscounts()
Get array of Shop_Producer_Discounts for producer $shop_producer_id
protected
_getShopProducerDiscounts(int $shop_producer_id) : array<string|int, mixed>
Parameters
- $shop_producer_id : int
-
Shop_Producer id