Skip to content

Latest commit

 

History

History
3582 lines (1806 loc) · 79.5 KB

class.CartCore.md

File metadata and controls

3582 lines (1806 loc) · 79.5 KB

Class CartCore

Contents

Constants

Properties

Methods

Constants

BOTH

const BOTH = 3

BOTH_WITHOUT_SHIPPING

const BOTH_WITHOUT_SHIPPING = 4

ONLY_DISCOUNTS

const ONLY_DISCOUNTS = 2

ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING

const ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING = 8

ONLY_PRODUCTS

const ONLY_PRODUCTS = 1

ONLY_PRODUCTS_WITHOUT_SHIPPING

const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7

ONLY_SHIPPING

const ONLY_SHIPPING = 5

ONLY_WRAPPING

const ONLY_WRAPPING = 6

Properties

$_attributesLists

protected mixed $_attributesLists = array()

$_carriers

protected mixed $_carriers = null

$_customer

protected mixed $_customer = null

$_isVirtualCart

protected mixed $_isVirtualCart = array()

$_nbProducts

protected mixed $_nbProducts = array()

$_products

protected mixed $_products = null

$_taxCalculationMethod

protected mixed $_taxCalculationMethod = PS_TAX_EXC

$_taxes_rate

protected mixed $_taxes_rate = null

$_totalWeight

protected mixed $_totalWeight = array()

$allow_seperated_package

public boolean $allow_seperated_package = false

$checkedTos

public mixed $checkedTos = false

$date_add

public string $date_add

$date_upd

public string $date_upd

$definition

public mixed $definition = array('table' => 'cart', 'primary' => 'id_cart', 'fields' => array('id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_address_delivery' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_address_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_guest' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'), 'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'delivery_option' => array('type' => self::TYPE_STRING), 'secure_key' => array('type' => self::TYPE_STRING, 'size' => 32), 'allow_seperated_package' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat')))

$delivery_option

public mixed $delivery_option

$gift

public boolean $gift

$gift_message

public string $gift_message

$id

public mixed $id

$id_address_delivery

public integer $id_address_delivery

$id_address_invoice

public integer $id_address_invoice

$id_carrier

public integer $id_carrier

$id_currency

public integer $id_currency

$id_customer

public integer $id_customer

$id_guest

public integer $id_guest

$id_lang

public integer $id_lang

$id_shop

public mixed $id_shop

$id_shop_group

public mixed $id_shop_group

$mobile_theme

public boolean $mobile_theme

$pictures

public mixed $pictures

$recyclable

public boolean $recyclable

$secure_key

public string $secure_key

$textFields

public mixed $textFields

$webserviceParameters

