SilverCart\Model\Order\ShoppingCartPosition
abstract for shopping cart positions.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ShoppingCartPosition
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static string $table_name = 'SilvercartShoppingCartPosition';
- private static array $summary_fields = ;
- protected array $prices = ;
- protected array $isQuantityIncrementableByList = ;
- protected $pluggedInTitle = NULL;
- // methods
- public string singular_name()
- public string plural_name()
- public bool canDelete()
- public array fieldLabels()
- public string getTitle()
- public string getTitleForWidget()
- public ShoppingCart getCart()
- public DBHTMLText addToTitle()
- public DBHTMLText addToTitleForWidget()
- public ShoppingCartPosition clearPriceCache()
- public DBMoney getPrice()
- public DBHTMLText getPriceNice()
- public DBHTMLText getSinglePriceNice()
- public DBMoney getSinglePrice()
- public string getProductNumberShop()
- public IncrementPositionQuantityForm IncrementPositionQuantityForm()
- public DecrementPositionQuantityForm DecrementPositionQuantityForm()
- public RemovePositionForm RemovePositionForm()
- public IncrementPositionQuantityForm getIncrementPositionQuantityForm()
- public DecrementPositionQuantityForm getDecrementPositionQuantityForm()
- public RemovePositionForm getRemovePositionForm()
- public bool isQuantityIncrementableBy()
- public DBHTMLText getShoppingCartPositionNotices()
- public ArrayList getShoppingCartPositionNoticesList()
- public string getCartDescription()
- public float|int getTypeSafeQuantity()
- public float getTaxAmount()
- public void adjustQuantityToStockQuantity()
- public bool hasNotice()
- public void onAfterDelete()
- public void onBeforeDelete()
- public void onAfterWrite()
- public void onBeforeWrite()
- public void transferToNewPosition()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $db
—
array
attributes - $has_one
—
array
n:m relations - $summary_fields
—
array
Summary fields - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels. - $isQuantityIncrementableByList
—
array
List of different accessed isQuantityIncrementableBy calls - $pluggedInTitle
—
string
plugged in title - $prices
—
array
List of different accessed prices
Methods
public
- DecrementPositionQuantityForm() — Returns the form for decrementing the amount of this position.
- IncrementPositionQuantityForm() — Returns the form for incrementing the amount of this position.
- RemovePositionForm() — Returns the form for removing this position.
- addToTitle() — Returns additional tile information provided by plugins
- addToTitleForWidget() — Returns additional tile information provided by plugins
- adjustQuantityToStockQuantity() — Decrement the positions quantity if it is higher than the stock quantity.
- canDelete() — Indicates wether the current user can delete this object.
- clearPriceCache() — Clears the price cache.
- fieldLabels() — Field labels for display in tables.
- getCart() — Alias for self::ShoppingCart().
- getCartDescription() — Returns the legally required description for shopping cart positions.
- getDecrementPositionQuantityForm() — Returns the form for decrementing the amount of this position.
- getIncrementPositionQuantityForm() — Returns the form for incrementing the amount of this position.
- getPrice() — price sum of this position
- getPriceNice() — Returns the formatted (Nice) summed price.
- getProductNumberShop() — Returns the shop product number
- getRemovePositionForm() — Returns the form for removing this position.
- getShoppingCartPositionNotices() — returns a string with notices. Notices are seperated by <br />
- getShoppingCartPositionNoticesList() — Returns a list of notices.
- getSinglePrice() — Returns the single price.
- getSinglePriceNice() — Returns the formatted (Nice) single price.
- getTaxAmount() — returns the tax amount included in $this
- getTitle() — Returns the title of the shopping cart position.
- getTitleForWidget() — Returns the title of the shopping cart position to display in a widget.
- getTypeSafeQuantity() — Returns the quantity according to the Product quantity type setting.
- hasNotice() — Is a notice set in the session?
- isQuantityIncrementableBy() — Find out if the demanded quantity is in stock when stock management is enabled.
- onAfterDelete() — We make this method extendable here.
- onAfterWrite() — We make this method extendable here.
- onBeforeDelete() — We make this method extendable here.
- onBeforeWrite() — We make this method extendable here.
- plural_name() — Returns the translated plural name of the object.
- singular_name() — Returns the translated singular name of the object.
- transferToNewPosition() — This method gets called when the shopping cart of a customer gets transferred to a new cart (e.g. during the registration process).
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.