idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
37,000 | public function doRequest ( \ OxidEsales \ Eshop \ Core \ OnlineLicenseCheckRequest $ oRequest ) { return $ this -> _formResponse ( $ this -> call ( $ oRequest ) ) ; } | Performs Web service request |
37,001 | protected function _formResponse ( $ sRawResponse ) { $ oUtilsXml = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsXml ( ) ; if ( empty ( $ sRawResponse ) || ! ( $ oDomDoc = $ oUtilsXml -> loadXml ( $ sRawResponse ) ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ StandardException ( 'OLC_ERROR_RESPONSE_NOT_VALID' ) ; } if ( $ oDomDoc -> documentElement -> nodeName != $ this -> _sResponseElement ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ StandardException ( 'OLC_ERROR_RESPONSE_UNEXPECTED' ) ; } $ oResponseNode = $ oDomDoc -> firstChild ; if ( ! $ oResponseNode -> hasChildNodes ( ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ StandardException ( 'OLC_ERROR_RESPONSE_NOT_VALID' ) ; } $ oNodes = $ oResponseNode -> childNodes ; $ oResponse = oxNew ( \ OxidEsales \ Eshop \ Core \ OnlineLicenseCheckResponse :: class ) ; for ( $ i = 0 ; $ i < $ oNodes -> length ; $ i ++ ) { $ sNodeName = $ oNodes -> item ( $ i ) -> nodeName ; $ sNodeValue = $ oNodes -> item ( $ i ) -> nodeValue ; $ oResponse -> $ sNodeName = $ sNodeValue ; } return $ oResponse ; } | Parse response message received from Online License Key Check web service and save it to response object . |
37,002 | public function createClassChain ( $ className , $ classAlias = null ) { if ( ! $ classAlias ) { $ classAlias = $ className ; } $ activeChain = $ this -> getActiveChain ( $ className , $ classAlias ) ; if ( ! empty ( $ activeChain ) ) { $ className = $ this -> createClassExtensions ( $ activeChain , $ classAlias ) ; } return $ className ; } | Creates given class chains . |
37,003 | public function getActiveChain ( $ className , $ classAlias = null ) { if ( ! $ classAlias ) { $ classAlias = $ className ; } $ fullChain = $ this -> getFullChain ( $ className , $ classAlias ) ; $ activeChain = [ ] ; if ( ! empty ( $ fullChain ) ) { $ activeChain = $ this -> filterInactiveExtensions ( $ fullChain ) ; } return $ activeChain ; } | Assembles class chains . |
37,004 | public function getFullChain ( $ className , $ classAlias ) { $ fullChain = [ ] ; $ lowerCaseClassAlias = strtolower ( $ classAlias ) ; $ lowerCaseClassName = strtolower ( $ className ) ; $ variablesLocator = $ this -> getModuleVariablesLocator ( ) ; $ modules = $ this -> getModulesArray ( $ variablesLocator ) ; $ modules = array_change_key_case ( $ modules ) ; $ allExtendedClasses = array_keys ( $ modules ) ; $ currentExtendedClasses = array_intersect ( $ allExtendedClasses , [ $ lowerCaseClassName , $ lowerCaseClassAlias ] ) ; if ( ! empty ( $ currentExtendedClasses ) ) { $ classChains = [ ] ; if ( false !== $ position = array_search ( $ lowerCaseClassName , $ allExtendedClasses ) ) { $ classChains [ $ position ] = explode ( "&" , $ modules [ $ lowerCaseClassName ] ) ; } if ( false !== $ position = array_search ( $ lowerCaseClassAlias , $ allExtendedClasses ) ) { $ classChains [ $ position ] = explode ( "&" , $ modules [ $ lowerCaseClassAlias ] ) ; } ksort ( $ classChains ) ; $ fullChain = [ ] ; if ( 1 === count ( $ classChains ) ) { $ fullChain = reset ( $ classChains ) ; } if ( 2 === count ( $ classChains ) ) { $ fullChain = array_merge ( reset ( $ classChains ) , next ( $ classChains ) ) ; } } return $ fullChain ; } | Build full class chain . |
37,005 | public function filterInactiveExtensions ( $ classChain ) { $ disabledModules = $ this -> getDisabledModuleIds ( ) ; foreach ( $ disabledModules as $ disabledModuleId ) { $ classChain = $ this -> cleanModuleFromClassChain ( $ disabledModuleId , $ classChain ) ; } return $ classChain ; } | Checks if module is disabled added to aDisabledModules config . |
37,006 | public function getDisabledModuleIds ( ) { $ variablesLocator = $ this -> getModuleVariablesLocator ( ) ; $ disabledModules = $ variablesLocator -> getModuleVariable ( 'aDisabledModules' ) ; $ disabledModules = is_array ( $ disabledModules ) ? $ disabledModules : [ ] ; return $ disabledModules ; } | Get Ids of all deactivated module . If none are deactivated returns an empty array . |
37,007 | protected function createClassExtensions ( $ classChain , $ baseClass ) { $ lastClass = str_replace ( chr ( 0 ) , '' , $ baseClass ) ; $ parentClass = $ lastClass ; foreach ( $ classChain as $ extensionPath ) { $ extensionPath = str_replace ( chr ( 0 ) , '' , $ extensionPath ) ; if ( $ this -> createClassExtension ( $ parentClass , $ extensionPath ) ) { if ( \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ extensionPath ) ) { $ parentClass = $ extensionPath ; $ lastClass = $ extensionPath ; } else { $ parentClass = basename ( $ extensionPath ) ; $ lastClass = basename ( $ extensionPath ) ; } } } return $ lastClass ; } | Creates middle classes if needed . |
37,008 | protected function createClassExtension ( $ parentClass , $ moduleClass ) { if ( ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ moduleClass ) ) { return $ this -> backwardsCompatibleCreateClassExtension ( $ parentClass , $ moduleClass ) ; } $ composerClassLoader = include VENDOR_PATH . 'autoload.php' ; if ( ! $ this -> isUnitTest ( ) && ! strpos ( $ moduleClass , '_parent' ) && ! $ composerClassLoader -> findFile ( $ moduleClass ) ) { $ this -> handleSpecialCases ( $ parentClass ) ; $ this -> onModuleExtensionCreationError ( $ moduleClass ) ; return false ; } if ( ! class_exists ( $ moduleClass , false ) ) { $ moduleClassParentAlias = $ moduleClass . "_parent" ; if ( ! class_exists ( $ moduleClassParentAlias , false ) ) { class_alias ( $ parentClass , $ moduleClassParentAlias ) ; } } return true ; } | Checks if a given class can be loaded and create an alias for _parent . If the class cannot be loaded some error handling is done . |
37,009 | public function disableModule ( $ modulePath ) { $ module = oxNew ( \ OxidEsales \ Eshop \ Core \ Module \ Module :: class ) ; $ moduleId = $ module -> getIdByPath ( $ modulePath ) ; $ module -> load ( $ moduleId ) ; $ moduleCache = oxNew ( 'oxModuleCache' , $ module ) ; $ moduleInstaller = oxNew ( 'oxModuleInstaller' , $ moduleCache ) ; return $ moduleInstaller -> deactivate ( $ module ) ; } | Disables module adds to aDisabledModules config . |
37,010 | protected function getModulesArray ( \ OxidEsales \ Eshop \ Core \ Module \ ModuleVariablesLocator $ variablesLocator ) { $ modules = ( array ) $ variablesLocator -> getModuleVariable ( 'aModules' ) ; return $ modules ; } | Getter for module array . |
37,011 | public function formatDBDate ( $ sDBDateIn , $ blForceEnglishRet = false ) { if ( ! $ sDBDateIn ) { return null ; } $ oStr = getStr ( ) ; if ( $ blForceEnglishRet && $ oStr -> strstr ( $ sDBDateIn , '-' ) ) { return $ sDBDateIn ; } if ( $ this -> isEmptyDate ( $ sDBDateIn ) && $ sDBDateIn != '-' ) { return '-' ; } elseif ( $ sDBDateIn == '-' ) { return '0000-00-00 00:00:00' ; } if ( is_numeric ( $ sDBDateIn ) ) { $ sNew = substr ( $ sDBDateIn , 0 , 4 ) . '-' . substr ( $ sDBDateIn , 4 , 2 ) . '-' . substr ( $ sDBDateIn , 6 , 2 ) . ' ' ; if ( strlen ( $ sDBDateIn ) > 8 ) { $ sNew .= substr ( $ sDBDateIn , 8 , 2 ) . ':' . substr ( $ sDBDateIn , 10 , 2 ) . ':' . substr ( $ sDBDateIn , 12 , 2 ) ; } $ sDBDateIn = $ sNew ; } $ aData = explode ( ' ' , trim ( $ sDBDateIn ) ) ; $ sTime = ( isset ( $ aData [ 1 ] ) && $ oStr -> strstr ( $ aData [ 1 ] , ':' ) ) ? $ aData [ 1 ] : '' ; $ aTime = $ sTime ? explode ( ':' , $ sTime ) : [ 0 , 0 , 0 ] ; $ sDate = isset ( $ aData [ 0 ] ) ? $ aData [ 0 ] : '' ; $ aDate = preg_split ( '/[\/.-]/' , $ sDate ) ; if ( $ sTime ) { $ sFormat = $ blForceEnglishRet ? 'Y-m-d H:i:s' : \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'fullDateFormat' ) ; } else { $ sFormat = $ blForceEnglishRet ? 'Y-m-d' : \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'simpleDateFormat' ) ; } if ( count ( $ aDate ) != 3 ) { return date ( $ sFormat ) ; } else { return $ this -> _processDate ( $ aTime , $ aDate , $ oStr -> strstr ( $ sDate , '.' ) , $ sFormat ) ; } } | Format date to user defined format . |
37,012 | public function convertDBTimestamp ( $ oObject , $ blToTimeStamp = false ) { $ sSQLTimeStampPattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/" ; $ sISOTimeStampPattern = "/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/" ; $ aMatches = [ ] ; $ oStr = getStr ( ) ; if ( $ blToTimeStamp ) { $ this -> convertDBDateTime ( $ oObject , $ blToTimeStamp ) ; if ( $ oStr -> preg_match ( $ sISOTimeStampPattern , $ oObject -> value , $ aMatches ) ) { $ oObject -> setValue ( $ aMatches [ 1 ] . $ aMatches [ 2 ] . $ aMatches [ 3 ] . $ aMatches [ 4 ] . $ aMatches [ 5 ] . $ aMatches [ 6 ] ) ; $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; return $ oObject -> value ; } } else { if ( $ oStr -> preg_match ( $ sSQLTimeStampPattern , $ oObject -> value , $ aMatches ) ) { $ iTimestamp = mktime ( $ aMatches [ 4 ] , $ aMatches [ 5 ] , $ aMatches [ 6 ] , $ aMatches [ 2 ] , $ aMatches [ 3 ] , $ aMatches [ 1 ] ) ; if ( ! $ iTimestamp ) { $ iTimestamp = "0" ; } $ oObject -> setValue ( trim ( date ( "Y-m-d H:i:s" , $ iTimestamp ) ) ) ; $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; $ this -> convertDBDateTime ( $ oObject , $ blToTimeStamp ) ; return $ oObject -> value ; } } } | Bidirectional converter for timestamp field |
37,013 | protected function _setDefaultFormatedValue ( $ oObject , $ sDate , $ sLocalDateFormat , $ sLocalTimeFormat , $ blOnlyDate ) { $ aDefTimePatterns = $ this -> _defaultTimePattern ( ) ; $ aDFormats = $ this -> _defineDateFormattingRules ( ) ; $ aTFormats = $ this -> _defineTimeFormattingRules ( ) ; $ oStr = getStr ( ) ; foreach ( array_keys ( $ aDefTimePatterns ) as $ sDefTimePattern ) { if ( $ oStr -> preg_match ( $ sDefTimePattern , $ sDate ) ) { $ blDefTimeFound = true ; break ; } } if ( $ blOnlyDate ) { $ oObject -> setValue ( trim ( $ aDFormats [ $ sLocalDateFormat ] [ 2 ] ) ) ; $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; return ; } elseif ( $ blDefTimeFound ) { $ oObject -> setValue ( trim ( $ aDFormats [ $ sLocalDateFormat ] [ 2 ] . " " . $ aTFormats [ $ sLocalTimeFormat ] [ 2 ] ) ) ; $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; return ; } } | sets default formatted value |
37,014 | protected function _defineAndCheckDefaultTimeValues ( $ blToTimeStamp ) { $ sLocalTimeFormat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sLocalTimeFormat' ) ; if ( ! $ sLocalTimeFormat || $ blToTimeStamp ) { $ sLocalTimeFormat = "ISO" ; } return $ sLocalTimeFormat ; } | defines and checks default time values |
37,015 | protected function _defineAndCheckDefaultDateValues ( $ blToTimeStamp ) { $ sLocalDateFormat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sLocalDateFormat' ) ; if ( ! $ sLocalDateFormat || $ blToTimeStamp ) { $ sLocalDateFormat = "ISO" ; } return $ sLocalDateFormat ; } | defines and checks default date values |
37,016 | protected function _setDefaultDateTimeValue ( $ oObject , $ sLocalDateFormat , $ sLocalTimeFormat , $ blOnlyDate ) { $ aDFormats = $ this -> _defineDateFormattingRules ( ) ; $ aTFormats = $ this -> _defineTimeFormattingRules ( ) ; $ sReturn = $ aDFormats [ $ sLocalDateFormat ] [ 2 ] ; if ( ! $ blOnlyDate ) { $ sReturn .= " " . $ aTFormats [ $ sLocalTimeFormat ] [ 2 ] ; } if ( $ oObject instanceof \ OxidEsales \ Eshop \ Core \ Field ) { $ oObject -> setValue ( trim ( $ sReturn ) ) ; } else { $ oObject -> value = trim ( $ sReturn ) ; } $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; } | Sets default date time value |
37,017 | protected function _formatCorrectTimeValue ( $ oObject , $ sDateFormat , $ sTimeFormat , $ aDateMatches , $ aTimeMatches , $ aTFields , $ aDFields ) { $ iTimestamp = @ mktime ( ( int ) $ aTimeMatches [ $ aTFields [ 0 ] ] , ( int ) $ aTimeMatches [ $ aTFields [ 1 ] ] , ( int ) $ aTimeMatches [ $ aTFields [ 2 ] ] , ( int ) $ aDateMatches [ $ aDFields [ 0 ] ] , ( int ) $ aDateMatches [ $ aDFields [ 1 ] ] , ( int ) $ aDateMatches [ $ aDFields [ 2 ] ] ) ; if ( $ oObject instanceof \ OxidEsales \ Eshop \ Core \ Field ) { $ oObject -> setValue ( trim ( @ date ( $ sDateFormat . " " . $ sTimeFormat , $ iTimestamp ) ) ) ; } else { $ oObject -> value = trim ( @ date ( $ sDateFormat . " " . $ sTimeFormat , $ iTimestamp ) ) ; } $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; } | Formatting correct time value |
37,018 | public function shiftServerTime ( $ iTime ) { $ iServerTimeShift = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iServerTimeShift' ) ; if ( $ iServerTimeShift ) { $ iTime = $ iTime + ( ( int ) $ iServerTimeShift * 3600 ) ; } return $ iTime ; } | Shift time if needed by configured timezone . |
37,019 | public function german2English ( $ sDate ) { $ aDate = explode ( "." , $ sDate ) ; if ( isset ( $ aDate ) && count ( $ aDate ) > 1 ) { if ( count ( $ aDate ) == 2 ) { $ sDate = $ aDate [ 1 ] . "-" . $ aDate [ 0 ] ; } else { $ sDate = $ aDate [ 2 ] . "-" . $ aDate [ 1 ] . "-" . $ aDate [ 0 ] ; } } return $ sDate ; } | Reformats and returns German date string to English . |
37,020 | public function isEmptyDate ( $ sDate ) { if ( ! empty ( $ sDate ) ) { $ sDate = preg_replace ( "/[^0-9a-z]/i" , "" , $ sDate ) ; if ( ! is_numeric ( $ sDate ) || $ sDate != 0 ) { return false ; } } return true ; } | Checks if date string is empty date field . Empty string or string with all date values equal to 0 is treated as empty . |
37,021 | public function render ( ) { parent :: render ( ) ; $ oSysReq = oxNew ( \ OxidEsales \ Eshop \ Core \ SystemRequirements :: class ) ; $ this -> _aViewData [ 'aInfo' ] = $ oSysReq -> getSystemInfo ( ) ; $ this -> _aViewData [ 'aCollations' ] = $ oSysReq -> checkCollation ( ) ; return "sysreq_main.tpl" ; } | Loads article Mercators info passes it to Smarty engine and returns name of template file Mercator_main . tpl . |
37,022 | public function getReqInfoUrl ( $ sIdent ) { $ oSysReq = oxNew ( \ OxidEsales \ Eshop \ Core \ SystemRequirements :: class ) ; return $ oSysReq -> getReqInfoUrl ( $ sIdent ) ; } | Returns hint URL |
37,023 | public function getRecommLists ( ) { if ( $ this -> _aUserRecommLists === null ) { $ this -> _aUserRecommLists = false ; if ( ( $ oUser = $ this -> getUser ( ) ) ) { $ this -> _aUserRecommLists = $ oUser -> getUserRecommLists ( ) ; } } return $ this -> _aUserRecommLists ; } | return recomm list from the user |
37,024 | public function getArticleList ( ) { if ( $ this -> _oActRecommListArticles === null ) { $ this -> _oActRecommListArticles = false ; if ( ( $ oRecommList = $ this -> getActiveRecommList ( ) ) ) { $ oItemList = $ oRecommList -> getArticles ( ) ; if ( $ oItemList -> count ( ) ) { foreach ( $ oItemList as $ key => $ oItem ) { if ( ! $ oItem -> isVisible ( ) ) { $ oRecommList -> removeArticle ( $ oItem -> getId ( ) ) ; $ oItemList -> offsetUnset ( $ key ) ; continue ; } $ oItem -> text = $ oRecommList -> getArtDescription ( $ oItem -> getId ( ) ) ; } $ this -> _oActRecommListArticles = $ oItemList ; } } } return $ this -> _oActRecommListArticles ; } | return all articles in the recomm list |
37,025 | public function getActiveRecommList ( ) { if ( ! $ this -> getViewConfig ( ) -> getShowListmania ( ) ) { return false ; } if ( $ this -> _oActRecommList === null ) { $ this -> _oActRecommList = false ; if ( ( $ oUser = $ this -> getUser ( ) ) && ( $ sRecommId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'recommid' ) ) ) { $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList :: class ) ; $ sUserIdField = 'oxrecommlists__oxuserid' ; if ( ( $ oRecommList -> load ( $ sRecommId ) ) && $ oUser -> getId ( ) === $ oRecommList -> $ sUserIdField -> value ) { $ this -> _oActRecommList = $ oRecommList ; } } } return $ this -> _oActRecommList ; } | return the active entrys |
37,026 | public function saveRecommList ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> checkSessionChallenge ( ) ) { return ; } if ( ! $ this -> getViewConfig ( ) -> getShowListmania ( ) ) { return ; } if ( ( $ oUser = $ this -> getUser ( ) ) ) { if ( ! ( $ oRecommList = $ this -> getActiveRecommList ( ) ) ) { $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList :: class ) ; $ oRecommList -> oxrecommlists__oxuserid = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUser -> getId ( ) ) ; $ oRecommList -> oxrecommlists__oxshopid = new \ OxidEsales \ Eshop \ Core \ Field ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ) ; } else { $ this -> _sThisTemplate = 'page/account/recommendationedit.tpl' ; } $ sTitle = trim ( ( string ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'recomm_title' , true ) ) ; $ sAuthor = trim ( ( string ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'recomm_author' , true ) ) ; $ sText = trim ( ( string ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'recomm_desc' , true ) ) ; $ oRecommList -> oxrecommlists__oxtitle = new \ OxidEsales \ Eshop \ Core \ Field ( $ sTitle ) ; $ oRecommList -> oxrecommlists__oxauthor = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAuthor ) ; $ oRecommList -> oxrecommlists__oxdesc = new \ OxidEsales \ Eshop \ Core \ Field ( $ sText ) ; try { $ this -> _blSavedEntry = ( bool ) $ oRecommList -> save ( ) ; $ this -> setActiveRecommList ( $ this -> _blSavedEntry ? $ oRecommList : false ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ ObjectException $ oEx ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ oEx , false , true , 'user' ) ; } } } | add new recommlist |
37,027 | public function init ( ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ oConfig -> getConfigParam ( 'blPsBasketReservationEnabled' ) ) { if ( $ oReservations = $ this -> getSession ( ) -> getBasketReservations ( ) ) { if ( ! $ oReservations -> getTimeLeft ( ) ) { $ oBasket = $ this -> getSession ( ) -> getBasket ( ) ; if ( $ oBasket && $ oBasket -> getProductsCount ( ) ) { $ this -> emptyBasket ( $ oBasket ) ; } } $ iLimit = ( int ) $ oConfig -> getConfigParam ( 'iBasketReservationCleanPerRequest' ) ; if ( ! $ iLimit ) { $ iLimit = 200 ; } $ oReservations -> discardUnusedReservations ( $ iLimit ) ; } } parent :: init ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blBasketExcludeEnabled' ) ) { if ( $ oBasket = $ this -> getSession ( ) -> getBasket ( ) ) { $ this -> getParent ( ) -> setRootCatChanged ( $ this -> isRootCatChanged ( ) && $ oBasket -> getContents ( ) ) ; } } } | Initiates component . |
37,028 | protected function _getRedirectUrl ( ) { $ controllerId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestControllerId ( ) ; $ controllerId = $ controllerId ? $ controllerId . '?' : 'start?' ; $ sPosition = '' ; foreach ( $ this -> aRedirectParams as $ sParamName ) { $ sParamVal = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( $ sParamName ) ; $ sPosition .= $ sParamVal ? $ sParamName . '=' . $ sParamVal . '&' : '' ; } $ sParam = rawurlencode ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'searchparam' , true ) ) ; $ sPosition .= $ sParam ? 'searchparam=' . $ sParam . '&' : '' ; $ iPageNr = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'pgNr' ) ; $ sPosition .= ( $ iPageNr > 0 ) ? 'pgNr=' . $ iPageNr . '&' : '' ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNewBasketItemMessage' ) == 3 ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( '_backtoshop' , $ controllerId . $ sPosition ) ; $ controllerId = 'basket?' ; } return $ controllerId . $ sPosition ; } | Formats and returns redirect URL where shop must be redirected after storing something to basket |
37,029 | protected function getPersistedParameters ( $ persistedParameters = null ) { $ persistedParameters = ( $ persistedParameters ? : \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'persparam' ) ) ; if ( ! is_array ( $ persistedParameters ) ) { return null ; } return array_filter ( $ persistedParameters ) ? : null ; } | Cleans and returns persisted parameters . |
37,030 | protected function _getItems ( $ sProductId = null , $ dAmount = null , $ aSel = null , $ aPersParam = null , $ blOverride = false ) { $ aProducts = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'aproducts' ) ; $ sProductId = $ sProductId ? $ sProductId : \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'aid' ) ; if ( $ sProductId ) { $ dAmount = isset ( $ dAmount ) ? $ dAmount : \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'am' ) ; $ aSel = isset ( $ aSel ) ? $ aSel : \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'sel' ) ; if ( empty ( $ aPersParam ) ) { $ aPersParam = $ this -> getPersistedParameters ( ) ; } $ sBasketItemId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'bindex' ) ; $ aProducts [ $ sProductId ] = [ 'am' => $ dAmount , 'sel' => $ aSel , 'persparam' => $ aPersParam , 'override' => $ blOverride , 'basketitemid' => $ sBasketItemId ] ; } if ( is_array ( $ aProducts ) && count ( $ aProducts ) ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'removeBtn' ) !== null ) { foreach ( $ aProducts as $ sProductId => $ aProduct ) { if ( isset ( $ aProduct [ 'remove' ] ) && $ aProduct [ 'remove' ] ) { $ aProducts [ $ sProductId ] [ 'am' ] = 0 ; } else { unset ( $ aProducts [ $ sProductId ] ) ; } } } return $ aProducts ; } return false ; } | Collects and returns array of items to add to basket . Product info is taken not only from given parameters but additionally from request aproducts parameter |
37,031 | protected function _addItems ( $ products ) { $ activeView = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveView ( ) ; $ errorDestination = $ activeView -> getErrorDestination ( ) ; $ basket = $ this -> getSession ( ) -> getBasket ( ) ; $ basketInfo = $ basket -> getBasketSummary ( ) ; $ basketItemAmounts = [ ] ; foreach ( $ products as $ addProductId => $ productInfo ) { $ data = $ this -> prepareProductInformation ( $ addProductId , $ productInfo ) ; $ productAmount = 0 ; if ( isset ( $ basketInfo -> aArticles [ $ data [ 'id' ] ] ) ) { $ productAmount = $ basketInfo -> aArticles [ $ data [ 'id' ] ] ; } $ products [ $ addProductId ] [ 'oldam' ] = $ productAmount ; if ( isset ( $ basketItemAmounts [ $ data [ 'oldBasketItemId' ] ] ) ) { $ data [ 'amount' ] = $ data [ 'amount' ] + $ basketItemAmounts [ $ data [ 'oldBasketItemId' ] ] ; } $ basketItem = $ this -> addItemToBasket ( $ basket , $ data , $ errorDestination ) ; if ( ( $ basketItem instanceof \ OxidEsales \ Eshop \ Application \ Model \ BasketItem ) ) { $ basketItemKey = $ basketItem -> getBasketItemKey ( ) ; if ( $ basketItemKey ) { if ( ! isset ( $ basketItemAmounts [ $ basketItemKey ] ) ) { $ basketItemAmounts [ $ basketItemKey ] = 0 ; } $ basketItemAmounts [ $ basketItemKey ] += $ data [ 'amount' ] ; } } if ( ! $ basketItem ) { $ info = $ basket -> getBasketSummary ( ) ; $ productAmount = $ info -> aArticles [ $ data [ 'id' ] ] ; $ products [ $ addProductId ] [ 'am' ] = isset ( $ productAmount ) ? $ productAmount : 0 ; } } if ( $ basket -> getProductsCount ( ) == 0 ) { $ basket -> setCardId ( null ) ; } $ this -> _setLastCall ( $ this -> _getLastCallFnc ( ) , $ products , $ basketInfo ) ; return $ basketItem ; } | Adds all articles user wants to add to basket . Returns last added to basket item . |
37,032 | public function isRootCatChanged ( ) { $ oBasket = $ this -> getSession ( ) -> getBasket ( ) ; if ( $ oBasket -> showCatChangeWarning ( ) ) { $ oBasket -> setCatChangeWarningState ( false ) ; return true ; } $ sDefCat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveShop ( ) -> oxshops__oxdefcat -> value ; $ sActCat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'cnid' ) ; $ oActCat = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; if ( $ sActCat && $ sActCat != $ sDefCat && $ oActCat -> load ( $ sActCat ) ) { $ sActRoot = $ oActCat -> oxcategories__oxrootid -> value ; if ( $ oBasket -> getBasketRootCatId ( ) && $ sActRoot != $ oBasket -> getBasketRootCatId ( ) ) { return true ; } } return false ; } | Returns true if active root category was changed |
37,033 | protected function prepareProductInformation ( $ addProductId , $ productInfo ) { $ return = [ ] ; $ return [ 'id' ] = isset ( $ productInfo [ 'aid' ] ) ? $ productInfo [ 'aid' ] : $ addProductId ; $ return [ 'amount' ] = isset ( $ productInfo [ 'am' ] ) ? $ productInfo [ 'am' ] : 0 ; $ return [ 'selectList' ] = isset ( $ productInfo [ 'sel' ] ) ? $ productInfo [ 'sel' ] : null ; $ return [ 'persistentParameters' ] = $ this -> getPersistedParameters ( $ productInfo [ 'persparam' ] ) ; $ return [ 'override' ] = isset ( $ productInfo [ 'override' ] ) ? $ productInfo [ 'override' ] : null ; $ return [ 'bundle' ] = isset ( $ productInfo [ 'bundle' ] ) ? true : false ; $ return [ 'oldBasketItemId' ] = isset ( $ productInfo [ 'basketitemid' ] ) ? $ productInfo [ 'basketitemid' ] : null ; return $ return ; } | Prepare information for adding product to basket . |
37,034 | protected function addItemToBasket ( $ basket , $ itemData , $ errorDestination ) { $ basketItem = null ; try { $ basketItem = $ basket -> addToBasket ( $ itemData [ 'id' ] , $ itemData [ 'amount' ] , $ itemData [ 'selectList' ] , $ itemData [ 'persistentParameters' ] , $ itemData [ 'override' ] , $ itemData [ 'bundle' ] , $ itemData [ 'oldBasketItemId' ] ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ OutOfStockException $ exception ) { $ exception -> setDestination ( $ errorDestination ) ; if ( ! $ errorDestination && \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNewBasketItemMessage' ) == 2 ) { $ errorDestination = 'popup' ; } \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ exception , false , ( bool ) $ errorDestination , $ errorDestination ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ ArticleInputException $ exception ) { $ exception -> setDestination ( $ errorDestination ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ exception , false , ( bool ) $ errorDestination , $ errorDestination ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ NoArticleException $ exception ) { } return $ basketItem ; } | Add one item to basket . Handle eventual errors . |
37,035 | protected function _getFilterSelect ( $ oUser ) { $ oBaseObject = $ this -> getBaseObject ( ) ; $ sTable = $ oBaseObject -> getViewName ( ) ; $ sQ = "select " . $ oBaseObject -> getSelectFields ( ) . " from $sTable " ; $ sQ .= "where " . $ oBaseObject -> getSqlActiveSnippet ( ) . ' ' ; $ sUserId = null ; $ sGroupIds = null ; $ sCountryId = $ this -> getCountryId ( $ oUser ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; if ( $ oUser ) { $ sUserId = $ oUser -> getId ( ) ; foreach ( $ oUser -> getUserGroups ( ) as $ oGroup ) { if ( $ sGroupIds ) { $ sGroupIds .= ', ' ; } $ sGroupIds .= $ oDb -> quote ( $ oGroup -> getId ( ) ) ; } } $ sUserTable = getViewName ( 'oxuser' ) ; $ sGroupTable = getViewName ( 'oxgroups' ) ; $ sCountryTable = getViewName ( 'oxcountry' ) ; $ sCountrySql = $ sCountryId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' and oxobject2discount.OXOBJECTID=" . $ oDb -> quote ( $ sCountryId ) . ")" : '0' ; $ sUserSql = $ sUserId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' and oxobject2discount.OXOBJECTID=" . $ oDb -> quote ( $ sUserId ) . ")" : '0' ; $ sGroupSql = $ sGroupIds ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' and oxobject2discount.OXOBJECTID in ($sGroupIds) )" : '0' ; $ sQ .= "and ( select if(EXISTS(select 1 from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' LIMIT 1), $sCountrySql, 1) && if(EXISTS(select 1 from oxobject2discount, $sUserTable where $sUserTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' LIMIT 1), $sUserSql, 1) && if(EXISTS(select 1 from oxobject2discount, $sGroupTable where $sGroupTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' LIMIT 1), $sGroupSql, 1) )" ; $ sQ .= " order by $sTable.oxsort " ; return $ sQ ; } | Creates discount list filter SQL to load current state discount list |
37,036 | public function getBasketItemDiscounts ( $ oArticle , $ oBasket , $ oUser = null ) { $ aList = [ ] ; $ aDiscList = $ this -> _getList ( $ oUser ) -> getArray ( ) ; foreach ( $ aDiscList as $ oDiscount ) { if ( $ oDiscount -> isForBasketItem ( $ oArticle ) && $ oDiscount -> isForBasketAmount ( $ oBasket ) ) { $ aList [ $ oDiscount -> getId ( ) ] = $ oDiscount ; } } return $ aList ; } | Returns array of discounts that can be applied for individual basket item |
37,037 | public function getBasketDiscounts ( $ oBasket , $ oUser = null ) { $ aList = [ ] ; $ aDiscList = $ this -> _getList ( $ oUser ) -> getArray ( ) ; foreach ( $ aDiscList as $ oDiscount ) { if ( $ oDiscount -> isForBasket ( $ oBasket ) ) { $ aList [ $ oDiscount -> getId ( ) ] = $ oDiscount ; } } return $ aList ; } | Returns array of discounts that can be applied for whole basket |
37,038 | public function getBasketItemBundleDiscounts ( $ oArticle , $ oBasket , $ oUser = null ) { $ aList = [ ] ; $ aDiscList = $ this -> _getList ( $ oUser ) -> getArray ( ) ; foreach ( $ aDiscList as $ oDiscount ) { if ( $ oDiscount -> isForBundleItem ( $ oArticle , $ oBasket ) && $ oDiscount -> isForBasketAmount ( $ oBasket ) ) { $ aList [ $ oDiscount -> getId ( ) ] = $ oDiscount ; } } return $ aList ; } | Returns array of bundle discounts that can be applied for whole basket |
37,039 | public function getBasketBundleDiscounts ( $ oBasket , $ oUser = null ) { $ aList = [ ] ; $ aDiscList = $ this -> _getList ( $ oUser ) -> getArray ( ) ; foreach ( $ aDiscList as $ oDiscount ) { if ( $ oDiscount -> isForBundleBasket ( $ oBasket ) ) { $ aList [ $ oDiscount -> getId ( ) ] = $ oDiscount ; } } return $ aList ; } | Returns array of basket bundle discounts |
37,040 | public function hasSkipDiscountCategories ( ) { if ( $ this -> _hasSkipDiscountCategories === null || $ this -> _blReload ) { $ sViewName = getViewName ( 'oxcategories' ) ; $ sQ = "select 1 from {$sViewName} where {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' " ; $ this -> _hasSkipDiscountCategories = ( bool ) \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOne ( $ sQ ) ; } return $ this -> _hasSkipDiscountCategories ; } | Checks if any category has skip discounts status |
37,041 | public function render ( ) { parent :: render ( ) ; $ this -> _aViewData [ 'edit' ] = $ oCategory = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != '-1' ) { $ oCategory -> load ( $ soxId ) ; } return "category_pictures.tpl" ; } | Loads category object passes it to Smarty engine and returns name of template file category_pictures . tpl . |
37,042 | public function getActiveCheckQuery ( $ blForceCoreTable = null ) { $ sTable = $ this -> getViewName ( $ blForceCoreTable ) ; $ sQ = " $sTable.oxactive = 1 " ; $ sQ .= " and $sTable.oxhidden = 0 " ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blUseTimeCheck' ) ) { $ sQ = $ this -> addSqlActiveRangeSnippet ( $ sQ , $ sTable ) ; } return $ sQ ; } | Returns part of sql query used in active snippet . Query checks if product oxactive = 1 . If config option blUseTimeCheck is TRUE additionally checks if oxactivefrom < current data < oxactiveto |
37,043 | public function getFUnitPrice ( ) { if ( $ this -> _fPricePerUnit == null ) { if ( $ oPrice = $ this -> getUnitPrice ( ) ) { if ( $ dPrice = $ this -> _getPriceForView ( $ oPrice ) ) { $ this -> _fPricePerUnit = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice ) ; } } } return $ this -> _fPricePerUnit ; } | Returns formatted price per unit |
37,044 | public function getUnitPrice ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadPrice' ) || ! $ this -> _blLoadPrice ) { return ; } $ oPrice = null ; if ( ( double ) $ this -> getUnitQuantity ( ) && $ this -> oxarticles__oxunitname -> value ) { $ oPrice = clone $ this -> getPrice ( ) ; $ oPrice -> divide ( ( double ) $ this -> getUnitQuantity ( ) ) ; } return $ oPrice ; } | Returns price per unit |
37,045 | public function getFMinPrice ( ) { $ sPrice = '' ; if ( $ oPrice = $ this -> getMinPrice ( ) ) { $ dPrice = $ this -> _getPriceForView ( $ oPrice ) ; $ sPrice = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice ) ; } return $ sPrice ; } | Returns formatted article min price |
37,046 | public function getFVarMinPrice ( ) { $ sPrice = '' ; if ( $ oPrice = $ this -> getVarMinPrice ( ) ) { $ dPrice = $ this -> _getPriceForView ( $ oPrice ) ; $ sPrice = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice ) ; } return $ sPrice ; } | Returns formatted min article variant price |
37,047 | public function getVarMinPrice ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadPrice' ) || ! $ this -> _blLoadPrice ) { return ; } $ oPrice = null ; $ dPrice = $ this -> _calculateVarMinPrice ( ) ; $ oPrice = $ this -> _getPriceObject ( ) ; $ oPrice -> setPrice ( $ dPrice ) ; $ this -> _calculatePrice ( $ oPrice ) ; return $ oPrice ; } | Returns article min price of variants |
37,048 | public function getMinPrice ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadPrice' ) || ! $ this -> _blLoadPrice ) { return ; } $ oPrice = null ; $ dPrice = $ this -> _getPrice ( ) ; if ( $ this -> _getVarMinPrice ( ) !== null && $ dPrice > $ this -> _getVarMinPrice ( ) ) { $ dPrice = $ this -> _getVarMinPrice ( ) ; } $ dPrice = $ this -> _prepareModifiedPrice ( $ dPrice ) ; $ oPrice = $ this -> _getPriceObject ( ) ; $ oPrice -> setPrice ( $ dPrice ) ; $ this -> _calculatePrice ( $ oPrice ) ; return $ oPrice ; } | Returns article min price in calculation included variants |
37,049 | public function isRangePrice ( ) { if ( $ this -> _blIsRangePrice === null ) { $ this -> setRangePrice ( false ) ; if ( $ this -> _hasAnyVariant ( ) ) { $ dPrice = $ this -> _getPrice ( ) ; $ dMinPrice = $ this -> _getVarMinPrice ( ) ; $ dMaxPrice = $ this -> _getVarMaxPrice ( ) ; if ( $ dMinPrice != $ dMaxPrice ) { $ this -> setRangePrice ( ) ; } elseif ( ! $ this -> isParentNotBuyable ( ) && $ dMinPrice != $ dPrice ) { $ this -> setRangePrice ( ) ; } } } return $ this -> _blIsRangePrice ; } | Returns true if article has variant with different price |
37,050 | public function isVisible ( ) { if ( ( $ blCanPreview = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> canPreview ( ) ) !== null ) { return $ blCanPreview ; } $ sNow = date ( 'Y-m-d H:i:s' ) ; if ( ! $ this -> oxarticles__oxactive -> value && ( $ this -> oxarticles__oxactivefrom -> value > $ sNow || $ this -> oxarticles__oxactiveto -> value < $ sNow ) ) { return false ; } if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blUseStock' ) && $ this -> oxarticles__oxstockflag -> value == 2 ) { $ iOnStock = $ this -> oxarticles__oxstock -> value + $ this -> oxarticles__oxvarstock -> value ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blPsBasketReservationEnabled' ) ) { $ iOnStock += $ this -> getSession ( ) -> getBasketReservations ( ) -> getReservedAmount ( $ this -> getId ( ) ) ; } if ( $ iOnStock <= 0 ) { return false ; } } return true ; } | Checks if article has visible status . Returns TRUE if its visible |
37,051 | public function hasSortingFieldsChanged ( ) { $ aSortingFields = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aSortCols' ) ; $ aSortingFields = ! empty ( $ aSortingFields ) ? ( array ) $ aSortingFields : [ ] ; $ blChanged = false ; foreach ( $ aSortingFields as $ sField ) { $ sParameterName = 'oxarticles__' . $ sField ; $ currentValueOfField = $ this -> $ sParameterName instanceof Field ? $ this -> $ sParameterName -> value : '' ; $ valueOfFieldOnLoad = $ this -> _aSortingFieldsOnLoad [ $ sParameterName ] ?? null ; if ( $ valueOfFieldOnLoad !== $ currentValueOfField ) { $ blChanged = true ; break ; } } return $ blChanged ; } | Checks whether sorting fields changed from last article loading . |
37,052 | public function getArticleRatingAverage ( $ blIncludeVariants = false ) { if ( ! $ blIncludeVariants ) { return round ( $ this -> oxarticles__oxrating -> value , 1 ) ; } else { $ oRating = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Rating :: class ) ; return $ oRating -> getRatingAverage ( $ this -> getId ( ) , 'oxarticle' , $ this -> getVariantIds ( ) ) ; } } | Returns product rating average |
37,053 | public function getArticleRatingCount ( $ blIncludeVariants = false ) { if ( ! $ blIncludeVariants ) { return $ this -> oxarticles__oxratingcnt -> value ; } else { $ oRating = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Rating :: class ) ; return $ oRating -> getRatingCount ( $ this -> getId ( ) , 'oxarticle' , $ this -> getVariantIds ( ) ) ; } } | Returns product rating count |
37,054 | public function getCrossSelling ( ) { $ oCrosslist = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oCrosslist -> loadArticleCrossSell ( $ this -> oxarticles__oxid -> value ) ; if ( $ oCrosslist -> count ( ) ) { return $ oCrosslist ; } } | Loads and returns array with cross selling information . |
37,055 | public function getAccessoires ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadAccessoires' ) ) { return ; } $ oAcclist = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oAcclist -> setSqlLimit ( 0 , $ myConfig -> getConfigParam ( 'iNrofCrossellArticles' ) ) ; $ oAcclist -> loadArticleAccessoires ( $ this -> oxarticles__oxid -> value ) ; if ( $ oAcclist -> count ( ) ) { return $ oAcclist ; } } | Loads and returns array with accessories information . |
37,056 | public function getSimilarProducts ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadSimilar' ) ) { return ; } if ( $ myConfig -> getConfigParam ( 'iNrofSimilarArticles' ) < 1 ) { return ; } $ sArticleTable = $ this -> getViewName ( ) ; $ sAttribs = '' ; $ iCnt = 0 ; $ this -> _getAttribsString ( $ sAttribs , $ iCnt ) ; if ( ! $ sAttribs ) { return null ; } $ aList = $ this -> _getSimList ( $ sAttribs , $ iCnt ) ; if ( count ( $ aList ) ) { uasort ( $ aList , function ( $ a , $ b ) { if ( $ a -> cnt == $ b -> cnt ) { return 0 ; } return ( $ a -> cnt < $ b -> cnt ) ? - 1 : 1 ; } ) ; $ sSearch = $ this -> _generateSimListSearchStr ( $ sArticleTable , $ aList ) ; $ oSimilarlist = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oSimilarlist -> setSqlLimit ( 0 , $ myConfig -> getConfigParam ( 'iNrofSimilarArticles' ) ) ; $ oSimilarlist -> selectString ( $ sSearch ) ; return $ oSimilarlist ; } } | Returns a list of similar products . |
37,057 | public function getCustomerAlsoBoughtThisProducts ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadCustomerWhoBoughtThis' ) ) { return ; } $ sQ = $ this -> _generateSearchStrForCustomerBought ( ) ; $ oArticles = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArticles -> setSqlLimit ( 0 , $ myConfig -> getConfigParam ( 'iNrofCustomerWhoArticles' ) ) ; $ oArticles -> selectString ( $ sQ ) ; if ( $ oArticles -> count ( ) ) { return $ oArticles ; } } | Loads and returns articles list bought by same customer . |
37,058 | public function loadAmountPriceInfo ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> getConfigParam ( 'bl_perfLoadPrice' ) || ! $ this -> _blLoadPrice || ! $ this -> _blCalcPrice || ! $ this -> hasAmountPrice ( ) ) { return [ ] ; } if ( $ this -> _oAmountPriceInfo === null ) { $ this -> _oAmountPriceInfo = [ ] ; if ( count ( ( $ aAmPriceList = $ this -> _getAmountPriceList ( ) -> getArray ( ) ) ) ) { $ this -> _oAmountPriceInfo = $ this -> _fillAmountPriceList ( $ aAmPriceList ) ; } } return $ this -> _oAmountPriceInfo ; } | Returns list object with info about article price that depends on amount in basket . Takes data from oxprice2article table . Returns false if such info is not set . |
37,059 | public function getVariantSelections ( $ aFilterIds = null , $ sActVariantId = null , $ iLimit = 0 ) { $ iLimit = ( int ) $ iLimit ; if ( ! isset ( $ this -> _aVariantSelections [ $ iLimit ] ) ) { $ aVariantSelections = false ; if ( $ this -> oxarticles__oxvarcount -> value ) { $ oVariants = $ this -> getVariants ( false ) ; $ aVariantSelections = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ VariantHandler :: class ) -> buildVariantSelections ( $ this -> oxarticles__oxvarname -> getRawValue ( ) , $ oVariants , $ aFilterIds , $ sActVariantId , $ iLimit ) ; if ( ! empty ( $ oVariants ) && empty ( $ aVariantSelections [ 'rawselections' ] ) ) { $ aVariantSelections = false ; } } $ this -> _aVariantSelections [ $ iLimit ] = $ aVariantSelections ; } return $ this -> _aVariantSelections [ $ iLimit ] ; } | Returns variants selections lists array |
37,060 | public function getCategory ( ) { $ oCategory = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ oCategory -> setLanguage ( $ this -> getLanguage ( ) ) ; $ sOXID = $ this -> getId ( ) ; if ( isset ( $ this -> oxarticles__oxparentid -> value ) && $ this -> oxarticles__oxparentid -> value ) { $ sOXID = $ this -> oxarticles__oxparentid -> value ; } if ( $ sOXID ) { if ( ! isset ( $ this -> _aCategoryCache [ $ sOXID ] ) ) { startPRofile ( 'getCategory' ) ; $ oStr = getStr ( ) ; $ sWhere = $ oCategory -> getSqlActiveSnippet ( ) ; $ sSelect = $ this -> _generateSearchStr ( $ sOXID ) ; $ sSelect .= ( $ oStr -> strstr ( $ sSelect , 'where' ) ? ' and ' : ' where ' ) . $ sWhere . " order by oxobject2category.oxtime limit 1" ; if ( ! $ oCategory -> assignRecord ( $ sSelect ) ) { $ sSelect = $ this -> _generateSearchStr ( $ sOXID , true ) ; $ sSelect .= ( $ oStr -> strstr ( $ sSelect , 'where' ) ? ' and ' : ' where ' ) . $ sWhere . " limit 1" ; if ( ! $ oCategory -> assignRecord ( $ sSelect ) ) { $ oCategory = null ; } } $ this -> _aCategoryCache [ $ sOXID ] = $ oCategory ; stopPRofile ( 'getCategory' ) ; } else { $ oCategory = $ this -> _aCategoryCache [ $ sOXID ] ; } } return $ oCategory ; } | Loads and returns article category object . First tries to load assigned category and is such category does not exist tries to load category by price |
37,061 | public function getCategoryIds ( $ blActCats = false , $ blSkipCache = false ) { $ sArticleId = $ this -> getId ( ) ; if ( ! isset ( self :: $ _aArticleCats [ $ sArticleId ] ) || $ blSkipCache ) { $ sSql = $ this -> _getCategoryIdsSelect ( $ blActCats ) ; $ aCategoryIds = $ this -> _selectCategoryIds ( $ sSql , 'oxcatnid' ) ; $ sSql = $ this -> getSqlForPriceCategories ( ) ; $ aPriceCategoryIds = $ this -> _selectCategoryIds ( $ sSql , 'oxid' ) ; self :: $ _aArticleCats [ $ sArticleId ] = array_unique ( array_merge ( $ aCategoryIds , $ aPriceCategoryIds ) ) ; } return self :: $ _aArticleCats [ $ sArticleId ] ; } | Returns ID s of categories where this article is assigned |
37,062 | public function getTPrice ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadPrice' ) || ! $ this -> _blLoadPrice ) { return ; } if ( $ this -> _oTPrice !== null ) { return $ this -> _oTPrice ; } $ oPrice = $ this -> _getPriceObject ( ) ; $ dBasePrice = $ this -> oxarticles__oxtprice -> value ; $ dBasePrice = $ this -> _preparePrice ( $ dBasePrice , $ this -> getArticleVat ( ) ) ; $ oPrice -> setPrice ( $ dBasePrice ) ; $ this -> _applyVat ( $ oPrice , $ this -> getArticleVat ( ) ) ; $ this -> _applyCurrency ( $ oPrice ) ; if ( $ this -> isParentNotBuyable ( ) ) { $ oPrice2 = $ this -> getVarMinPrice ( ) ; } else { $ oPrice2 = $ this -> getPrice ( ) ; } if ( $ oPrice -> getPrice ( ) <= $ oPrice2 -> getPrice ( ) ) { return ; } $ this -> _oTPrice = $ oPrice ; return $ this -> _oTPrice ; } | Returns T price |
37,063 | public function skipDiscounts ( ) { if ( $ this -> _blSkipDiscounts !== null ) { return $ this -> _blSkipDiscounts ; } if ( $ this -> oxarticles__oxskipdiscounts -> value ) { return true ; } $ this -> _blSkipDiscounts = false ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ DiscountList :: class ) -> hasSkipDiscountCategories ( ) ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sO2CView = getViewName ( 'oxobject2category' , $ this -> getLanguage ( ) ) ; $ sViewName = getViewName ( 'oxcategories' , $ this -> getLanguage ( ) ) ; $ sSelect = "select 1 from $sO2CView as $sO2CView left join {$sViewName} on {$sViewName}.oxid = $sO2CView.oxcatnid where $sO2CView.oxobjectid=" . $ oDb -> quote ( $ this -> getId ( ) ) . " and {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' " ; $ this -> _blSkipDiscounts = ( $ oDb -> getOne ( $ sSelect ) == 1 ) ; } return $ this -> _blSkipDiscounts ; } | Checks if discount should be skipped for this article in basket . Returns true if yes . |
37,064 | public function getBasketPrice ( $ dAmount , $ aSelList , $ oBasket ) { $ oUser = $ oBasket -> getBasketUser ( ) ; $ this -> setArticleUser ( $ oUser ) ; $ oBasketPrice = $ this -> _getPriceObject ( $ oBasket -> isCalculationModeNetto ( ) ) ; $ dBasePrice = $ this -> getBasePrice ( $ dAmount ) ; $ dBasePrice = $ this -> _modifySelectListPrice ( $ dBasePrice , $ aSelList ) ; $ dBasePrice = $ this -> _preparePrice ( $ dBasePrice , $ this -> getArticleVat ( ) , $ oBasket -> isCalculationModeNetto ( ) ) ; $ oBasketPrice -> setPrice ( $ dBasePrice ) ; $ dVat = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ VatSelector :: class ) -> getBasketItemVat ( $ this , $ oBasket ) ; $ this -> _calculatePrice ( $ oBasketPrice , $ dVat ) ; return $ oBasketPrice ; } | Creates calculates and returns oxPrice object for basket product . |
37,065 | public function delete ( $ sOXID = null ) { if ( ! $ sOXID ) { $ sOXID = $ this -> getId ( ) ; } if ( ! $ sOXID ) { return false ; } $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ database -> startTransaction ( ) ; try { $ this -> _deleteVariantRecords ( $ sOXID ) ; $ this -> load ( $ sOXID ) ; $ this -> _deletePics ( ) ; $ this -> _onChangeResetCounts ( $ sOXID , $ this -> oxarticles__oxvendorid -> value , $ this -> oxarticles__oxmanufacturerid -> value ) ; $ deleted = parent :: delete ( $ sOXID ) ; $ this -> _deleteRecords ( $ sOXID ) ; Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ SeoEncoderArticle :: class ) -> onDeleteArticle ( $ this ) ; $ this -> onChange ( ACTION_DELETE , $ sOXID , $ this -> oxarticles__oxparentid -> value ) ; $ database -> commitTransaction ( ) ; } catch ( Exception $ exception ) { $ database -> rollbackTransaction ( ) ; throw $ exception ; } return $ deleted ; } | Deletes record and other information related to this article such as images from DB also removes variants . Returns true if entry was deleted . |
37,066 | public function reduceStock ( $ dAmount , $ blAllowNegativeStock = false ) { $ this -> actionType = ACTION_UPDATE_STOCK ; $ this -> beforeUpdate ( ) ; $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ query = 'select oxstock from oxarticles where oxid = ' . $ database -> quote ( $ this -> getId ( ) ) . ' FOR UPDATE ' ; $ actualStock = $ database -> getOne ( $ query ) ; $ iStockCount = $ actualStock - $ dAmount ; if ( ! $ blAllowNegativeStock && ( $ iStockCount < 0 ) ) { $ dAmount += $ iStockCount ; $ iStockCount = 0 ; } $ this -> oxarticles__oxstock = new \ OxidEsales \ Eshop \ Core \ Field ( $ iStockCount ) ; $ query = 'update oxarticles set oxarticles.oxstock = ' . $ database -> quote ( $ iStockCount ) . ' where oxarticles.oxid = ' . $ database -> quote ( $ this -> getId ( ) ) ; $ database -> execute ( $ query ) ; $ this -> onChange ( ACTION_UPDATE_STOCK ) ; return $ dAmount ; } | Reduce article stock . return the affected amount |
37,067 | public function updateSoldAmount ( $ dAmount = 0 ) { if ( ! $ dAmount ) { return ; } if ( ! $ this -> oxarticles__oxparentid -> value ) { $ dAmount = ( double ) $ dAmount ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ rs = $ oDb -> execute ( "update oxarticles set oxarticles.oxsoldamount = oxarticles.oxsoldamount + $dAmount where oxarticles.oxid = " . $ oDb -> quote ( $ this -> oxarticles__oxid -> value ) ) ; } elseif ( $ this -> oxarticles__oxparentid -> value ) { $ oUpdateArticle = $ this -> getParentArticle ( ) ; if ( $ oUpdateArticle ) { $ oUpdateArticle -> updateSoldAmount ( $ dAmount ) ; } } return ( bool ) $ rs ; } | Recursive function . Updates quantity of sold articles . Return true if amount was changed in database . |
37,068 | public function disableReminder ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; return ( bool ) $ oDb -> execute ( "update oxarticles set oxarticles.oxremindactive = 2 where oxarticles.oxid = " . $ oDb -> quote ( $ this -> oxarticles__oxid -> value ) ) ; } | Disables reminder functionality for article |
37,069 | public function resetParent ( ) { $ sParentId = $ this -> oxarticles__oxparentid -> value ; $ this -> oxarticles__oxparentid = new \ OxidEsales \ Eshop \ Core \ Field ( '' , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> _blAllowEmptyParentId = true ; $ this -> save ( ) ; $ this -> _blAllowEmptyParentId = false ; if ( $ sParentId !== '' ) { $ this -> onChange ( ACTION_UPDATE , null , $ sParentId ) ; } } | Changes article variant to parent article |
37,070 | public function getLongDescription ( ) { if ( $ this -> _oLongDesc === null ) { $ this -> _oLongDesc = new \ OxidEsales \ Eshop \ Core \ Field ( ) ; $ sOxid = $ this -> getId ( ) ; $ sViewName = getViewName ( 'oxartextends' , $ this -> getLanguage ( ) ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sDbValue = $ oDb -> getOne ( "select oxlongdesc from {$sViewName} where oxid = " . $ oDb -> quote ( $ sOxid ) ) ; if ( $ sDbValue != false ) { $ this -> _oLongDesc -> setValue ( $ sDbValue , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } elseif ( $ this -> oxarticles__oxparentid && $ this -> oxarticles__oxparentid -> value ) { if ( ! $ this -> isAdmin ( ) || $ this -> _blLoadParentData ) { $ oParent = $ this -> getParentArticle ( ) ; if ( $ oParent ) { $ this -> _oLongDesc -> setValue ( $ oParent -> getLongDescription ( ) -> getRawValue ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } } } } return $ this -> _oLongDesc ; } | Get article long description |
37,071 | public function setArticleLongDesc ( $ longDescription ) { $ this -> _oLongDesc = new \ OxidEsales \ Eshop \ Core \ Field ( $ longDescription , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxarticles__oxlongdesc = new \ OxidEsales \ Eshop \ Core \ Field ( $ longDescription , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } | Save article long description to oxartext table |
37,072 | public function getAttributes ( ) { if ( $ this -> _oAttributeList === null ) { $ this -> _oAttributeList = $ this -> newAttributelist ( ) ; $ this -> _oAttributeList -> loadAttributes ( $ this -> getId ( ) , $ this -> getParentId ( ) ) ; } return $ this -> _oAttributeList ; } | Loads and returns attribute list associated with this article |
37,073 | public function getAttributesDisplayableInBasket ( ) { if ( $ this -> basketAttributeList === null ) { $ this -> basketAttributeList = $ this -> newAttributelist ( ) ; $ this -> basketAttributeList -> loadAttributesDisplayableInBasket ( $ this -> getId ( ) , $ this -> getParentId ( ) ) ; } return $ this -> basketAttributeList ; } | Loads and returns attribute list for display in basket |
37,074 | public function appendLink ( $ sAddParams , $ iLang = null ) { if ( $ sAddParams ) { if ( $ iLang === null ) { $ iLang = $ this -> getLanguage ( ) ; } $ this -> _aSeoAddParams [ $ iLang ] = isset ( $ this -> _aSeoAddParams [ $ iLang ] ) ? $ this -> _aSeoAddParams [ $ iLang ] . "&" : "" ; $ this -> _aSeoAddParams [ $ iLang ] .= $ sAddParams ; } } | Appends article seo url with additional request parameters |
37,075 | public function getBaseSeoLink ( $ iLang , $ blMain = false ) { $ oEncoder = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ SeoEncoderArticle :: class ) ; if ( ! $ blMain ) { return $ oEncoder -> getArticleUrl ( $ this , $ iLang , $ this -> getLinkType ( ) ) ; } return $ oEncoder -> getArticleMainUrl ( $ this , $ iLang ) ; } | Returns raw article seo url |
37,076 | public function appendStdLink ( $ sAddParams , $ iLang = null ) { if ( $ sAddParams ) { if ( $ iLang === null ) { $ iLang = $ this -> getLanguage ( ) ; } $ this -> _aStdAddParams [ $ iLang ] = isset ( $ this -> _aStdAddParams [ $ iLang ] ) ? $ this -> _aStdAddParams [ $ iLang ] . "&" : "" ; $ this -> _aStdAddParams [ $ iLang ] .= $ sAddParams ; } } | Appends article dynamic url with additional request parameters |
37,077 | public function getStdLink ( $ iLang = null , $ aParams = [ ] ) { if ( $ iLang === null ) { $ iLang = $ this -> getLanguage ( ) ; } if ( ! isset ( $ this -> _aStdUrls [ $ iLang ] ) ) { $ this -> _aStdUrls [ $ iLang ] = $ this -> getBaseStdLink ( $ iLang ) ; } return \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsUrl ( ) -> processUrl ( $ this -> _aStdUrls [ $ iLang ] , true , $ aParams , $ iLang ) ; } | Returns standard URL to product |
37,078 | public function getMediaUrls ( ) { if ( $ this -> _aMediaUrls === null ) { $ this -> _aMediaUrls = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ this -> _aMediaUrls -> init ( "oxmediaurl" ) ; $ this -> _aMediaUrls -> getBaseObject ( ) -> setLanguage ( $ this -> getLanguage ( ) ) ; $ sViewName = getViewName ( "oxmediaurls" , $ this -> getLanguage ( ) ) ; $ sQ = "select * from {$sViewName} where oxobjectid = '" . $ this -> getId ( ) . "'" ; $ this -> _aMediaUrls -> selectString ( $ sQ ) ; } return $ this -> _aMediaUrls ; } | Return article media URL |
37,079 | public function getDispSelList ( ) { if ( $ this -> _aDispSelList === null ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadSelectLists' ) && \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadSelectListsInAList' ) ) { $ this -> _aDispSelList = $ this -> getSelectLists ( ) ; } } return $ this -> _aDispSelList ; } | Returns select lists to display |
37,080 | public function getMoreDetailLink ( ) { if ( $ this -> _sMoreDetailLink == null ) { $ this -> _sMoreDetailLink = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopHomeUrl ( ) . 'cl=moredetails' ; if ( $ sActCat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'cnid' ) ) { $ this -> _sMoreDetailLink .= '&cnid=' . $ sActCat ; } $ this -> _sMoreDetailLink .= '&anid=' . $ this -> getId ( ) ; } return $ this -> _sMoreDetailLink ; } | Get more details link |
37,081 | public function getToBasketLink ( ) { if ( $ this -> _sToBasketLink == null ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> isSearchEngine ( ) ) { $ this -> _sToBasketLink = $ this -> getLink ( ) ; } else { $ this -> _sToBasketLink = $ myConfig -> getShopHomeUrl ( ) ; $ actControllerId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestControllerId ( ) ; if ( $ actControllerId == 'thankyou' ) { $ actControllerId = 'basket' ; } $ this -> _sToBasketLink .= 'cl=' . $ actControllerId ; if ( $ sActCat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'cnid' ) ) { $ this -> _sToBasketLink .= '&cnid=' . $ sActCat ; } $ this -> _sToBasketLink .= '&fnc=tobasket&aid=' . $ this -> getId ( ) . '&anid=' . $ this -> getId ( ) ; if ( $ sTpl = basename ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'tpl' ) ) ) { $ this -> _sToBasketLink .= '&tpl=' . $ sTpl ; } } } return $ this -> _sToBasketLink ; } | Get to basket link |
37,082 | public function getFTPrice ( ) { if ( $ oPrice = $ this -> getTPrice ( ) ) { if ( $ dPrice = $ this -> _getPriceForView ( $ oPrice ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice ) ; } } } | Returns rounded T price . |
37,083 | public function getFPrice ( ) { if ( $ oPrice = $ this -> getPrice ( ) ) { $ dPrice = $ this -> _getPriceForView ( $ oPrice ) ; return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice ) ; } } | Returns formatted product s price . |
37,084 | public function resetRemindStatus ( ) { if ( $ this -> oxarticles__oxremindactive -> value == 2 && $ this -> oxarticles__oxremindamount -> value <= $ this -> oxarticles__oxstock -> value ) { $ this -> oxarticles__oxremindactive -> value = 1 ; } } | Resets oxremindactive status . If remindActive status is 2 reminder is already sent . |
37,085 | public function getFNetPrice ( ) { if ( $ oPrice = $ this -> getPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPrice -> getNettoPrice ( ) ) ; } } | Returns formatted product s NETTO price . |
37,086 | public function getPictureUrl ( $ iIndex = 1 ) { if ( $ iIndex ) { $ sImgName = false ; if ( ! $ this -> _isFieldEmpty ( "oxarticles__oxpic" . $ iIndex ) ) { $ sImgName = basename ( $ this -> { "oxarticles__oxpic$iIndex" } -> value ) ; } $ sSize = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aDetailImageSizes' ) ; return \ OxidEsales \ Eshop \ Core \ Registry :: getPictureHandler ( ) -> getProductPicUrl ( "product/{$iIndex}/" , $ sImgName , $ sSize , 'oxpic' . $ iIndex ) ; } } | Returns article picture |
37,087 | public function getIconUrl ( $ iIndex = 0 ) { $ sImgName = false ; $ sDirname = "product/1/" ; if ( $ iIndex && ! $ this -> _isFieldEmpty ( "oxarticles__oxpic{$iIndex}" ) ) { $ sImgName = basename ( $ this -> { "oxarticles__oxpic$iIndex" } -> value ) ; $ sDirname = "product/{$iIndex}/" ; } elseif ( ! $ this -> _isFieldEmpty ( "oxarticles__oxicon" ) ) { $ sImgName = basename ( $ this -> oxarticles__oxicon -> value ) ; $ sDirname = "product/icon/" ; } elseif ( ! $ this -> _isFieldEmpty ( "oxarticles__oxpic1" ) ) { $ sImgName = basename ( $ this -> oxarticles__oxpic1 -> value ) ; } $ sSize = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sIconsize' ) ; $ sIconUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getPictureHandler ( ) -> getProductPicUrl ( $ sDirname , $ sImgName , $ sSize , $ iIndex ) ; return $ sIconUrl ; } | Returns article icon picture url . If no index specified will return main icon url . |
37,088 | public function getThumbnailUrl ( $ bSsl = null ) { $ sImgName = false ; $ sDirname = "product/1/" ; if ( ! $ this -> _isFieldEmpty ( "oxarticles__oxthumb" ) ) { $ sImgName = basename ( $ this -> oxarticles__oxthumb -> value ) ; $ sDirname = "product/thumb/" ; } elseif ( ! $ this -> _isFieldEmpty ( "oxarticles__oxpic1" ) ) { $ sImgName = basename ( $ this -> oxarticles__oxpic1 -> value ) ; } $ sSize = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sThumbnailsize' ) ; return \ OxidEsales \ Eshop \ Core \ Registry :: getPictureHandler ( ) -> getProductPicUrl ( $ sDirname , $ sImgName , $ sSize , 0 , $ bSsl ) ; } | Returns article thumbnail picture url |
37,089 | public function getZoomPictureUrl ( $ iIndex = '' ) { $ iIndex = ( int ) $ iIndex ; if ( $ iIndex > 0 && ! $ this -> _isFieldEmpty ( "oxarticles__oxpic" . $ iIndex ) ) { $ sImgName = basename ( $ this -> { "oxarticles__oxpic" . $ iIndex } -> value ) ; $ sSize = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "sZoomImageSize" ) ; return \ OxidEsales \ Eshop \ Core \ Registry :: getPictureHandler ( ) -> getProductPicUrl ( "product/{$iIndex}/" , $ sImgName , $ sSize , 'oxpic' . $ iIndex ) ; } } | Returns article zoom picture url |
37,090 | public function applyVats ( \ OxidEsales \ Eshop \ Core \ Price $ oPrice ) { $ this -> _applyVAT ( $ oPrice , $ this -> getArticleVat ( ) ) ; } | apply article and article use |
37,091 | public function getParentArticle ( ) { if ( $ this -> oxarticles__oxparentid && ( $ sParentId = $ this -> oxarticles__oxparentid -> value ) ) { $ sIndex = $ sParentId . "_" . $ this -> getLanguage ( ) ; if ( ! isset ( self :: $ _aLoadedParents [ $ sIndex ] ) ) { self :: $ _aLoadedParents [ $ sIndex ] = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; self :: $ _aLoadedParents [ $ sIndex ] -> _blLoadPrice = false ; self :: $ _aLoadedParents [ $ sIndex ] -> _blLoadVariants = false ; if ( ! self :: $ _aLoadedParents [ $ sIndex ] -> loadInLang ( $ this -> getLanguage ( ) , $ sParentId ) ) { self :: $ _aLoadedParents [ $ sIndex ] = false ; } } return self :: $ _aLoadedParents [ $ sIndex ] ; } } | Get parent article |
37,092 | public function updateVariantsRemind ( ) { if ( ! $ this -> isVariant ( ) && $ this -> _hasAnyVariant ( ) ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sOxId = $ oDb -> quote ( $ this -> getId ( ) ) ; $ sOxShopId = $ oDb -> quote ( $ this -> getShopId ( ) ) ; $ iRemindActive = $ oDb -> quote ( $ this -> oxarticles__oxremindactive -> value ) ; $ sUpdate = " update oxarticles set oxremindactive = $iRemindActive where oxparentid = $sOxId and oxshopid = $sOxShopId " ; $ oDb -> execute ( $ sUpdate ) ; } } | Updates article variants oxremindactive field as variants inherit this setting from parent |
37,093 | public function isVariant ( ) : bool { $ isVariant = false ; if ( isset ( $ this -> oxarticles__oxparentid ) && false !== $ this -> oxarticles__oxparentid ) { $ isVariant = ( bool ) $ this -> oxarticles__oxparentid -> value ; } return $ isVariant ; } | Returns TRUE if product is variant and false if not |
37,094 | public function isMdVariant ( ) { $ oMdVariant = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ VariantHandler :: class ) ; return $ oMdVariant -> isMdVariant ( $ this ) ; } | Returns TRUE if product is multidimensional variant and false if not |
37,095 | public function getSqlForPriceCategories ( $ sFields = '' ) { if ( ! $ sFields ) { $ sFields = 'oxid' ; } $ sSelectWhere = "select $sFields from " . $ this -> _getObjectViewName ( 'oxcategories' ) . " where" ; $ sQuotedPrice = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( $ this -> oxarticles__oxprice -> value ) ; return "$sSelectWhere oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $sQuotedPrice and oxpriceto >= $sQuotedPrice" . " union $sSelectWhere oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $sQuotedPrice" . " union $sSelectWhere oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $sQuotedPrice" ; } | get Sql for loading price categories which include this article |
37,096 | protected function fetchFirstInPriceCategory ( $ categoryPriceId ) { $ database = $ this -> getDatabase ( ) ; $ query = $ this -> createFetchFirstInPriceCategorySql ( $ categoryPriceId ) ; $ result = $ database -> getOne ( $ query ) ; return $ result ; } | Fetch the article corresponding to this object in the price category with the given id . |
37,097 | protected function createFetchFirstInPriceCategorySql ( $ categoryPriceId ) { $ database = $ this -> getDatabase ( ) ; $ quotedPrice = $ database -> quote ( $ this -> oxarticles__oxprice -> value ) ; $ quotedCategoryId = $ database -> quote ( $ categoryPriceId ) ; $ query = "select 1 from " . $ this -> _getObjectViewName ( 'oxcategories' ) . " where oxid=$quotedCategoryId and" . "( (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)" . " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)" . " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)" . ")" ; return $ query ; } | Create the sql for the fetchFirstInPriceCategory method . |
37,098 | public function getPictureFieldValue ( $ sFieldName , $ iIndex = null ) { if ( $ sFieldName ) { $ sFieldName = "oxarticles__" . $ sFieldName . $ iIndex ; return $ this -> $ sFieldName -> value ; } } | Return article picture file name |
37,099 | public function getMasterZoomPictureUrl ( $ iIndex ) { $ sPicUrl = false ; $ sPicName = basename ( $ this -> { "oxarticles__oxpic" . $ iIndex } -> value ) ; if ( $ sPicName && $ sPicName != "nopic.jpg" ) { $ sPicUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getPictureUrl ( "master/product/" . $ iIndex . "/" . $ sPicName ) ; if ( ! $ sPicUrl || basename ( $ sPicUrl ) == "nopic.jpg" ) { $ sPicUrl = false ; } } return $ sPicUrl ; } | Get master zoom picture url |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.