protected mixed $webserviceParameters = array('fields' => array('id_address_delivery' => array('xlink_resource' => 'addresses'), 'id_address_invoice' => array('xlink_resource' => 'addresses'), 'id_currency' => array('xlink_resource' => 'currencies'), 'id_customer' => array('xlink_resource' => 'customers'), 'id_guest' => array('xlink_resource' => 'guests'), 'id_lang' => array('xlink_resource' => 'languages')), 'associations' => array('cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array('id_product' => array('required' => true, 'xlink_resource' => 'products'), 'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'), 'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'), 'quantity' => array('required' => true)))))

$cache_objects

protected boolean $cache_objects = true

$db

protected \Db $db = false

$def

protected array $def

$fieldsRequired

protected mixed $fieldsRequired = array()

$fieldsRequiredDatabase

protected mixed $fieldsRequiredDatabase = null

$fieldsRequiredLang

protected mixed $fieldsRequiredLang = array()

$fieldsSize

protected mixed $fieldsSize = array()

$fieldsSizeLang

protected mixed $fieldsSizeLang = array()

$fieldsValidate

protected mixed $fieldsValidate = array()

$fieldsValidateLang

protected mixed $fieldsValidateLang = array()

$force_id

public \boolean, $force_id = false

$get_shop_from_context

protected mixed $get_shop_from_context = true

$id_shop_list

public mixed $id_shop_list = null

$identifier

protected mixed $identifier

$image_dir

protected string $image_dir = null

$image_format

protected string $image_format = 'jpg'

$loaded_classes

protected mixed $loaded_classes = array()

$table

protected mixed $table

$tables

protected mixed $tables = array()

$update_fields

protected array $update_fields = null

Methods

__construct

mixed CartCore::__construct($id, $id_lang)

Arguments

  • $id mixed
  • $id_lang mixed

_addCustomization

boolean CartCore::_addCustomization(integer $id_product, integer $id_product_attribute, integer $index, integer $type, string $field, integer $quantity)

Add customization item to database

Arguments

  • $id_product integer
  • $id_product_attribute integer
  • $index integer
  • $type integer
  • $field string
  • $quantity integer

_deleteCustomization

boolean CartCore::_deleteCustomization(integer $id_customization, $id_product, $id_product_attribute, $id_address_delivery)

Delete a customization from the cart. If customization is a Picture, then the image is also deleted

Arguments

  • $id_customization integer
  • $id_product mixed
  • $id_product_attribute mixed
  • $id_address_delivery mixed

_updateCustomizationQuantity

mixed CartCore::_updateCustomizationQuantity($quantity, $id_customization, $id_product, $id_product_attribute, $id_address_delivery, $operator)

Arguments

  • $quantity mixed
  • $id_customization mixed
  • $id_product mixed
  • $id_product_attribute mixed
  • $id_address_delivery mixed
  • $operator mixed

add

mixed CartCore::add($autodate, $null_values)

Arguments

  • $autodate mixed
  • $null_values mixed

addCartRule

mixed CartCore::addCartRule($id_cart_rule)

Arguments

  • $id_cart_rule mixed

addDiscount

mixed CartCore::addDiscount($id_cart_rule)

Arguments

  • $id_cart_rule mixed

addExtraCarriers

mixed CartCore::addExtraCarriers(array $array)

Execute hook displayCarrierList (extraCarrier) and merge theme to the $array

Arguments

  • $array array

addFieldsRequiredDatabase

mixed ObjectModelCore::addFieldsRequiredDatabase($fields)

Arguments

  • $fields mixed

addPictureToProduct

boolean CartCore::addPictureToProduct($id_product, $index, $type, $file)

Add customer's pictures

Arguments

  • $id_product mixed
  • $index mixed
  • $type mixed
  • $file mixed

addTextFieldToProduct

boolean CartCore::addTextFieldToProduct($id_product, $index, $type, $text_value)

Add customer's text

Arguments

  • $id_product mixed
  • $index mixed
  • $type mixed
  • $text_value mixed

associateTo

boolean ObjectModelCore::associateTo(integer|array $id_shops)

This function associate an item to its context

Arguments

  • $id_shops integer|array

autosetProductAddress

mixed CartCore::autosetProductAddress()

Set an address to all products on the cart without address delivery

cacheFieldsRequiredDatabase

mixed ObjectModelCore::cacheFieldsRequiredDatabase($all)

Arguments

  • $all mixed

cacheSomeAttributesLists

mixed CartCore::cacheSomeAttributesLists($ipa_list, $id_lang)

Arguments

  • $ipa_list mixed
  • $id_lang mixed

carrierIsSelected

mixed CartCore::carrierIsSelected($id_carrier, $id_address)

Arguments

  • $id_carrier mixed
  • $id_address mixed

checkDiscountValidity

mixed CartCore::checkDiscountValidity($obj, $discounts, $order_total, $products, $check_cart_discount)

Arguments

  • $obj mixed
  • $discounts mixed
  • $order_total mixed
  • $products mixed
  • $check_cart_discount mixed

checkProductsAccess

mixed CartCore::checkProductsAccess()

checkQuantities

mixed CartCore::checkQuantities($return_product)

Arguments

  • $return_product mixed

clearCache

mixed ObjectModelCore::clearCache($all)

Arguments

  • $all mixed

containsProduct

mixed CartCore::containsProduct($id_product, $id_product_attribute, $id_customization, $id_address_delivery)

Arguments

  • $id_product mixed
  • $id_product_attribute mixed
  • $id_customization mixed
  • $id_address_delivery mixed

delete

mixed CartCore::delete()

deleteAssociations

mixed CartCore::deleteAssociations()

deleteCustomizationToProduct

boolean CartCore::deleteCustomizationToProduct(integer $id_product, integer $index)

Remove a customer's customization

Arguments

  • $id_product integer
  • $index integer

deleteDiscount

mixed CartCore::deleteDiscount($id_cart_rule)

Arguments

  • $id_cart_rule mixed

deleteImage

boolean ObjectModelCore::deleteImage($force_delete)

Delete images associated with the object

Arguments

  • $force_delete mixed

deletePictureToProduct

mixed CartCore::deletePictureToProduct($id_product, $index)

Arguments

  • $id_product mixed
  • $index mixed

deleteProduct

boolean CartCore::deleteProduct(integer $id_product, integer $id_product_attribute, integer $id_customization, $id_address_delivery)

Delete a product from the cart

Arguments

  • $id_product integer - Product ID
  • $id_product_attribute integer - Attribute ID if needed
  • $id_customization integer - Customization id
  • $id_address_delivery mixed

deleteSelection

boolean ObjectModelCore::deleteSelection(array $selection)

Delete several objects from database

Arguments

  • $selection array

desintifier

mixed CartCore::desintifier($int, $delimiter)

Translate a int option_delivery identifier (3240002000) in a string ('24,3,')

Arguments

  • $int mixed
  • $delimiter mixed

disableCache

mixed ObjectModelCore::disableCache()

displayFieldName

mixed ObjectModelCore::displayFieldName($field, $class, $htmlentities, \Context $context)

Arguments

  • $field mixed
  • $class mixed
  • $htmlentities mixed
  • $context Context

duplicate

mixed CartCore::duplicate()

duplicateObject

\new ObjectModelCore::duplicateObject()

Duplicate current object to database

duplicateProduct

mixed CartCore::duplicateProduct($id_product, $id_product_attribute, $id_address_delivery, $new_id_address_delivery, $quantity, $keep_quantity)

Arguments

  • $id_product mixed
  • $id_product_attribute mixed
  • $id_address_delivery mixed
  • $new_id_address_delivery mixed
  • $quantity mixed
  • $keep_quantity mixed

duplicateShops

mixed ObjectModelCore::duplicateShops($id)

Arguments

  • $id mixed

enableCache

mixed ObjectModelCore::enableCache()

existsInDatabase

boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)

Specify if an ObjectModel is already in database

Arguments

  • $id_entity integer
  • $table string

formatFields

array ObjectModelCore::formatFields(integer $type, integer $id_lang)

Arguments

  • $type integer - FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP
  • $id_lang integer - If this parameter is given, only take lang fields

formatValue

mixed ObjectModelCore::formatValue(mixed $value, integer $type, $with_quotes, $purify)

Format a data

Arguments

  • $value mixed
  • $type integer
  • $with_quotes mixed
  • $purify mixed

getAddressCollection

mixed CartCore::getAddressCollection()

Get all delivery addresses object for the current cart

getAssociatedShops

array ObjectModelCore::getAssociatedShops()

Get the list of associated id_shop

getCarrierCost

float CartCore::getCarrierCost(integer $id_carrier, \booleal $useTax, \Country $default_country, array $delivery_option)

Return shipping total of a specific carriers for the cart

Arguments

  • $id_carrier integer
  • $useTax booleal
  • $default_country Country
  • $delivery_option array - Array of the delivery option for each address

getCartByOrderId

\Cart|boolean CartCore::getCartByOrderId(integer $id_order)

Build cart object from provided id_order

Arguments

  • $id_order integer

getCartIdByOrderId

mixed CartCore::getCartIdByOrderId($id_order)

Arguments

  • $id_order mixed

getCartRules

mixed CartCore::getCartRules($filter)

Arguments

  • $filter mixed

getCustomerCarts

mixed CartCore::getCustomerCarts($id_customer, $with_order)

Arguments

  • $id_customer mixed
  • $with_order mixed

getDefinition

array ObjectModelCore::getDefinition(string $class, string $field)

Get object definition

Arguments

  • $class string - Name of object
  • $field string - Name of field if we want the definition of one field only

getDeliveryAddressesWithoutCarriers

array CartCore::getDeliveryAddressesWithoutCarriers(boolean $return_collection)

Get all the ids of the delivery addresses without carriers

Arguments

  • $return_collection boolean - Return a collection

getDeliveryOption

array CartCore::getDeliveryOption($default_country, $dontAutoSelectOptions, $use_cache)

Get the delivery option seleted, or if no delivery option was selected, the cheapest option for each address

Arguments

  • $default_country mixed
  • $dontAutoSelectOptions mixed
  • $use_cache mixed

getDeliveryOptionList

array CartCore::getDeliveryOptionList(\Country $default_country, boolean $flush)

Get all deliveries options available for the current cart

Arguments

  • $default_country Country
  • $flush boolean - Force flushing cache

getDiscounts

mixed CartCore::getDiscounts($lite, $refresh)

Arguments

  • $lite mixed
  • $refresh mixed

getDiscountsCustomer

mixed CartCore::getDiscountsCustomer($id_cart_rule)

Arguments

  • $id_cart_rule mixed

getFieldByLang

mixed ObjectModelCore::getFieldByLang($field_name, null $id_lang)

Return the field value for the specified language if the field is multilang, else the field value.

Arguments

  • $field_name mixed
  • $id_lang null

getFields

array ObjectModelCore::getFields()

Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval.

..)

