- Class name: DiscountCore
- Parent class: CartRule
- Warning: this class is deprecated. This means that this class will likely be removed in a future version.
- Source: classes/Discount.php line 30
- $active
- $carrier_restriction
- $cart_rule_restriction
- $code
- $country_restriction
- $date_add
- $date_from
- $date_to
- $date_upd
- $definition
- $description
- $free_shipping
- $gift_product
- $gift_product_attribute
- $group_restriction
- $highlight
- $id
- $id_customer
- $minimum_amount
- $minimum_amount_currency
- $minimum_amount_shipping
- $minimum_amount_tax
- $name
- $only_one_gift
- $partial_use
- $priority
- $product_restriction
- $quantity
- $quantity_per_user
- $reduction_amount
- $reduction_currency
- $reduction_percent
- $reduction_product
- $reduction_tax
- $shop_restriction
- $cache_objects
- $db
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $force_id
- $get_shop_from_context
- $id_lang
- $id_shop
- $id_shop_list
- $identifier
- $image_dir
- $image_format
- $loaded_classes
- $table
- $tables
- $update_fields
- $webserviceParameters
- __call
- __construct
- __get
- __set
- add
- addFieldsRequiredDatabase
- array_uintersect
- array_uintersect_compare
- associateTo
- autoAddToCart
- autoRemoveFromCart
- cacheFieldsRequiredDatabase
- cartRuleExists
- checkProductRestrictions
- checkValidity
- cleanCache
- cleanProductRuleIntegrity
- clearCache
- copyConditions
- createOrderDiscount
- delete
- deleteByIdCustomer
- deleteImage
- deleteSelection
- disableCache
- discountExists
- display
- displayFieldName
- duplicateObject
- duplicateShops
- enableCache
- existsInDatabase
- formatFields
- formatValue
- getAssociatedRestrictions
- getAssociatedShops
- getCartRuleCombinations
- getCartsRuleByCode
- getContextualValue
- getCustomerCartRules
- getCustomerDiscounts
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getIdByCode
- getIdByName
- getProductRuleGroups
- getProductRules
- getRepositoryClassName
- getTranslationsFields
- getValidationRules
- getValue
- getVouchersToCartDisplay
- getWebserviceObjectList
- getWebserviceParameters
- hasMultishopEntries
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isFeatureActive
- isLangMultishop
- isMultiShopField
- isMultishop
- makeTranslationFields
- save
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- toggleStatus
- update
- updateMultishopTable
- usedByCustomer
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
const AMOUNT = 2
- Warning: this constant is deprecated. This means that this constant will likely be removed in a future version.
- Source: classes/Discount.php line 33.
const FREE_SHIPPING = 3
- Warning: this constant is deprecated. This means that this constant will likely be removed in a future version.
- Source: classes/Discount.php line 34.
const PERCENT = 1
- Warning: this constant is deprecated. This means that this constant will likely be removed in a future version.
- Source: classes/Discount.php line 32.
public mixed $active = 1
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 71.
public mixed $carrier_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 57.
public mixed $cart_rule_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 59.
public mixed $code
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 51.
public mixed $country_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 56.
public mixed $date_add
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 72.
public mixed $date_from
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 44.
public mixed $date_to
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 45.
public mixed $date_upd
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 73.
public mixed $definition = array('table' => 'cart_rule', 'primary' => 'id_cart_rule', 'multilang' => true, 'fields' => array('id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'date_from' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true), 'date_to' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true), 'description' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 65534), 'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'quantity_per_user' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'priority' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'partial_use' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'code' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 254), 'minimum_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 'minimum_amount_tax' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'minimum_amount_currency' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'minimum_amount_shipping' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'country_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'carrier_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'group_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'cart_rule_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'product_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'shop_restriction' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'free_shipping' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'reduction_percent' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPercentage'), 'reduction_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 'reduction_tax' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'reduction_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'reduction_product' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'gift_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'gift_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'highlight' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => true, 'size' => 254)))
- Visibility: public
- This property is static.
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 78.
public mixed $description
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 46.
public mixed $free_shipping
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 62.
public mixed $gift_product
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 68.
public mixed $gift_product_attribute
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 69.
public mixed $group_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 58.
public mixed $highlight
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 70.
public mixed $id
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 41.
public mixed $id_customer
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 43.
public mixed $minimum_amount
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 52.
public mixed $minimum_amount_currency
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 54.
public mixed $minimum_amount_shipping
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 55.
public mixed $minimum_amount_tax
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 53.
public mixed $name
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 42.
protected mixed $only_one_gift = array()
- Visibility: protected
- This property is static.
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 39.
public mixed $partial_use = 1
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 50.
public mixed $priority = 1
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 49.
public mixed $product_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 60.
public mixed $quantity = 1
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 47.
public mixed $quantity_per_user = 1
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 48.
public mixed $reduction_amount
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 64.
public mixed $reduction_currency
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 66.
public mixed $reduction_percent
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 63.
public mixed $reduction_product
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 67.
public mixed $reduction_tax
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 65.
public mixed $shop_restriction
- Visibility: public
- This property is defined by CartRuleCore.
- Source: classes/CartRule.php line 61.
protected boolean $cache_objects = true
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 164.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 156.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 150.
protected array $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 88.
protected array $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 70.
protected array $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 106.
protected array $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 94.
protected array $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 112.
protected array $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 100.
protected array $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 118.
public boolean $force_id = false
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 159.
protected boolean $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 67.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 58.
protected integer $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 61.
public array $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 64.
protected string $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 82.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130.
protected String $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 133.
protected array $loaded_classes = array()
Holds compiled definitions of each ObjectModel class.
Values are assigned during object initialization.
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 147.
protected string $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 76.
protected array $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 124.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 153.
protected array $webserviceParameters = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 127.
mixed DiscountCore::__call($method, $args)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 124
- $method mixed
- $args mixed
mixed ObjectModelCore::__construct(integer|null $id, integer|null $id_lang, integer|null $id_shop)
Builds the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 201
- $id integer|null - If specified, loads and existing object from DB (optional).
- $id_lang integer|null - Required if object is multilingual (optional).
- $id_shop integer|null - ID shop for objects with multishop tables.
mixed DiscountCore::__get($key)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 36
- $key mixed
mixed DiscountCore::__set($key, $value)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 76
- $key mixed
- $value mixed
mixed DiscountCore::add($autodate, $nullValues, $categories)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 136
- $autodate mixed
- $nullValues mixed
- $categories mixed
boolean ObjectModelCore::addFieldsRequiredDatabase(array $fields)
Sets required field for this class in the database.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1340
- $fields array
mixed CartRuleCore::array_uintersect($array1, $array2)
- Visibility: protected
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 788
- $array1 mixed
- $array2 mixed
mixed CartRuleCore::array_uintersect_compare($a, $b)
- Visibility: protected
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 801
- $a mixed
- $b mixed
boolean|void ObjectModelCore::associateTo(integer|array $id_shops)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1408
- $id_shops integer|array
mixed CartRuleCore::autoAddToCart(\Context|null $context)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1232
- $context Context|null
mixed CartRuleCore::autoRemoveFromCart($context)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1208
- $context mixed
mixed ObjectModelCore::cacheFieldsRequiredDatabase(boolean $all)
Caches data about required objects fields in memory
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1319
- $all boolean - If true, caches required fields of all object classes.
boolean CartRuleCore::cartRuleExists($name)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 400
- $name mixed
mixed CartRuleCore::checkProductRestrictions(\Context $context, $return_products, $display_error, $already_in_cart)
- Visibility: protected
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 643
- $context Context
- $return_products mixed
- $display_error mixed
- $already_in_cart mixed
boolean|mixed|string CartRuleCore::checkValidity(\Context $context, boolean $alreadyInCart, boolean $display_error, $check_carrier)
Check if this cart rule can be applied
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 476
- $context Context
- $alreadyInCart boolean - Check if the voucher is already on the cart
- $display_error boolean - Display error
- $check_carrier mixed
mixed CartRuleCore::cleanCache()
Make sure caches are empty Must be called before calling multiple time getContextualValue()
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1087
mixed CartRuleCore::cleanProductRuleIntegrity($type, $list)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1312
- $type mixed
- $list mixed
mixed ObjectModelCore::clearCache(boolean $all)
Clears cache entries that have this object's ID.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1360
- $all boolean - If true, clears cache for all objects
mixed CartRuleCore::copyConditions(integer $id_cart_rule_source, integer $id_cart_rule_destination)
Copy conditions from one cart rule to an other
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 176
- $id_cart_rule_source integer
- $id_cart_rule_destination integer
\Discount DiscountCore::createOrderDiscount(\Order $order, $productList, $qtyList, $name, $shipping_cost, $id_category, $subcategory)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 205
- $order Order
- $productList mixed
- $qtyList mixed
- $name mixed
- $shipping_cost mixed
- $id_category mixed
- $subcategory mixed
mixed CartRuleCore::delete()
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 148
boolean CartRuleCore::deleteByIdCustomer($id_customer)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 415
- $id_customer mixed
boolean ObjectModelCore::deleteImage(boolean $force_delete)
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1585
- $force_delete boolean
boolean ObjectModelCore::deleteSelection(array $ids)
Deletes multiple objects from the database at once
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 765
- $ids array - Array of objects IDs.
mixed ObjectModelCore::disableCache()
Disables object caching
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1892
mixed DiscountCore::discountExists($discountName, $id_discount)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 195
- $discountName mixed
- $id_discount mixed
mixed DiscountCore::display($value, $type, $currency)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 256
- $value mixed
- $type mixed
- $currency mixed
string ObjectModelCore::displayFieldName(string $field, string $class, boolean $htmlentities, \Context|null $context)
Returns field name translation
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1051
- $field string - Field name
- $class string - ObjectModel class name
- $htmlentities boolean - If true, applies htmlentities() to result string
- $context Context|null - Context object
\ObjectModel|false ObjectModelCore::duplicateObject()
Takes current object ID, gets its values from database, saves them in a new row and loads newly saved values as a new object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 534
boolean|void ObjectModelCore::duplicateShops($id)
Copies shop association data from object with specified ID.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1462
- $id mixed
mixed ObjectModelCore::enableCache()
Enables object caching
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1884
boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)
Checks if an object exists in database.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1624
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $type, integer $id_lang)
Formats values of each fields.
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 322
- $type integer - FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP
- $id_lang integer - If this parameter is given, only take lang fields
mixed ObjectModelCore::formatValue(mixed $value, integer $type, boolean $with_quotes, boolean $purify, boolean $allow_null)
Formats a value
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 373
- $value mixed
- $type integer
- $with_quotes boolean
- $purify boolean
- $allow_null boolean
array|boolean CartRuleCore::getAssociatedRestrictions(string $type, boolean $active_only, boolean $i18n, integer $offset, integer $limit, string $search_cart_rule_name)
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1148
- $type string
- $active_only boolean
- $i18n boolean
- $offset integer
- $limit integer
- $search_cart_rule_name string
array ObjectModelCore::getAssociatedShops()
Gets the list of associated shop IDs
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1440
array CartRuleCore::getCartRuleCombinations(integer $offset, integer $limit, string $search)
- Visibility: protected
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1098
- $offset integer
- $limit integer
- $search string
array CartRuleCore::getCartsRuleByCode($name, $id_lang, $extended)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1355
- $name mixed
- $id_lang mixed
- $extended mixed
float|integer|string CartRuleCore::getContextualValue(boolean $use_tax, \Context $context, $filter, $package, boolean $use_cache)
The reduction value is POSITIVE
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 822
- $use_tax boolean
- $context Context
- $filter mixed
- $package mixed
- $use_cache boolean - Allow using cache to avoid multiple free gift using multishipping
array CartRuleCore::getCustomerCartRules($id_lang, $id_customer, boolean $active, boolean $includeGeneric, boolean $inStock, \Cart|null $cart, boolean $free_shipping_only, boolean $highlight_only)
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 259
- $id_lang mixed
- $id_customer mixed
- $active boolean
- $includeGeneric boolean
- $inStock boolean
- $cart Cart|null
- $free_shipping_only boolean
- $highlight_only boolean
mixed DiscountCore::getCustomerDiscounts($id_lang, $id_customer, $active, $includeGenericOnes, $hasStock, \Cart $cart)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 164
- $id_lang mixed
- $id_customer mixed
- $active mixed
- $includeGenericOnes mixed
- $hasStock mixed
- $cart Cart
array ObjectModelCore::getDefinition(string $class, string|null $field)
Returns object definition
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1740
- $class string - Name of object
- $field string|null - Name of field if we want the definition of one field only
mixed ObjectModelCore::getFieldByLang(string $field_name, integer|null $id_lang)
Return the field value for the specified language if the field is multilang, else the field value.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1849
- $field_name string
- $id_lang integer|null
array ObjectModelCore::getFields()
Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval, .
..)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 243
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 284
array|null ObjectModelCore::getFieldsRequiredDatabase(boolean $all)
Returns an array of required fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1306
- $all boolean - If true, returns required fields of all object classes.
array ObjectModelCore::getFieldsShop()
Prepare fields for multishop Fields are not validated here, we consider they are already validated in getFields() method, this is not the best solution but this is the only one possible for retro compatibility.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 267
integer|boolean CartRuleCore::getIdByCode(string $code)
Retrieves the id associated to the given code
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 240
- $code string
mixed DiscountCore::getIdByName($code)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 156
- $code mixed
array CartRuleCore::getProductRuleGroups()
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 428
array CartRuleCore::getProductRules($id_product_rule_group)
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 448
- $id_product_rule_group mixed
mixed ObjectModelCore::getRepositoryClassName()
Returns the name of the repository class for this entity.
If unspecified, a generic repository will be used for the entity.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 166
array ObjectModelCore::getTranslationsFields(array $fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 806
- $fields_array array
array ObjectModelCore::getValidationRules(string $class)
Returns object validation rules (fields validity)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 178
- $class string - Child class name for static use (optional)
mixed DiscountCore::getValue($nb_discounts, $order_total_products, $shipping_fees, $id_cart, $useTax, \Currency $currency, \Shop $shop)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 180
- $nb_discounts mixed
- $order_total_products mixed
- $shipping_fees mixed
- $id_cart mixed
- $useTax mixed
- $currency Currency
- $shop Shop
mixed DiscountCore::getVouchersToCartDisplay($id_lang, $id_customer)
- Visibility: public
- This method is static.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 172
- $id_lang mixed
- $id_customer mixed
array|null ObjectModelCore::getWebserviceObjectList(string $sql_join, string $sql_filter, string $sql_sort, string $sql_limit)
Returns webservice object list.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1230
- $sql_join string
- $sql_filter string
- $sql_sort string
- $sql_limit string
array ObjectModelCore::getWebserviceParameters(string|null $ws_params_attribute_name)
Returns webservice parameters of this object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1140
- $ws_params_attribute_name string|null
boolean ObjectModelCore::hasMultishopEntries()
Checks if there is more than one entry in associated shop table for current object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1488
mixed ObjectModelCore::hydrate(array $data, integer|null $id_lang)
Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1666
- $data array
- $id_lang integer|null
array ObjectModelCore::hydrateCollection(string $class, array $datas, integer|null $id_lang)
Fill (hydrate) a list of objects in order to get a collection of these objects
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1688
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer|null
boolean ObjectModelCore::isAssociatedToShop(integer|null $id_shop)
Checks if current object is associated to a shop.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1375
- $id_shop integer|null
boolean ObjectModelCore::isCurrentlyUsed(string|null $table, boolean $has_active_column)
Checks if an object type exists in the database.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1644
- $table string|null - Name of table linked to entity
- $has_active_column boolean - True if the table has an active column
boolean CartRuleCore::isFeatureActive()
- Visibility: public
- This method is static.
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 1303
boolean ObjectModelCore::isLangMultishop()
Checks if the object is both multi-language and multi-shop.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1523
boolean ObjectModelCore::isMultiShopField(string $field)
Checks if a field is a multi-shop field.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1513
- $field string
boolean ObjectModelCore::isMultishop()
Checks if object is multi-shop object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1501
mixed ObjectModelCore::makeTranslationFields(array $fields, array $fields_array, integer $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 827
- $fields array
- $fields_array array
- $id_language integer
boolean ObjectModelCore::save(boolean $null_values, boolean $auto_date)
Saves current object to database (add or update)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 429
- $null_values boolean
- $auto_date boolean
mixed ObjectModelCore::setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1778
mixed ObjectModelCore::setFieldsToUpdate(array $fields)
Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1876
- $fields array
boolean ObjectModelCore::toggleStatus()
Toggles object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 783
mixed DiscountCore::update($autodate, $nullValues, $categories)
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- Source: classes/Discount.php line 146
- $autodate mixed
- $nullValues mixed
- $categories mixed
boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)
Updates a table and splits the common datas and the shop datas.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1539
- $classname string
- $data array
- $where string
- $specific_where string - Only executed for common table
boolean CartRuleCore::usedByCustomer($id_customer)
- Visibility: public
- This method is defined by CartRuleCore.
- Source: classes/CartRule.php line 386
- $id_customer mixed
array ObjectModelCore::validateControler(boolean $htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1071
- $htmlentities boolean
array ObjectModelCore::validateController(boolean $htmlentities)
Validates submitted values and returns an array of errors, if any.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1084
- $htmlentities boolean - If true, uses htmlentities() for field name translations in errors.
true|string ObjectModelCore::validateField(string $field, mixed $value, integer|null $id_lang, array $skip, boolean $human_errors)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 946
- $field string - Field name
- $value mixed - Field value
- $id_lang integer|null - Language ID
- $skip array - Array of fields to skip.
- $human_errors boolean - If true, uses more descriptive, translatable error strings.
boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)
Checks if object field values are valid before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 867
- $die boolean
- $error_return boolean
boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)
Checks if multilingual object field values are valid before database interaction.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 898
- $die boolean
- $error_return boolean
array ObjectModelCore::validateFieldsRequiredDatabase(boolean $htmlentities)
Validate required fields.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1275
- $htmlentities boolean