QuickEditProductSpecialPricesWriter
in package
implements
QuickEditProductSpecialPricesWriterInterface
Class QuickEditProductSpecialPricesWriter
Tags
Interfaces, Classes and Traits
- QuickEditProductSpecialPricesWriterInterface
- Interface QuickEditProductSpecialPricesWriterInterface
Table of Contents
- $db : CI_DB_query_builder
- $productIds : array<string|int, mixed>
- $quickEditSpecialPricesOverviewColumns : QuickEditSpecialPricesOverviewColumns
- $taxRate : float
- __construct() : mixed
- QuickEditProductsSpecialPriceWriter constructor.
- setSpecialPriceById() : bool
- Saves the changed data regarding the special price.
- _calculatePrice() : float|int
- Calculate the price of the value.
- _calculateUnit() : mixed
- Calculates the unit of the value.
- _collectUpdateData() : array<string|int, mixed>
- Returns the updated data of a product.
- _delegateFilterToColumn() : array<string|int, mixed>
- Returns the required columns for the overview of the properties.
- _editableColumns() : array<string|int, mixed>
- Returns the editable columns for the product.
- _setSpecialPriceExpirationDate() : string
- Sets the special price expires date.
- _setTaxRate() : mixed
- Sets the tax rate of a product.
Properties
$db
protected
CI_DB_query_builder
$db
$productIds
protected
array<string|int, mixed>
$productIds
$quickEditSpecialPricesOverviewColumns
protected
QuickEditSpecialPricesOverviewColumns
$quickEditSpecialPricesOverviewColumns
$taxRate
protected
float
$taxRate
Methods
__construct()
QuickEditProductsSpecialPriceWriter constructor.
public
__construct(CI_DB_query_builder $db, QuickEditSpecialPricesOverviewColumns $quickEditSpecialPricesOverviewColumns) : mixed
Parameters
- $db : CI_DB_query_builder
-
Database query builder instance.
- $quickEditSpecialPricesOverviewColumns : QuickEditSpecialPricesOverviewColumns
-
QuickEdit properties overview columns.
Return values
mixed —setSpecialPriceById()
Saves the changed data regarding the special price.
public
setSpecialPriceById(array<string|int, mixed> $specialPrice) : bool
Parameters
- $specialPrice : array<string|int, mixed>
-
Contains the special prices data.
Return values
bool —Returns the operation result.
_calculatePrice()
Calculate the price of the value.
protected
_calculatePrice(string $value, string $column) : float|int
Parameters
- $value : string
-
Value.
- $column : string
-
Column of the table.
Return values
float|int —Returns the calculated unit of the price.
_calculateUnit()
Calculates the unit of the value.
protected
_calculateUnit(string $value, string $column) : mixed
Parameters
- $value : string
-
Value.
- $column : string
-
Column of the table.
Return values
mixed —Returns the calculated unit of the value.
_collectUpdateData()
Returns the updated data of a product.
protected
_collectUpdateData(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
- $items : array<string|int, mixed>
-
Items.
Return values
array<string|int, mixed> —Returns the updated data of a product is an array.
_delegateFilterToColumn()
Returns the required columns for the overview of the properties.
protected
_delegateFilterToColumn() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns an array of the required columns for the overview of the properties.
_editableColumns()
Returns the editable columns for the product.
protected
_editableColumns() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns the editable columns for the product is an array.
_setSpecialPriceExpirationDate()
Sets the special price expires date.
protected
_setSpecialPriceExpirationDate(string $expirationDate) : string
Parameters
- $expirationDate : string
-
Expiration date string.
Return values
string —Returns the special price expires date in the specified format.
_setTaxRate()
Sets the tax rate of a product.
protected
_setTaxRate() : mixed