getFieldsLang

array ObjectModelCore::getFieldsLang()

Prepare multilang fields

getFieldsRequiredDatabase

mixed ObjectModelCore::getFieldsRequiredDatabase($all)

Arguments

  • $all mixed

getFieldsShop

array ObjectModelCore::getFieldsShop()

Prepare fields for multishop Fields are not validated here, we considere they are already validated in getFields() method, this not the best solution but this is the only one possible for retro compatibility.

getGiftWrappingPrice

float CartCore::getGiftWrappingPrice(boolean $with_taxes, $id_address)

Get the gift wrapping price

Arguments

  • $with_taxes boolean - With or without taxes
  • $id_address mixed

getIdCarrierFromDeliveryOption

mixed CartCore::getIdCarrierFromDeliveryOption($delivery_option)

Arguments

  • $delivery_option mixed

getLastProduct

mixed CartCore::getLastProduct()

getNbOfPackages

integer CartCore::getNbOfPackages()

Get the number of packages

getNbProducts

mixed CartCore::getNbProducts($id)

Arguments

  • $id mixed

getOrderShippingCost

mixed CartCore::getOrderShippingCost($id_carrier, $use_tax, \Country $default_country, $product_list)

Arguments

  • $id_carrier mixed
  • $use_tax mixed
  • $default_country Country
  • $product_list mixed

