OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Application\Model\DeliveryList Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Application\Model\DeliveryList:
+ Collaboration diagram for OxidEsales\EshopCommunity\Application\Model\DeliveryList:

Public Member Functions

 __construct ()
 
 setHomeCountry ($sHomeCountry)
 
 getDeliveryList ($oBasket, $oUser=null, $sDelCountry=null, $sDelSet=null)
 
 hasDeliveries ($oBasket, $oUser, $sDelCountry, $sDeliverySetId)
 
 getUser ()
 
 setUser ($oUser)
 
 setCollectFittingDeliveriesSets ($blCollectFittingDeliveriesSets=false)
 
 loadDeliveryListForProduct ($oProduct)
 

Protected Member Functions

 _getList ($oUser=null, $sCountryId=null, $sDelSet=null)
 
 _getFilterSelect ($oUser, $sCountryId, $sDelSet)
 

Protected Attributes

 $_sUserId = null
 
 $_blPerfLoadDelivery = null
 
 $_aDeliveries = []
 
 $_oUser = null
 
 $_sHomeCountry = null
 
 $_blCollectFittingDeliveriesSets = false
 

Detailed Description

Delivery list manager.

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::__construct ( )

Calls parent constructor and sets home country

Member Function Documentation

◆ _getFilterSelect()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::_getFilterSelect (   $oUser,
  $sCountryId,
  $sDelSet 
)
protected

Creates delivery list filter SQL to load current state delivery list

Parameters
\OxidEsales\Eshop\Application\Model\User$oUsersession user object
string$sCountryIduser country id
string$sDelSetuser chosen delivery set
Returns
string

◆ _getList()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::_getList (   $oUser = null,
  $sCountryId = null,
  $sDelSet = null 
)
protected

Returns active delivery list

Loads all active delivery in list. Additionally checks if set has user customized parameters like assigned users, countries or user groups. Performs additional filtering according to these parameters

Parameters
\OxidEsales\Eshop\Application\Model\User$oUsersession user object
string$sCountryIduser country id
string$sDelSetuser chosen delivery set
Returns
array

◆ getDeliveryList()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::getDeliveryList (   $oBasket,
  $oUser = null,
  $sDelCountry = null,
  $sDelSet = null 
)

Loads and returns list of deliveries.

Process:

  • first checks if delivery loading is enabled in config - $myConfig->bl_perfLoadDelivery is TRUE;
  • loads delivery set list by calling this::GetDeliverySetList(...);
  • checks if there is any active (eg. chosen delivery set in order process etc) delivery set defined and if its set - rearranges delivery set list by storing active set at the beginning in the list.
  • goes through delivery sets and loads its deliveries, checks if any delivery fits. By checking calculates and stores conditional amounts:

    oDelivery->iItemCnt - items in basket that fits this delivery oDelivery->iProdCnt - products in basket that fits this delivery oDelivery->dPrice - price of products that fits this delivery

  • returns a list of deliveries. NOTICE: for performance reasons deliveries is cached in $myConfig->aDeliveryList.
Parameters
object$oBasketbasket object
\OxidEsales\Eshop\Application\Model\User$oUsersession user
string$sDelCountryuser country id
string$sDelSetdelivery set id
Returns
array

◆ getUser()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::getUser ( )

Get current user object. If user is not set, try to get current user.

Returns
\OxidEsales\Eshop\Application\Model\User

◆ hasDeliveries()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::hasDeliveries (   $oBasket,
  $oUser,
  $sDelCountry,
  $sDeliverySetId 
)

Checks if deliveries in list fits for current basket and delivery set

Parameters
\OxidEsales\Eshop\Application\Model\Basket$oBasketshop basket
\OxidEsales\Eshop\Application\Model\User$oUsersession user
string$sDelCountrydelivery country
string$sDeliverySetIddelivery set id to check its relation to delivery list
Returns
bool

◆ loadDeliveryListForProduct()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::loadDeliveryListForProduct (   $oProduct)

Load oxDeliveryList for product

Parameters
object$oProductoxArticle object

◆ setCollectFittingDeliveriesSets()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::setCollectFittingDeliveriesSets (   $blCollectFittingDeliveriesSets = false)

Force or not to collect deliveries sets instead of deliveries when getting deliveries list in getDeliveryList()

Parameters
bool$blCollectFittingDeliveriesSetscollect deliveries sets or not

◆ setHomeCountry()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::setHomeCountry (   $sHomeCountry)

Home country setter

Parameters
string$sHomeCountryhome country id

◆ setUser()

OxidEsales\EshopCommunity\Application\Model\DeliveryList::setUser (   $oUser)

Set current user object

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseruser object

Member Data Documentation

◆ $_aDeliveries

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_aDeliveries = []
protected

◆ $_blCollectFittingDeliveriesSets

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_blCollectFittingDeliveriesSets = false
protected

◆ $_blPerfLoadDelivery

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_blPerfLoadDelivery = null
protected

◆ $_oUser

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_oUser = null
protected

◆ $_sHomeCountry

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_sHomeCountry = null
protected

◆ $_sUserId

OxidEsales\EshopCommunity\Application\Model\DeliveryList::$_sUserId = null
protected

The documentation for this class was generated from the following file: