ShopSettings
in package
Shop settings
Tags
Table of Contents
Properties
- $changed : bool
- This flag is set to true as soon as any changed setting is detected and stored. Only used by new methods that support it.
- $success : bool
- This flag is set to false as soon as storing any setting fails.
Methods
- deleteVat() : mixed
- Delete VAT entry
- errorHandler() : bool
- Fixes database errors.
- setProductsVat() : mixed
- Apply default VAT rate
- storeCurrencies() : mixed
- Stores the Currencies as present in the POST request
- storeGeneral() : bool
- Store general settings
- storePayments() : mixed
- Stores the Payments as present in the POST request
- storeSettings() : mixed
- Runs all the methods to store the various settings from the shop admin zone.
- storeShipping() : mixed
- Stores any changes made to any shipper or shipment
- storeVat() : mixed
- Stores all VAT settings
- update_vat() : mixed
- Add and/or update VAT entries
- storeCountries() : bool
- Stores countries settings
Properties
$changed
This flag is set to true as soon as any changed setting is detected and stored. Only used by new methods that support it.
private
static bool
$changed
= null
Tags
$success
This flag is set to false as soon as storing any setting fails.
private
static bool
$success
= null
Only used by new methods that support it.
Tags
Methods
deleteVat()
Delete VAT entry
public
static deleteVat() : mixed
Takes the ID of the record to be deleted from $_GET['vatid'] and passes it on the static method.
Tags
errorHandler()
Fixes database errors.
public
static errorHandler() : bool
Also migrates settings from the old Shop settings table to \Cx\Core\Setting.
Tags
Return values
bool —False. Always.
setProductsVat()
Apply default VAT rate
public
static setProductsVat() : mixed
If the get request array field "setVatAll" is present, sets the VAT ID to the ID found therein for all the products. If the get request array field "setVatUnset" is present, sets the VAT ID to the ID found therein for all products having a zero or NULL VAT ID.
Tags
storeCurrencies()
Stores the Currencies as present in the POST request
public
static storeCurrencies() : mixed
See Currency::delete(), Currency::add(), and Currency::update().
storeGeneral()
Store general settings
public
static storeGeneral() : bool
Tags
Return values
bool —true on success, false otherwise.
storePayments()
Stores the Payments as present in the POST request
public
static storePayments() : mixed
See Payment::delete(), Payment::add(), and Payment::update().
storeSettings()
Runs all the methods to store the various settings from the shop admin zone.
public
static storeSettings() : mixed
Note that not all of the methods report their success or failure back here (yet), so you should not rely on the result of this method.
Tags
Return values
mixed —True on success, false on failure, null if no change is detected.
storeShipping()
Stores any changes made to any shipper or shipment
public
static storeShipping() : mixed
storeVat()
Stores all VAT settings
public
static storeVat() : mixed
Takes all values from the POST array.
Tags
update_vat()
Add and/or update VAT entries
public
static update_vat() : mixed
Takes the class and rate of the VAT to be added from the $_POST array variable and passes them on to . Takes the IDs, classes and rates of the records to be updated from the $_POST array variable and passes them on to .
Tags
storeCountries()
Stores countries settings
private
static storeCountries() : bool
Returns null if nothing is changed.
Return values
bool —True on success, false on failure, or null on noop.