getOrderTotal

float CartCore::getOrderTotal($with_taxes, integer $type, $products, $id_carrier, boolean $use_cache)

This function returns the total cart amount

Possible values for $type: Cart::ONLY_PRODUCTS Cart::ONLY_DISCOUNTS Cart::BOTH Cart::BOTH_WITHOUT_SHIPPING Cart::ONLY_SHIPPING Cart::ONLY_WRAPPING Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING

Arguments

  • $with_taxes mixed
  • $type integer - Total type
  • $products mixed
  • $id_carrier mixed
  • $use_cache boolean - Allow using cache of the method CartRule::getContextualValue

getOrderTotalUsingTaxCalculationMethod

mixed CartCore::getOrderTotalUsingTaxCalculationMethod($id_cart)

Arguments

  • $id_cart mixed

getOrderedCartRulesIds

array CartCore::getOrderedCartRulesIds($filter)

Return the cart rules Ids on the cart.

Arguments

  • $filter mixed

getPackageIdWarehouse

mixed CartCore::getPackageIdWarehouse($package, $id_carrier)

Arguments

  • $package mixed
  • $id_carrier mixed

getPackageList

array CartCore::getPackageList($flush)

Get products grouped by package and by addresses to be sent individualy (one package = one shipping cost).

Arguments

  • $flush mixed

getPackageShippingCost

float CartCore::getPackageShippingCost(integer $id_carrier, \booleal $use_tax, \Country $default_country, Array $product_list, $id_zone)

Return package shipping cost

Arguments

  • $id_carrier integer - Carrier ID (default : current carrier)
  • $use_tax booleal
  • $default_country Country
  • $product_list Array
  • $id_zone mixed

getProductCustomization

array CartCore::getProductCustomization(integer $id_product, integer $type, boolean $not_in_cart)

Return custom pictures in this cart for a specified product

Arguments

  • $id_product integer
  • $type integer - only return customization of this type
  • $not_in_cart boolean - only return customizations that are not in cart already

getProducts

mixed CartCore::getProducts($refresh, $id_product, $id_country)

Return cart products

Arguments

  • $refresh mixed
  • $id_product mixed
  • $id_country mixed

getSummaryDetails

array CartCore::getSummaryDetails($id_lang, $refresh)

Return useful informations for cart

Arguments

  • $id_lang mixed
  • $refresh mixed

getTaxesAverageUsed

mixed CartCore::getTaxesAverageUsed($id_cart)

Arguments

  • $id_cart mixed

getTotalCart

mixed CartCore::getTotalCart($id_cart, $use_tax_display, $type)

Arguments

  • $id_cart mixed
  • $use_tax_display mixed
  • $type mixed

getTotalShippingCost

float CartCore::getTotalShippingCost(array $delivery_option, \booleal $use_tax, \Country $default_country)

Return shipping total for the cart

Arguments

  • $delivery_option array - Array of the delivery option for each address
  • $use_tax booleal
  • $default_country Country

getTotalWeight

float CartCore::getTotalWeight($products)

Return cart weight

Arguments

  • $products mixed

getTranslationsFields

mixed ObjectModelCore::getTranslationsFields($fields_array)

Arguments

  • $fields_array mixed

getValidationRules

array ObjectModelCore::getValidationRules(string $class)

Returns object validation rules (fields validity)

Arguments

  • $class string - Child class name for static use (optional)

getWebserviceObjectList

mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)

Arguments

  • $sql_join mixed
  • $sql_filter mixed
  • $sql_sort mixed
  • $sql_limit mixed

getWebserviceParameters

mixed ObjectModelCore::getWebserviceParameters($ws_params_attribute_name)

Arguments

  • $ws_params_attribute_name mixed

getWsCartRows

mixed CartCore::getWsCartRows()

hasMultishopEntries

boolean ObjectModelCore::hasMultishopEntries()

Check if there is more than one entries in associated shop table for current entity

hydrate

mixed ObjectModelCore::hydrate(array $data, integer $id_lang)

Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)

Arguments

  • $data array
  • $id_lang integer

hydrateCollection

array ObjectModelCore::hydrateCollection(string $class, array $datas, integer $id_lang)

Fill (hydrate) a list of objects in order to get a collection of these objects

Arguments

  • $class string - Class of objects to hydrate
  • $datas array - List of data (multi-dimensional array)
  • $id_lang integer

intifier

integer CartCore::intifier($string, $delimiter)

Translate a string option_delivery identifier ('24,3,') in a int (3240002000)

The option_delivery identifier is a list of integers separated by a ','. This method replace the delimiter by a sequence of '0'. The size of this sequence is fixed by the first digit of the return

Arguments

  • $string mixed
  • $delimiter mixed

isAllProductsInStock

boolean CartCore::isAllProductsInStock(boolean $ignore_virtual, boolean $exclusive)

Arguments

  • $ignore_virtual boolean - Ignore virtual product
  • $exclusive boolean - If true, the validation is exclusive : it must be present product in stock and out of stock

isAssociatedToShop

boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)

Check if current object is associated to a shop

Arguments

  • $id_shop integer

isCarrierInRange

mixed CartCore::isCarrierInRange($id_carrier, $id_zone)

isCarrierInRange

Check if the specified carrier is in range

Arguments

  • $id_carrier mixed
  • $id_zone mixed

isCurrentlyUsed

boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)

This method is allow to know if a entity is currently used

Arguments

  • $table string - name of table linked to entity
  • $has_active_column boolean - true if the table has an active column

isGuestCartByCartId

boolean CartCore::isGuestCartByCartId(integer $id_cart)

isGuestCartByCartId

Arguments

  • $id_cart integer

isLangMultishop

mixed ObjectModelCore::isLangMultishop()

isMultiAddressDelivery

boolean CartCore::isMultiAddressDelivery()

Does the cart use multiple address

isMultiShopField

mixed ObjectModelCore::isMultiShopField($field)

Arguments

  • $field mixed

isMultishop

mixed ObjectModelCore::isMultishop()

isVirtualCart

boolean CartCore::isVirtualCart($strict)

Check if cart contains only virtual products

Arguments

  • $strict mixed

lastNoneOrderedCart

mixed CartCore::lastNoneOrderedCart($id_customer)

Arguments

  • $id_customer mixed

makeTranslationFields

mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)

Arguments

  • $fields mixed
  • $fields_array mixed
  • $id_language mixed

nbProducts

mixed CartCore::nbProducts()

Return cart products quantity

orderExists

boolean CartCore::orderExists()

Check if order has already been placed

removeCartRule

mixed CartCore::removeCartRule($id_cart_rule)

Arguments

  • $id_cart_rule mixed

replaceZeroByShopName

mixed CartCore::replaceZeroByShopName($echo, $tr)

Arguments

  • $echo mixed
  • $tr mixed

save

boolean ObjectModelCore::save(boolean $null_values, boolean $autodate)

Save current object to database (add or update)

Arguments

  • $null_values boolean
  • $autodate boolean

setDefinitionRetrocompatibility

mixed ObjectModelCore::setDefinitionRetrocompatibility()

Retrocompatibility for classes without $definition static Remove this in 1.6 !

setDeliveryOption

mixed CartCore::setDeliveryOption($delivery_option)

Set the delivery option and id_carrier, if there is only one carrier

Arguments

  • $delivery_option mixed

setFieldsToUpdate

mixed ObjectModelCore::setFieldsToUpdate(array $fields)

Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))

Arguments

  • $fields array

setNoMultishipping

mixed CartCore::setNoMultishipping()

Update products cart address delivery with the address delivery of the cart

setProductAddressDelivery

mixed CartCore::setProductAddressDelivery($id_product, $id_product_attribute, $old_id_address_delivery, $new_id_address_delivery)

Arguments

  • $id_product mixed
  • $id_product_attribute mixed
  • $old_id_address_delivery mixed
  • $new_id_address_delivery mixed

setTaxCalculationMethod

mixed CartCore::setTaxCalculationMethod()

setWsCartRows

mixed CartCore::setWsCartRows($values)

Arguments

  • $values mixed

simulateCarrierSelectedOutput

mixed CartCore::simulateCarrierSelectedOutput($use_cache)

Arguments

  • $use_cache mixed

simulateCarriersOutput

mixed CartCore::simulateCarriersOutput(\Country $default_country, boolean $flush)

Get all deliveries options available for the current cart formated like Carriers::getCarriersForOrder This method was wrote for retrocompatibility with 1.4 theme New theme need to use Cart::getDeliveryOptionList() to generate carriers option in the checkout process

Arguments

  • $default_country Country
  • $flush boolean - Force flushing cache

sortDeliveryOptionList

integer CartCore::sortDeliveryOptionList($option1, $option2)

Sort list of option delivery by parameters define in the BO

Arguments

  • $option1 mixed
  • $option2 mixed

toggleStatus

boolean ObjectModelCore::toggleStatus()

Toggle object status in database

update

mixed CartCore::update($null_values)

Arguments

  • $null_values mixed

updateAddressId

mixed CartCore::updateAddressId(integer $id_address, integer $id_address_new)

Update the address id of the cart

Arguments

  • $id_address integer - Current address id to change
  • $id_address_new integer - New address id

updateMultishopTable

boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)

Update a table and splits the common datas and the shop datas

Arguments

  • $classname string
  • $data array
  • $where string
  • $specific_where string - Only executed for common table

updateQty

mixed CartCore::updateQty(integer $quantity, integer $id_product, integer $id_product_attribute, $id_customization, string $operator, $id_address_delivery, \Shop $shop, $auto_add_cart_rule)

Update product quantity

Arguments

  • $quantity integer - Quantity to add (or substract)
  • $id_product integer - Product ID
  • $id_product_attribute integer - Attribute ID if needed
  • $id_customization mixed
  • $operator string - Indicate if quantity must be increased or decreased
  • $id_address_delivery mixed
  • $shop Shop
  • $auto_add_cart_rule mixed

validateControler

mixed ObjectModelCore::validateControler($htmlentities)

TODO: refactor rename all calls to this to validateController

Arguments

  • $htmlentities mixed

validateController

mixed ObjectModelCore::validateController($htmlentities)

Arguments

  • $htmlentities mixed

validateField

boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang, $skip, $human_errors)

Validate a single field

Arguments

  • $field string - Field name
  • $value mixed - Field value
  • $id_lang integer
  • $skip mixed
  • $human_errors mixed

validateFields

boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)

Check for fields validity before database interaction

Arguments

  • $die boolean
  • $error_return boolean

validateFieldsLang

boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)

Check for multilingual fields validity before database interaction

Arguments

  • $die boolean
  • $error_return boolean

validateFieldsRequiredDatabase

mixed ObjectModelCore::validateFieldsRequiredDatabase($htmlentities)

Arguments

  • $htmlentities mixed