idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
37,500 | protected function _parseRequestParametersForSave ( $ aReqParams ) { if ( ! isset ( $ aReqParams [ 'oxcategories__oxactive' ] ) ) { $ aReqParams [ 'oxcategories__oxactive' ] = 0 ; } if ( ! isset ( $ aReqParams [ 'oxcategories__oxhidden' ] ) ) { $ aReqParams [ 'oxcategories__oxhidden' ] = 0 ; } if ( ! isset ( $ aReqParams [ 'oxcategories__oxdefsortmode' ] ) ) { $ aReqParams [ 'oxcategories__oxdefsortmode' ] = 0 ; } if ( $ aReqParams [ 'oxcategories__oxvat' ] === '' ) { $ aReqParams [ 'oxcategories__oxvat' ] = null ; } if ( $ this -> getEditObjectId ( ) == self :: NEW_CATEGORY_ID ) { $ aReqParams [ 'oxcategories__oxid' ] = null ; } if ( isset ( $ aReqParams [ "oxcategories__oxlongdesc" ] ) ) { $ aReqParams [ "oxcategories__oxlongdesc" ] = $ this -> _processLongDesc ( $ aReqParams [ "oxcategories__oxlongdesc" ] ) ; } if ( empty ( $ aReqParams [ 'oxcategories__oxpricefrom' ] ) ) { $ aReqParams [ 'oxcategories__oxpricefrom' ] = 0 ; } if ( empty ( $ aReqParams [ 'oxcategories__oxpriceto' ] ) ) { $ aReqParams [ 'oxcategories__oxpriceto' ] = 0 ; } return $ aReqParams ; } | Parse parameters prior to saving category . |
37,501 | public function getWrappingPrice ( $ dAmount = 1 ) { if ( $ this -> _oPrice === null ) { $ this -> _oPrice = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; if ( ! $ this -> _blWrappingVatOnTop ) { $ this -> _oPrice -> setBruttoPriceMode ( ) ; } else { $ this -> _oPrice -> setNettoPriceMode ( ) ; } $ oCur = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; $ this -> _oPrice -> setPrice ( $ this -> oxwrapping__oxprice -> value * $ oCur -> rate , $ this -> _dVat ) ; $ this -> _oPrice -> multiply ( $ dAmount ) ; } return $ this -> _oPrice ; } | Returns oxprice object for wrapping |
37,502 | public function getWrappingList ( $ sWrapType ) { $ oEntries = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oEntries -> init ( 'oxwrapping' ) ; $ sWrappingViewName = getViewName ( 'oxwrapping' ) ; $ sSelect = "select * from $sWrappingViewName where $sWrappingViewName.oxactive = '1' and $sWrappingViewName.oxtype = " . \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( $ sWrapType ) ; $ oEntries -> selectString ( $ sSelect ) ; return $ oEntries ; } | Loads wrapping list for specific wrap type |
37,503 | public function getFPrice ( ) { $ dPrice = $ this -> getPrice ( ) ; return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPrice , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ) ; } | Returns formatted wrapping price |
37,504 | public function getPrice ( ) { if ( $ this -> _isPriceViewModeNetto ( ) ) { $ dPrice = $ this -> getWrappingPrice ( ) -> getNettoPrice ( ) ; } else { $ dPrice = $ this -> getWrappingPrice ( ) -> getBruttoPrice ( ) ; } return $ dPrice ; } | Gets price . |
37,505 | public function getPictureUrl ( ) { if ( $ this -> oxwrapping__oxpic -> value ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getPictureUrl ( "master/wrapping/" . $ this -> oxwrapping__oxpic -> value , false , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> isSsl ( ) , null , $ this -> oxwrapping__oxshopid -> value ) ; } } | Returns returns dyn image dir |
37,506 | public function addGroupToNews ( ) { $ aAddGroups = $ this -> _getActionIds ( 'oxgroups.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sGroupTable = $ this -> _getViewName ( 'oxgroups' ) ; $ aAddGroups = $ this -> _getAll ( $ this -> _addFilter ( "select $sGroupTable.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ soxId && $ soxId != "-1" && is_array ( $ aAddGroups ) ) { foreach ( $ aAddGroups as $ sAddgroup ) { $ oNewGroup = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Object2Group :: class ) ; $ oNewGroup -> oxobject2group__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oNewGroup -> oxobject2group__oxgroupsid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAddgroup ) ; $ oNewGroup -> save ( ) ; } } } | Adds user group for viewing some news . |
37,507 | public function generateV5 ( $ sSeed , $ sSalt ) { $ sSeed = str_replace ( [ '-' , '{' , '}' ] , '' , $ sSeed ) ; $ sBinarySeed = '' ; for ( $ i = 0 ; $ i < strlen ( $ sSeed ) ; $ i += 2 ) { $ sBinarySeed .= chr ( hexdec ( $ sSeed [ $ i ] . $ sSeed [ $ i + 1 ] ) ) ; } $ sHash = sha1 ( $ sBinarySeed . $ sSalt ) ; $ sUUID = sprintf ( '%08s-%04s-%04x-%04x-%12s' , substr ( $ sHash , 0 , 8 ) , substr ( $ sHash , 8 , 4 ) , ( hexdec ( substr ( $ sHash , 12 , 4 ) ) & 0x0fff ) | 0x3000 , ( hexdec ( substr ( $ sHash , 16 , 4 ) ) & 0x3fff ) | 0x8000 , substr ( $ sHash , 20 , 12 ) ) ; return $ sUUID ; } | Generates version 5 UUID . |
37,508 | protected function _generateBasedOnOpenSSL ( ) { $ sRandomData = openssl_random_pseudo_bytes ( 16 ) ; $ sRandomData [ 6 ] = chr ( ord ( $ sRandomData [ 6 ] ) & 0x0f | 0x40 ) ; $ sRandomData [ 8 ] = chr ( ord ( $ sRandomData [ 8 ] ) & 0x3f | 0x80 ) ; return vsprintf ( '%s%s-%s-%s-%s-%s%s%s' , str_split ( bin2hex ( $ sRandomData ) , 4 ) ) ; } | Generates UUID based on OpenSSL s openssl_random_pseudo_bytes . |
37,509 | protected function _generateBasedOnMtRand ( ) { return sprintf ( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x' , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0x0fff ) | 0x4000 , mt_rand ( 0 , 0x3fff ) | 0x8000 , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) ) ; } | Generates UUID based on mt_rand . |
37,510 | public function getRequestUrl ( $ sParams = '' , $ blReturnUrl = false ) { $ requestUrl = '' ; if ( $ _SERVER [ "REQUEST_METHOD" ] != "POST" ) { if ( isset ( $ _SERVER [ 'REQUEST_URI' ] ) && $ _SERVER [ 'REQUEST_URI' ] ) { $ rawRequestUrl = $ _SERVER [ 'REQUEST_URI' ] ; } else { $ rawRequestUrl = $ _SERVER [ 'SCRIPT_URI' ] ; } if ( $ rawRequestUrl && ( $ iPos = stripos ( $ rawRequestUrl , '?' ) ) !== false ) { $ string = getStr ( ) ; $ requestUrl = 'index.php' . $ string -> substr ( $ rawRequestUrl , $ iPos ) ; $ requestUrl = $ string -> preg_replace ( '/(&|\?)(force_)?(admin_)?sid=[^&]*&?/' , '$1' , $ requestUrl ) ; $ requestUrl = $ string -> preg_replace ( '/(&|\?)stoken=[^&]*&?/' , '$1' , $ requestUrl ) ; $ requestUrl = $ string -> preg_replace ( '/&$/' , '' , $ requestUrl ) ; $ requestUrl = str_replace ( '&' , '&' , $ requestUrl ) ; } } return $ requestUrl ; } | Returns request url which was executed to render current page view |
37,511 | private function getMergedReviewAndRatingList ( $ userId ) { $ reviews = $ this -> userReviewService -> getReviews ( $ userId ) ; $ ratings = $ this -> userRatingService -> getRatings ( $ userId ) ; return $ this -> reviewAndRatingMergingService -> mergeReviewAndRating ( $ reviews , $ ratings ) ; } | Returns merged Rating and Review . |
37,512 | private function sortReviewAndRatingList ( ArrayCollection $ reviewAndRatingList ) { $ reviewAndRatingListArray = $ reviewAndRatingList -> toArray ( ) ; usort ( $ reviewAndRatingListArray , function ( ReviewAndRating $ first , ReviewAndRating $ second ) { return $ first -> getCreatedAt ( ) < $ second -> getCreatedAt ( ) ? 1 : - 1 ; } ) ; return new ArrayCollection ( $ reviewAndRatingListArray ) ; } | Sorts ReviewAndRating list . |
37,513 | public function fetchRow ( ) { $ this -> fields = $ this -> getStatement ( ) -> fetch ( ) ; if ( false === $ this -> fields ) { $ this -> EOF = true ; } return $ this -> fields ; } | Fetches the next row from a result set and fills the fields array . |
37,514 | protected function getSidFromRequest ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sid = null ; $ sForceSidParam = $ myConfig -> getRequestParameter ( $ this -> getForcedName ( ) ) ; $ sSidParam = $ myConfig -> getRequestParameter ( $ this -> getName ( ) ) ; if ( $ sForceSidParam ) { $ sid = $ sForceSidParam ; } elseif ( $ this -> _getSessionUseCookies ( ) && $ this -> _getCookieSid ( ) ) { $ sid = $ this -> _getCookieSid ( ) ; } elseif ( $ sSidParam ) { $ sid = $ sSidParam ; } return $ sid ; } | retrieves the session id from the request if any |
37,515 | public function start ( ) { if ( $ this -> isSessionStarted ( ) ) { return ; } $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ this -> isAdmin ( ) ) { $ this -> setName ( "admin_sid" ) ; } else { $ this -> setName ( "sid" ) ; } $ sid = $ this -> getSidFromRequest ( ) ; if ( $ this -> _allowSessionStart ( ) ) { if ( ! $ sid ) { self :: $ _blIsNewSession = true ; $ this -> initNewSession ( ) ; } else { self :: $ _blIsNewSession = false ; $ this -> _setSessionId ( $ sid ) ; $ this -> _sessionStart ( ) ; } if ( $ this -> _sId != session_id ( ) ) { $ this -> _setSessionId ( session_id ( ) ) ; } $ blSwapped = $ this -> _isSwappedClient ( ) ; if ( ! self :: $ _blIsNewSession && $ blSwapped ) { $ this -> initNewSession ( ) ; if ( $ this -> _sErrorMsg && $ myConfig -> getConfigParam ( 'iDebug' ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , $ this -> _sErrorMsg ) ) ; } } elseif ( ! $ blSwapped ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> loadSessionCookies ( ) ; } } } | Starts shop session generates unique session ID extracts user IP . |
37,516 | protected function _initNewSessionChallenge ( ) { $ this -> setVariable ( 'sess_stoken' , sprintf ( '%X' , crc32 ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUID ( ) ) ) ) ; } | initialize new session challenge token |
37,517 | public function initNewSession ( ) { if ( self :: $ _blIsNewSession ) { $ this -> _sessionStart ( ) ; } $ aPersistent = [ ] ; foreach ( $ this -> _aPersistentParams as $ sParam ) { if ( ( $ sValue = $ this -> getVariable ( $ sParam ) ) ) { $ aPersistent [ $ sParam ] = $ sValue ; } } $ this -> _setSessionId ( $ this -> _getNewSessionId ( ) ) ; foreach ( $ aPersistent as $ sKey => $ sParam ) { $ this -> setVariable ( $ sKey , $ aPersistent [ $ sKey ] ) ; } $ this -> _initNewSessionChallenge ( ) ; $ this -> setVariable ( "sessionagent" , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getServerVar ( 'HTTP_USER_AGENT' ) ) ; } | Assigns new session ID clean existing data except persistent . |
37,518 | public function regenerateSessionId ( ) { if ( self :: $ _blIsNewSession ) { $ this -> _sessionStart ( ) ; $ this -> setVariable ( "sessionagent" , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getServerVar ( 'HTTP_USER_AGENT' ) ) ; } $ this -> _setSessionId ( $ this -> _getNewSessionId ( false ) ) ; $ this -> _initNewSessionChallenge ( ) ; } | Regenerates session id |
37,519 | public function getBasket ( ) { if ( $ this -> _oBasket === null ) { $ serializedBasket = $ this -> getVariable ( $ this -> _getBasketName ( ) ) ; oxNew ( BasketItem :: class ) ; $ emptyBasket = oxNew ( Basket :: class ) ; $ basket = $ this -> isSerializedBasketValid ( $ serializedBasket ) && ( $ unserializedBasket = unserialize ( $ serializedBasket ) ) && $ this -> isUnserializedBasketValid ( $ unserializedBasket , $ emptyBasket ) ? $ unserializedBasket : $ emptyBasket ; $ this -> _validateBasket ( $ basket ) ; $ this -> setBasket ( $ basket ) ; } return $ this -> _oBasket ; } | Returns basket session object . |
37,520 | protected function isSerializedBasketValid ( $ serializedBasket ) { $ basketClass = get_class ( oxNew ( Basket :: class ) ) ; $ basketItemClass = get_class ( oxNew ( BasketItem :: class ) ) ; $ priceClass = get_class ( oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ) ; $ priceListClass = get_class ( oxNew ( \ OxidEsales \ Eshop \ Core \ PriceList :: class ) ) ; $ userClass = get_class ( oxNew ( User :: class ) ) ; return $ serializedBasket && $ this -> isClassInSerializedObject ( $ serializedBasket , $ basketClass ) && $ this -> isClassInSerializedObject ( $ serializedBasket , $ basketItemClass ) && $ this -> isClassOrNullInSerializedObjectAfterField ( $ serializedBasket , "oPrice" , $ priceClass ) && $ this -> isClassOrNullInSerializedObjectAfterField ( $ serializedBasket , "oProductsPriceList" , $ priceListClass ) && $ this -> isClassOrNullInSerializedObjectAfterField ( $ serializedBasket , "oUser" , $ userClass ) ; } | True if given serialized object is constructed with compatible classes . |
37,521 | protected function isClassInSerializedObject ( $ serializedObject , $ className ) { $ quotedClassName = sprintf ( '"%s"' , $ className ) ; return strpos ( $ serializedObject , $ quotedClassName ) !== false ; } | True if given class is found within serialized object . |
37,522 | protected function isClassOrNullInSerializedObjectAfterField ( $ serializedObject , $ fieldName , $ className ) { $ fieldAndClassPattern = '/' . preg_quote ( $ fieldName , '/' ) . '";((?P<null>N);|O:\d+:"(?P<class>[\w\\\\]+)":)/' ; $ matchFound = preg_match ( $ fieldAndClassPattern , $ serializedObject , $ matches ) === 1 ; return $ matchFound && ( ( isset ( $ matches [ 'class' ] ) && $ matches [ 'class' ] === $ className ) || ( isset ( $ matches [ 'null' ] ) && $ matches [ 'null' ] === 'N' ) ) ; } | True if given class or null value is found after given field in serialized object . |
37,523 | protected function _validateBasket ( \ OxidEsales \ Eshop \ Application \ Model \ Basket $ oBasket ) { $ aCurrContent = $ oBasket -> getContents ( ) ; if ( empty ( $ aCurrContent ) ) { return ; } $ iCurrLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; foreach ( $ aCurrContent as $ oContent ) { if ( $ oContent -> getLanguageId ( ) != $ iCurrLang ) { $ oContent -> setLanguageId ( $ iCurrLang ) ; } } } | Validate loaded from session basket content . Check for language change . |
37,524 | public function isSidNeeded ( $ sUrl = null ) { if ( $ this -> isAdmin ( ) ) { return true ; } $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ this -> _getSessionUseCookies ( ) || ( $ sUrl && $ this -> _getCookieSid ( ) && ! $ oConfig -> isCurrentProtocol ( $ sUrl ) ) ) { return true ; } if ( $ sUrl && ! $ oConfig -> isCurrentUrl ( $ sUrl ) ) { return true ; } elseif ( $ this -> _blSidNeeded === null ) { $ this -> _blSidNeeded = false ; if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> isSearchEngine ( ) ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getOxCookie ( $ this -> getName ( ) ) ) { $ this -> _blSidNeeded = false ; } elseif ( $ this -> _forceSessionStart ( ) ) { $ this -> _blSidNeeded = true ; } else { if ( $ blSidNeeded = $ this -> getVariable ( 'blSidNeeded' ) ) { $ this -> _blSidNeeded = true ; } elseif ( $ this -> _isSessionRequiredAction ( ) && ! count ( $ _COOKIE ) ) { $ this -> _blSidNeeded = true ; $ this -> setVariable ( 'blSidNeeded' , $ this -> _blSidNeeded ) ; } } } } return $ this -> _blSidNeeded ; } | Checks if cookies are not available . Returns TRUE of sid needed |
37,525 | public function isActualSidInCookie ( ) { return isset ( $ _COOKIE [ $ this -> getName ( ) ] ) && ( $ _COOKIE [ $ this -> getName ( ) ] == $ this -> getId ( ) ) ; } | Checks if current session id is the same as in originally received cookie . This method is intended to indicate if new session cookie is to be sent as header from this script execution . |
37,526 | protected function _allowSessionStart ( ) { $ blAllowSessionStart = true ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ this -> isAdmin ( ) ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> isSearchEngine ( ) || $ myConfig -> getRequestParameter ( 'skipSession' ) ) { $ blAllowSessionStart = false ; } elseif ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getOxCookie ( 'oxid_' . $ myConfig -> getShopId ( ) . '_autologin' ) === '1' ) { $ blAllowSessionStart = true ; } elseif ( ! $ this -> _forceSessionStart ( ) && ! \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getOxCookie ( 'sid_key' ) ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getOxCookie ( $ this -> getName ( ) ) && ! ( $ myConfig -> getRequestParameter ( $ this -> getName ( ) ) || $ myConfig -> getRequestParameter ( $ this -> getForcedName ( ) ) ) && ! $ this -> _isSessionRequiredAction ( ) ) { $ blAllowSessionStart = false ; } } } return $ blAllowSessionStart ; } | Checks if we can start new session . Returns bool success status |
37,527 | protected function _isSwappedClient ( ) { $ blSwapped = false ; $ myUtilsServer = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) ; if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> isSearchEngine ( ) && ! $ myUtilsServer -> isTrustedClientIp ( ) && ! $ this -> _isValidRemoteAccessToken ( ) ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ blSwapped = $ this -> _checkUserAgent ( $ myUtilsServer -> getServerVar ( 'HTTP_USER_AGENT' ) , $ this -> getVariable ( 'sessionagent' ) ) ; if ( ! $ blSwapped ) { $ blDisableCookieCheck = $ myConfig -> getConfigParam ( 'blDisableCookieCheck' ) ; $ blUseCookies = $ this -> _getSessionUseCookies ( ) ; if ( ! $ blDisableCookieCheck && $ blUseCookies ) { $ blSwapped = $ this -> _checkCookies ( $ myUtilsServer -> getOxCookie ( 'sid_key' ) , $ this -> getVariable ( "sessioncookieisset" ) ) ; } } } return $ blSwapped ; } | Saves various visitor parameters and compares with current data . Returns true if any change is detected . Using this method we can detect different visitor with same session id . |
37,528 | protected function _checkUserAgent ( $ sAgent , $ sExistingAgent ) { $ blCheck = false ; $ oUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) ; $ sAgent = $ oUtils -> processUserAgentInfo ( $ sAgent ) ; $ sExistingAgent = $ oUtils -> processUserAgentInfo ( $ sExistingAgent ) ; if ( $ sAgent && $ sAgent !== $ sExistingAgent ) { if ( $ sExistingAgent ) { $ this -> _sErrorMsg = "Different browser ({$sExistingAgent}, {$sAgent}), creating new SID...<br>" ; } $ blCheck = true ; } return $ blCheck ; } | Checking user agent |
37,529 | protected function _checkCookies ( $ sCookieSid , $ aSessCookieSetOnce ) { $ blSwapped = false ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sCurrUrl = $ myConfig -> isSsl ( ) ? $ myConfig -> getSslShopUrl ( ) : $ myConfig -> getShopUrl ( ) ; $ blSessCookieSetOnce = false ; if ( is_array ( $ aSessCookieSetOnce ) && isset ( $ aSessCookieSetOnce [ $ sCurrUrl ] ) ) { $ blSessCookieSetOnce = $ aSessCookieSetOnce [ $ sCurrUrl ] ; } if ( $ blSessCookieSetOnce && ! $ sCookieSid ) { if ( $ myConfig -> getConfigParam ( 'iDebug' ) ) { $ this -> _sErrorMsg = "Cookie not found, creating new SID...<br>" ; $ this -> _sErrorMsg .= "Cookie: $sCookieSid<br>" ; $ this -> _sErrorMsg .= "Session: $blSessCookieSetOnce<br>" ; $ this -> _sErrorMsg .= "URL: " . $ sCurrUrl . "<br>" ; } $ blSwapped = true ; } if ( $ sCookieSid == "oxid" && ! $ blSessCookieSetOnce ) { if ( ! is_array ( $ aSessCookieSetOnce ) ) { $ aSessCookieSetOnce = [ ] ; } $ aSessCookieSetOnce [ $ sCurrUrl ] = "ox_true" ; $ this -> setVariable ( "sessioncookieisset" , $ aSessCookieSetOnce ) ; } if ( ! $ sCookieSid ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> setOxCookie ( 'sid_key' , 'oxid' ) ; } return $ blSwapped ; } | Check for existing cookie . Cookie info is dropped from time to time . |
37,530 | protected function _getBasketName ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ myConfig -> getConfigParam ( 'blMallSharedBasket' ) == 0 ) { return $ myConfig -> getShopId ( ) . "_basket" ; } return "basket" ; } | Returns name of shopping basket . |
37,531 | protected function _getRequireSessionWithParams ( ) { $ aCfgArray = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aRequireSessionWithParams' ) ; if ( is_array ( $ aCfgArray ) ) { $ aDefault = $ this -> _aRequireSessionWithParams ; foreach ( $ aCfgArray as $ key => $ val ) { if ( ! is_array ( $ val ) && $ val ) { unset ( $ aDefault [ $ key ] ) ; } } return array_merge_recursive ( $ aCfgArray , $ aDefault ) ; } return $ this -> _aRequireSessionWithParams ; } | returns configuration array with info which parameters require session start |
37,532 | protected function _isSessionRequiredAction ( ) { foreach ( $ this -> _getRequireSessionWithParams ( ) as $ sParam => $ aValues ) { $ sValue = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( $ sParam ) ; if ( isset ( $ sValue ) ) { if ( is_array ( $ aValues ) ) { if ( isset ( $ aValues [ $ sValue ] ) && $ aValues [ $ sValue ] ) { return true ; } } elseif ( $ aValues ) { return true ; } } } return ( isset ( $ _SERVER [ 'REQUEST_METHOD' ] ) && $ _SERVER [ 'REQUEST_METHOD' ] == 'POST' ) ; } | Tests if current action requires session |
37,533 | protected function _isValidRemoteAccessToken ( ) { $ inputToken = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'rtoken' ) ; $ token = $ this -> getRemoteAccessToken ( false ) ; return ! empty ( $ inputToken ) ? ( $ token === $ inputToken ) : false ; } | Checks if token supplied over rtoken parameter matches remote access session token . |
37,534 | public function getBasketReservations ( ) { if ( ! $ this -> _oBasketReservations ) { $ this -> _oBasketReservations = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ BasketReservation :: class ) ; } return $ this -> _oBasketReservations ; } | return basket reservations handler object |
37,535 | public function render ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; parent :: render ( ) ; $ this -> _aViewData [ "edit" ] = $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oArticle -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; $ oOtherLang = $ oArticle -> getAvailableInLangs ( ) ; if ( ! isset ( $ oOtherLang [ $ this -> _iEditLang ] ) ) { $ oArticle -> loadInLang ( key ( $ oOtherLang ) , $ soxId ) ; } foreach ( $ oOtherLang as $ id => $ language ) { $ oLang = new stdClass ( ) ; $ oLang -> sLangDesc = $ language ; $ oLang -> selected = ( $ id == $ this -> _iEditLang ) ; $ this -> _aViewData [ "otherlang" ] [ $ id ] = clone $ oLang ; } if ( $ oArticle -> isDerived ( ) ) { $ this -> _aViewData [ 'readonly' ] = true ; } if ( $ oArticle -> oxarticles__oxparentid -> value ) { $ oParentArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oParentArticle -> load ( $ oArticle -> oxarticles__oxparentid -> value ) ; $ this -> _aViewData [ "parentarticle" ] = $ oParentArticle ; $ this -> _aViewData [ "oxparentid" ] = $ oArticle -> oxarticles__oxparentid -> value ; } if ( $ myConfig -> getConfigParam ( 'blMallInterchangeArticles' ) ) { $ sShopSelect = '1' ; } else { $ sShopID = $ myConfig -> getShopID ( ) ; $ sShopSelect = " oxshopid = '$sShopID' " ; } $ oPriceList = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oPriceList -> init ( 'oxbase' , "oxprice2article" ) ; $ sQ = "select * from oxprice2article where oxartid = '{$soxId}' " . "and {$sShopSelect} and (oxamount > 0 or oxamountto > 0) order by oxamount " ; $ oPriceList -> selectstring ( $ sQ ) ; $ this -> _aViewData [ "amountprices" ] = $ oPriceList ; } return "article_stock.tpl" ; } | Loads article Inventory information passes it to Smarty engine and returns name of template file article_stock . tpl . |
37,536 | public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oArticle -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; $ oArticle -> setLanguage ( 0 ) ; if ( ! $ oArticle -> oxarticles__oxparentid -> value && ! isset ( $ aParams [ 'oxarticles__oxremindactive' ] ) ) { $ aParams [ 'oxarticles__oxremindactive' ] = 0 ; } $ oArticle -> assign ( $ aParams ) ; $ oArticle -> setLanguage ( $ this -> _iEditLang ) ; $ oArticle = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsFile ( ) -> processFiles ( $ oArticle ) ; $ oArticle -> resetRemindStatus ( ) ; $ oArticle -> updateVariantsRemind ( ) ; $ oArticle -> save ( ) ; } | Saves article Inventori information changes . |
37,537 | public function updateprices ( ) { $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "updateval" ) ; if ( is_array ( $ aParams ) ) { foreach ( $ aParams as $ soxId => $ aStockParams ) { $ this -> addprice ( $ soxId , $ aStockParams ) ; } } $ sOxArtId = $ this -> getEditObjectId ( ) ; $ this -> onArticleAmountPriceChange ( $ sOxArtId ) ; } | Updates all amount prices for article at once |
37,538 | public function deleteprice ( ) { $ this -> resetContentCache ( ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sPriceId = $ oDb -> quote ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "priceid" ) ) ; $ articleId = $ this -> getEditObjectId ( ) ; $ sId = $ oDb -> quote ( $ articleId ) ; $ oDb -> execute ( "delete from oxprice2article where oxid = {$sPriceId} and oxartid = {$sId}" ) ; $ this -> onArticleAmountPriceChange ( $ articleId ) ; } | Adds amount price to article |
37,539 | public function load ( $ sModuleId ) { $ sModulePath = $ this -> getModuleFullPath ( $ sModuleId ) ; $ sMetadataPath = $ sModulePath . "/metadata.php" ; if ( $ sModulePath && is_readable ( $ sMetadataPath ) ) { $ this -> includeModuleMetaData ( $ sMetadataPath ) ; $ this -> _blRegistered = true ; $ this -> _blMetadata = true ; $ this -> _aModule [ 'active' ] = $ this -> isActive ( ) ; return true ; } return false ; } | Load module info |
37,540 | public function loadByDir ( $ sModuleDir ) { $ sModuleId = null ; $ aModulePaths = $ this -> getModulePaths ( ) ; if ( is_array ( $ aModulePaths ) ) { $ sModuleId = array_search ( $ sModuleDir , $ aModulePaths ) ; } if ( ! $ sModuleId ) { $ sModuleId = $ sModuleDir ; } return $ this -> load ( $ sModuleId ) ; } | Load module by dir name |
37,541 | public function getTitle ( ) { $ iLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getTplLanguage ( ) ; return $ this -> getInfo ( "title" , $ iLang ) ; } | Get module title |
37,542 | public function getExtensions ( ) { $ rawExtensions = isset ( $ this -> _aModule [ 'extend' ] ) ? $ this -> _aModule [ 'extend' ] : [ ] ; return $ this -> getUnifiedShopClassExtensionsForBc ( $ rawExtensions ) ; } | Returns array of module extensions . |
37,543 | public function getControllers ( ) { if ( isset ( $ this -> _aModule [ 'controllers' ] ) && ! is_array ( $ this -> _aModule [ 'controllers' ] ) ) { throw new \ InvalidArgumentException ( 'Value for metadata key "controllers" must be an array' ) ; } return isset ( $ this -> _aModule [ 'controllers' ] ) ? array_change_key_case ( $ this -> _aModule [ 'controllers' ] ) : [ ] ; } | Returns associative array of module controller ids and corresponding classes . |
37,544 | public function getIdByPath ( $ module ) { $ moduleId = null ; $ moduleFile = $ module ; $ moduleId = $ this -> getIdFromExtension ( $ module ) ; if ( ! $ moduleId ) { $ modulePaths = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModulePaths' ) ; if ( is_array ( $ modulePaths ) ) { foreach ( $ modulePaths as $ id => $ path ) { if ( strpos ( $ moduleFile , $ path . "/" ) === 0 ) { $ moduleId = $ id ; } } } } if ( ! $ moduleId ) { $ moduleId = substr ( $ moduleFile , 0 , strpos ( $ moduleFile , "/" ) ) ; } if ( ! $ moduleId ) { $ moduleId = $ moduleFile ; } return $ moduleId ; } | Get module ID |
37,545 | public function getModuleIdByClassName ( $ className ) { if ( ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ className ) ) { return $ this -> backwardsCompatibleGetModuleIdByClassName ( $ className ) ; } $ moduleId = '' ; $ extensions = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleExtensions' ) ; foreach ( $ extensions as $ id => $ moduleClasses ) { if ( in_array ( $ className , $ moduleClasses ) ) { $ moduleId = $ id ; break ; } } return $ moduleId ; } | Get the module id for a given class name . If there are duplicates the first module id will be returned . |
37,546 | public function getInfo ( $ sName , $ iLang = null ) { if ( isset ( $ this -> _aModule [ $ sName ] ) ) { if ( $ iLang !== null && is_array ( $ this -> _aModule [ $ sName ] ) ) { $ sValue = null ; $ sLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageAbbr ( $ iLang ) ; if ( ! empty ( $ this -> _aModule [ $ sName ] ) ) { if ( ! empty ( $ this -> _aModule [ $ sName ] [ $ sLang ] ) ) { $ sValue = $ this -> _aModule [ $ sName ] [ $ sLang ] ; } elseif ( ! empty ( $ this -> _aModule [ 'lang' ] ) ) { $ sValue = $ this -> _aModule [ $ sName ] [ $ this -> _aModule [ 'lang' ] ] ; } else { $ sValue = reset ( $ this -> _aModule [ $ sName ] ) ; } return $ sValue ; } } else { return $ this -> _aModule [ $ sName ] ; } } } | Get module info item . If second param is passed will try to get value according selected language . |
37,547 | public function isActive ( ) { $ blActive = false ; $ sId = $ this -> getId ( ) ; if ( ! is_null ( $ sId ) ) { $ blActive = ! $ this -> _isInDisabledList ( $ sId ) ; if ( $ blActive && $ this -> hasExtendClass ( ) ) { $ blActive = $ this -> _isExtensionsActive ( ) ; } } return $ blActive ; } | Check if extension is active |
37,548 | public function hasExtendClass ( ) { $ aExtensions = $ this -> getExtensions ( ) ; return isset ( $ aExtensions ) && is_array ( $ aExtensions ) && ! empty ( $ aExtensions ) ; } | Checks if has extend class . |
37,549 | public function getMetadataPath ( ) { $ sModulePath = $ this -> getModuleFullPath ( ) ; if ( substr ( $ sModulePath , - 1 ) != DIRECTORY_SEPARATOR ) { $ sModulePath .= DIRECTORY_SEPARATOR ; } return $ sModulePath . 'metadata.php' ; } | Get full path to module metadata file . |
37,550 | public function getModuleFullPath ( $ sModuleId = null ) { if ( ! $ sModuleId ) { $ sModuleId = $ this -> getId ( ) ; } if ( $ sModuleDir = $ this -> getModulePath ( $ sModuleId ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getModulesDir ( ) . $ sModuleDir ; } return false ; } | Returns full module path |
37,551 | public function getTemplates ( $ sModuleId = null ) { if ( is_null ( $ sModuleId ) ) { $ sModuleId = $ this -> getId ( ) ; } if ( ! $ sModuleId ) { return [ ] ; } $ sShopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; return \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getCol ( "SELECT oxtemplate FROM oxtplblocks WHERE oxmodule = '$sModuleId' AND oxshopid = '$sShopId'" ) ; } | Return templates affected by template blocks for given module id . |
37,552 | protected function _countActivatedExtensions ( $ aModuleExtensions , $ aInstalledExtensions ) { $ iActive = 0 ; foreach ( $ aModuleExtensions as $ sClass => $ mExtension ) { if ( is_array ( $ mExtension ) ) { foreach ( $ mExtension as $ sExtension ) { if ( ( isset ( $ aInstalledExtensions [ $ sClass ] ) && in_array ( $ sExtension , $ aInstalledExtensions [ $ sClass ] ) ) ) { $ iActive ++ ; } } } elseif ( ( isset ( $ aInstalledExtensions [ $ sClass ] ) && in_array ( $ mExtension , $ aInstalledExtensions [ $ sClass ] ) ) ) { $ iActive ++ ; } } return $ iActive ; } | Counts activated module extensions . |
37,553 | protected function _countExtensions ( $ aModuleExtensions ) { $ iCount = 0 ; foreach ( $ aModuleExtensions as $ mExtensions ) { if ( is_array ( $ mExtensions ) ) { $ iCount += count ( $ mExtensions ) ; } else { $ iCount ++ ; } } return $ iCount ; } | Counts module extensions . |
37,554 | protected function _isExtensionsActive ( ) { $ aModuleExtensions = $ this -> getExtensions ( ) ; $ aInstalledExtensions = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getModulesWithExtendedClass ( ) ; $ iModuleExtensionsCount = $ this -> _countExtensions ( $ aModuleExtensions ) ; $ iActivatedModuleExtensionsCount = $ this -> _countActivatedExtensions ( $ aModuleExtensions , $ aInstalledExtensions ) ; return $ iModuleExtensionsCount > 0 && $ iActivatedModuleExtensionsCount == $ iModuleExtensionsCount ; } | Checks if module extensions count is the same as in activated extensions list . |
37,555 | protected function _isInDisabledList ( $ sId ) { return in_array ( $ sId , ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aDisabledModules' ) ) ; } | Checks if module is in disabled list . |
37,556 | protected function includeModuleMetaData ( $ metadataPath ) { include $ metadataPath ; if ( ! isset ( $ aModule ) ) { $ aModule = [ ] ; } $ this -> setModuleData ( $ aModule ) ; if ( isset ( $ sMetadataVersion ) ) { $ this -> setMetaDataVersion ( $ sMetadataVersion ) ; } } | Include data from metadata . php |
37,557 | protected function getUnifiedShopClassExtensionsForBc ( $ rawExtensions ) { $ extensions = [ ] ; foreach ( $ rawExtensions as $ classToBePatched => $ moduleClass ) { if ( ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ classToBePatched ) ) { $ bcMap = \ OxidEsales \ Eshop \ Core \ Registry :: getBackwardsCompatibilityClassMap ( ) ; $ classToBePatched = array_key_exists ( strtolower ( $ classToBePatched ) , $ bcMap ) ? $ bcMap [ strtolower ( $ classToBePatched ) ] : $ classToBePatched ; } $ extensions [ $ classToBePatched ] = $ moduleClass ; } return $ extensions ; } | Translate module metadata information about the patched shop classes into Unified Namespace . There might still be BC class names used in module metadata . php . |
37,558 | public function getBasketArticles ( ) { if ( $ this -> _oBasketArticles === null ) { $ this -> _oBasketArticles = false ; if ( $ oBasket = $ this -> getSession ( ) -> getBasket ( ) ) { $ this -> _oBasketArticles = $ oBasket -> getBasketArticles ( ) ; } } return $ this -> _oBasketArticles ; } | Return the current articles from the basket |
37,559 | public function getFirstBasketProduct ( ) { if ( $ this -> _oFirstBasketProduct === null ) { $ this -> _oFirstBasketProduct = false ; $ aBasketArticles = $ this -> getBasketArticles ( ) ; if ( is_array ( $ aBasketArticles ) && $ oProduct = reset ( $ aBasketArticles ) ) { $ this -> _oFirstBasketProduct = $ oProduct ; } } return $ this -> _oFirstBasketProduct ; } | return the basket articles |
37,560 | public function getBasketSimilarList ( ) { if ( $ this -> _oSimilarList === null ) { $ this -> _oSimilarList = false ; if ( $ oProduct = $ this -> getFirstBasketProduct ( ) ) { $ this -> _oSimilarList = $ oProduct -> getSimilarProducts ( ) ; } } return $ this -> _oSimilarList ; } | return the similar articles |
37,561 | public function showBackToShop ( ) { $ iNewBasketItemMessage = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNewBasketItemMessage' ) ; $ sBackToShop = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( '_backtoshop' ) ; return ( $ iNewBasketItemMessage == 3 && $ sBackToShop ) ; } | return the Link back to shop |
37,562 | protected function _setWrappingInfo ( $ oBasket , $ aWrapping ) { if ( is_array ( $ aWrapping ) && count ( $ aWrapping ) ) { foreach ( $ oBasket -> getContents ( ) as $ sKey => $ oBasketItem ) { if ( isset ( $ aWrapping [ $ sKey ] ) ) { $ oBasketItem -> setWrapping ( $ aWrapping [ $ sKey ] ) ; } } } } | Sets basket wrapping |
37,563 | public function validateFieldValue ( $ sFieldValue ) { $ blValid = true ; if ( is_array ( $ sFieldValue ) ) { $ blValid = $ this -> _validateFieldValueArray ( $ sFieldValue ) ; } else { if ( ! trim ( $ sFieldValue ) ) { $ blValid = false ; } } return $ blValid ; } | Validates field value . |
37,564 | private function _validateFieldValueArray ( $ aFieldValues ) { $ blValid = true ; foreach ( $ aFieldValues as $ sValue ) { if ( ! trim ( $ sValue ) ) { $ blValid = false ; break ; } } return $ blValid ; } | Checks if all values are filled up |
37,565 | public function getGroups ( ) { if ( $ this -> _oGroups == null && ( $ sOxid = $ this -> getId ( ) ) ) { $ this -> _oGroups = oxNew ( 'oxlist' , 'oxgroups' ) ; $ sViewName = getViewName ( "oxgroups" , $ this -> getLanguage ( ) ) ; $ sSelect = "select {$sViewName}.* from {$sViewName}, oxobject2group where oxobject2group.oxobjectid = '{$sOxid}' and oxobject2group.oxgroupsid={$sViewName}.oxid " ; $ this -> _oGroups -> selectString ( $ sSelect ) ; } return $ this -> _oGroups ; } | Payment groups getter . Returns groups list |
37,566 | public function getPaymentValue ( $ dBasePrice ) { if ( $ this -> oxpayments__oxaddsumtype -> value == "%" ) { $ dRet = $ dBasePrice * $ this -> oxpayments__oxaddsum -> value / 100 ; } else { $ oCur = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; $ dRet = $ this -> oxpayments__oxaddsum -> value * $ oCur -> rate ; } if ( ( $ dRet * - 1 ) > $ dBasePrice ) { $ dRet = $ dBasePrice ; } return $ dRet ; } | Returns additional taxes to base article price . |
37,567 | public function calculate ( $ oBasket ) { $ dPrice = $ this -> getPaymentValue ( $ this -> getBaseBasketPriceForPaymentCostCalc ( $ oBasket ) ) ; if ( ! $ dPrice ) { $ dPrice = 0 ; } $ oPrice = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; $ oPrice -> setNettoMode ( $ this -> _blPaymentVatOnTop ) ; $ oPrice -> setPrice ( $ dPrice ) ; if ( $ dPrice > 0 ) { $ oPrice -> setVat ( $ oBasket -> getAdditionalServicesVatPercent ( ) ) ; } $ this -> _oPrice = $ oPrice ; } | Returns price object for current payment applied on basket |
37,568 | public function getFNettoPrice ( ) { if ( $ this -> getPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getPrice ( ) -> getNettoPrice ( ) ) ; } } | Returns formatted netto price . |
37,569 | public function getFBruttoPrice ( ) { if ( $ this -> getPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getPrice ( ) -> getBruttoPrice ( ) ) ; } } | Returns formatted brutto price . |
37,570 | public function getFPriceVat ( ) { if ( $ this -> getPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getPrice ( ) -> getVatValue ( ) ) ; } } | Returns formatted vat value . |
37,571 | public function getCountries ( ) { if ( $ this -> _aCountries === null ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ this -> _aCountries = [ ] ; $ sSelect = 'select oxobjectid from oxobject2payment where oxpaymentid=' . $ oDb -> quote ( $ this -> getId ( ) ) . ' and oxtype = "oxcountry" ' ; $ rs = $ oDb -> getCol ( $ sSelect ) ; $ this -> _aCountries = $ rs ; } return $ this -> _aCountries ; } | Returns array of country Ids which are assigned to current payment |
37,572 | public function isValidPayment ( $ aDynValue , $ sShopId , $ oUser , $ dBasketPrice , $ sShipSetId ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ this -> oxpayments__oxid -> value == 'oxempty' ) { if ( ! $ this -> oxpayments__oxactive -> value || ! $ myConfig -> getConfigParam ( "blOtherCountryOrder" ) ) { $ this -> _iPaymentError = - 2 ; return false ; } if ( count ( \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ DeliverySetList :: class ) -> getDeliverySetList ( $ oUser , $ oUser -> getActiveCountry ( ) ) ) ) { $ this -> _iPaymentError = - 3 ; return false ; } return true ; } $ mxValidationResult = \ OxidEsales \ Eshop \ Core \ Registry :: getInputValidator ( ) -> validatePaymentInputData ( $ this -> oxpayments__oxid -> value , $ aDynValue ) ; if ( is_integer ( $ mxValidationResult ) ) { $ this -> _iPaymentError = $ mxValidationResult ; return false ; } elseif ( $ mxValidationResult === false ) { $ this -> _iPaymentError = 1 ; return false ; } $ oCur = $ myConfig -> getActShopCurrencyObject ( ) ; $ dBasketPrice = $ dBasketPrice / $ oCur -> rate ; if ( $ sShipSetId ) { $ aPaymentList = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ PaymentList :: class ) -> getPaymentList ( $ sShipSetId , $ dBasketPrice , $ oUser ) ; if ( ! array_key_exists ( $ this -> getId ( ) , $ aPaymentList ) ) { $ this -> _iPaymentError = - 3 ; return false ; } } else { $ this -> _iPaymentError = - 2 ; return false ; } return true ; } | Function checks if loaded payment is valid to current basket |
37,573 | public function assign ( $ dbRecord ) { parent :: assign ( $ dbRecord ) ; $ oUtilsDate = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) ; $ this -> oxorder__oxorderdate = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUtilsDate -> formatDBDate ( $ this -> oxorder__oxorderdate -> value ) ) ; $ this -> oxorder__oxsenddate = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUtilsDate -> formatDBDate ( $ this -> oxorder__oxsenddate -> value ) ) ; } | Assigns data stored in DB to oxorder object |
37,574 | protected function _getCountryTitle ( $ sCountryId ) { $ sTitle = null ; if ( $ sCountryId && $ sCountryId != '-1' ) { $ oCountry = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Country :: class ) ; $ oCountry -> loadInLang ( $ this -> getOrderLanguage ( ) , $ sCountryId ) ; $ sTitle = $ oCountry -> oxcountry__oxtitle -> value ; } return $ sTitle ; } | Gets country title by country id . |
37,575 | protected function _getArticles ( $ blExcludeCanceled = false ) { $ sSelect = "SELECT `oxorderarticles`.* FROM `oxorderarticles` WHERE `oxorderarticles`.`oxorderid` = '" . $ this -> getId ( ) . "'" . ( $ blExcludeCanceled ? " AND `oxorderarticles`.`oxstorno` != 1 " : " " ) . " ORDER BY `oxorderarticles`.`oxartid`, `oxorderarticles`.`oxselvariant`, `oxorderarticles`.`oxpersparam` " ; $ oArticles = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oArticles -> init ( 'oxorderarticle' ) ; $ oArticles -> selectString ( $ sSelect ) ; return $ oArticles ; } | returned assigned orderarticles from order |
37,576 | public function getOrderArticles ( $ blExcludeCanceled = false ) { if ( $ blExcludeCanceled ) { return $ this -> _getArticles ( true ) ; } elseif ( $ this -> _oArticles === null ) { $ this -> _oArticles = $ this -> _getArticles ( ) ; } return $ this -> _oArticles ; } | Assigns data stored in oxorderarticles to oxorder object . |
37,577 | public function getOrderDeliveryPrice ( ) { if ( $ this -> _oDelPrice != null ) { return $ this -> _oDelPrice ; } $ this -> _oDelPrice = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; $ this -> _oDelPrice -> setBruttoPriceMode ( ) ; $ this -> _oDelPrice -> setPrice ( $ this -> oxorder__oxdelcost -> value , $ this -> oxorder__oxdelvat -> value ) ; return $ this -> _oDelPrice ; } | Returns order delivery expenses price object |
37,578 | public function getOrderPaymentPrice ( ) { if ( $ this -> _oPaymentPrice != null ) { return $ this -> _oPaymentPrice ; } $ this -> _oPaymentPrice = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; $ this -> _oPaymentPrice -> setBruttoPriceMode ( ) ; $ this -> _oPaymentPrice -> setPrice ( $ this -> oxorder__oxpaycost -> value , $ this -> oxorder__oxpayvat -> value ) ; return $ this -> _oPaymentPrice ; } | Returns order payment expenses price object |
37,579 | protected function _setOrderStatus ( $ sStatus ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = 'update oxorder set oxtransstatus=' . $ oDb -> quote ( $ sStatus ) . ' where oxid=' . $ oDb -> quote ( $ this -> getId ( ) ) ; $ oDb -> execute ( $ sQ ) ; $ this -> oxorder__oxtransstatus = new \ OxidEsales \ Eshop \ Core \ Field ( $ sStatus , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } | Updates order transaction status . Faster than saving whole object |
37,580 | protected function _resetVats ( ) { $ this -> oxorder__oxartvat1 = new \ OxidEsales \ Eshop \ Core \ Field ( null ) ; $ this -> oxorder__oxartvatprice1 = new \ OxidEsales \ Eshop \ Core \ Field ( null ) ; $ this -> oxorder__oxartvat2 = new \ OxidEsales \ Eshop \ Core \ Field ( null ) ; $ this -> oxorder__oxartvatprice2 = new \ OxidEsales \ Eshop \ Core \ Field ( null ) ; } | Reset Vat info |
37,581 | public function getOrderLanguage ( ) { if ( $ this -> _iOrderLang === null ) { if ( isset ( $ this -> oxorder__oxlang -> value ) ) { $ this -> _iOrderLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> validateLanguage ( $ this -> oxorder__oxlang -> value ) ; } else { $ this -> _iOrderLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; } } return $ this -> _iOrderLang ; } | Returns language id of current order object . If order already has language defined - checks if this language is defined in shops config |
37,582 | protected function _setUser ( $ oUser ) { $ this -> oxorder__oxuserid = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUser -> getId ( ) ) ; $ this -> oxorder__oxbillcompany = clone $ oUser -> oxuser__oxcompany ; $ this -> oxorder__oxbillemail = clone $ oUser -> oxuser__oxusername ; $ this -> oxorder__oxbillfname = clone $ oUser -> oxuser__oxfname ; $ this -> oxorder__oxbilllname = clone $ oUser -> oxuser__oxlname ; $ this -> oxorder__oxbillstreet = clone $ oUser -> oxuser__oxstreet ; $ this -> oxorder__oxbillstreetnr = clone $ oUser -> oxuser__oxstreetnr ; $ this -> oxorder__oxbilladdinfo = clone $ oUser -> oxuser__oxaddinfo ; $ this -> oxorder__oxbillustid = clone $ oUser -> oxuser__oxustid ; $ this -> oxorder__oxbillcity = clone $ oUser -> oxuser__oxcity ; $ this -> oxorder__oxbillcountryid = clone $ oUser -> oxuser__oxcountryid ; $ this -> oxorder__oxbillstateid = clone $ oUser -> oxuser__oxstateid ; $ this -> oxorder__oxbillzip = clone $ oUser -> oxuser__oxzip ; $ this -> oxorder__oxbillfon = clone $ oUser -> oxuser__oxfon ; $ this -> oxorder__oxbillfax = clone $ oUser -> oxuser__oxfax ; $ this -> oxorder__oxbillsal = clone $ oUser -> oxuser__oxsal ; if ( ( $ oDelAdress = $ this -> getDelAddressInfo ( ) ) ) { $ this -> oxorder__oxdelcompany = clone $ oDelAdress -> oxaddress__oxcompany ; $ this -> oxorder__oxdelfname = clone $ oDelAdress -> oxaddress__oxfname ; $ this -> oxorder__oxdellname = clone $ oDelAdress -> oxaddress__oxlname ; $ this -> oxorder__oxdelstreet = clone $ oDelAdress -> oxaddress__oxstreet ; $ this -> oxorder__oxdelstreetnr = clone $ oDelAdress -> oxaddress__oxstreetnr ; $ this -> oxorder__oxdeladdinfo = clone $ oDelAdress -> oxaddress__oxaddinfo ; $ this -> oxorder__oxdelcity = clone $ oDelAdress -> oxaddress__oxcity ; $ this -> oxorder__oxdelcountryid = clone $ oDelAdress -> oxaddress__oxcountryid ; $ this -> oxorder__oxdelstateid = clone $ oDelAdress -> oxaddress__oxstateid ; $ this -> oxorder__oxdelzip = clone $ oDelAdress -> oxaddress__oxzip ; $ this -> oxorder__oxdelfon = clone $ oDelAdress -> oxaddress__oxfon ; $ this -> oxorder__oxdelfax = clone $ oDelAdress -> oxaddress__oxfax ; $ this -> oxorder__oxdelsal = clone $ oDelAdress -> oxaddress__oxsal ; } } | Assigns to new oxorder object customer delivery and shipping info |
37,583 | protected function _setWrapping ( \ OxidEsales \ Eshop \ Application \ Model \ Basket $ oBasket ) { if ( ( $ oWrappingCost = $ oBasket -> getCosts ( 'oxwrapping' ) ) ) { $ this -> oxorder__oxwrapcost = new \ OxidEsales \ Eshop \ Core \ Field ( $ oWrappingCost -> getBruttoPrice ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxorder__oxwrapvat = new \ OxidEsales \ Eshop \ Core \ Field ( $ oWrappingCost -> getVAT ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } if ( ( $ oGiftCardCost = $ oBasket -> getCosts ( 'oxgiftcard' ) ) ) { $ this -> oxorder__oxgiftcardcost = new \ OxidEsales \ Eshop \ Core \ Field ( $ oGiftCardCost -> getBruttoPrice ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxorder__oxgiftcardvat = new \ OxidEsales \ Eshop \ Core \ Field ( $ oGiftCardCost -> getVAT ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } $ this -> oxorder__oxcardid = new \ OxidEsales \ Eshop \ Core \ Field ( $ oBasket -> getCardId ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxorder__oxcardtext = new \ OxidEsales \ Eshop \ Core \ Field ( $ oBasket -> getCardMessage ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } | Assigns wrapping VAT and card price + card message info |
37,584 | protected function _setPayment ( $ sPaymentid ) { $ oPayment = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Payment :: class ) ; if ( ! $ oPayment -> load ( $ sPaymentid ) ) { return null ; } $ aDynvalue = $ this -> getDynamicValues ( ) ; $ oPayment -> setDynValues ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> assignValuesFromText ( $ oPayment -> oxpayments__oxvaldesc -> value ) ) ; $ aDynVal = [ ] ; if ( is_array ( $ aPaymentDynValues = $ oPayment -> getDynValues ( ) ) ) { foreach ( $ aPaymentDynValues as $ key => $ oVal ) { if ( isset ( $ aDynvalue [ $ oVal -> name ] ) ) { $ oVal -> value = $ aDynvalue [ $ oVal -> name ] ; } $ aPaymentDynValues [ $ key ] = $ oVal ; $ aDynVal [ $ oVal -> name ] = $ oVal -> value ; } } $ oUserpayment = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ UserPayment :: class ) ; $ oUserpayment -> oxuserpayments__oxuserid = clone $ this -> oxorder__oxuserid ; $ oUserpayment -> oxuserpayments__oxpaymentsid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sPaymentid , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ oUserpayment -> oxuserpayments__oxvalue = new \ OxidEsales \ Eshop \ Core \ Field ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> assignValuesToText ( $ aDynVal ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ oUserpayment -> oxpayments__oxdesc = clone $ oPayment -> oxpayments__oxdesc ; $ oUserpayment -> oxpayments__oxlongdesc = clone $ oPayment -> oxpayments__oxlongdesc ; $ oUserpayment -> setDynValues ( $ aPaymentDynValues ) ; $ oUserpayment -> save ( ) ; $ this -> oxorder__oxpaymentid = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUserpayment -> getId ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxorder__oxpaymenttype = clone $ oUserpayment -> oxuserpayments__oxpaymentsid ; return $ oUserpayment ; } | Creates and returns user payment . |
37,585 | protected function _setFolder ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ this -> oxorder__oxfolder = new \ OxidEsales \ Eshop \ Core \ Field ( key ( $ myConfig -> getShopConfVar ( 'aOrderfolder' , $ myConfig -> getShopId ( ) ) ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } | Assigns oxfolder as new |
37,586 | protected function _updateNoticeList ( $ aArticleList , $ oUser ) { if ( $ oUser -> getBasket ( 'noticelist' ) -> oxuserbaskets__oxid -> value === null ) { return ; } if ( $ oUserBasket = $ oUser -> getBasket ( 'noticelist' ) ) { foreach ( $ aArticleList as $ oContent ) { $ sProdId = $ oContent -> getProductId ( ) ; $ oUserBasketItem = $ oUserBasket -> getItem ( $ sProdId , $ oContent -> getSelList ( ) , $ oContent -> getPersParams ( ) ) ; $ dNewAmount = $ oUserBasketItem -> oxuserbasketitems__oxamount -> value - $ oContent -> getAmount ( ) ; if ( $ dNewAmount < 0 ) { $ dNewAmount = 0 ; } $ oUserBasket -> addItemToBasket ( $ sProdId , $ dNewAmount , $ oContent -> getSelList ( ) , true , $ oContent -> getPersParams ( ) ) ; } } } | After order is finished this method cleans up users notice list by removing bought items from users notice list |
37,587 | protected function _updateOrderDate ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sDate = date ( 'Y-m-d H:i:s' , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ) ; $ sQ = 'update oxorder set oxorderdate=' . $ oDb -> quote ( $ sDate ) . ' where oxid=' . $ oDb -> quote ( $ this -> getId ( ) ) ; $ this -> oxorder__oxorderdate = new \ OxidEsales \ Eshop \ Core \ Field ( $ sDate , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ oDb -> execute ( $ sQ ) ; } | Updates order date to current date |
37,588 | public function getDelAddressInfo ( ) { $ oDelAdress = null ; if ( ! ( $ soxAddressId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'deladrid' ) ) ) { $ soxAddressId = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'deladrid' ) ; } if ( $ soxAddressId ) { $ oDelAdress = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Address :: class ) ; $ oDelAdress -> load ( $ soxAddressId ) ; if ( $ oDelAdress -> oxaddress__oxcountryid -> value && $ oDelAdress -> oxaddress__oxcountryid -> value != - 1 ) { $ oCountry = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Country :: class ) ; $ oCountry -> load ( $ oDelAdress -> oxaddress__oxcountryid -> value ) ; $ oDelAdress -> oxaddress__oxcountry = clone $ oCountry -> oxcountry__oxtitle ; } } return $ oDelAdress ; } | Loads and returns delivery address object or null if deladrid is not configured or object was not loaded |
37,589 | public function validateStock ( $ oBasket ) { foreach ( $ oBasket -> getContents ( ) as $ key => $ oContent ) { try { $ oProd = $ oContent -> getArticle ( true , null , true ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ NoArticleException $ oEx ) { $ oBasket -> removeItem ( $ key ) ; throw $ oEx ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ ArticleInputException $ oEx ) { $ oBasket -> removeItem ( $ key ) ; throw $ oEx ; } $ dArtStockAmount = $ oBasket -> getArtStockInBasket ( $ oProd -> getId ( ) , $ key ) ; $ iOnStock = $ oProd -> checkForStock ( $ oContent -> getAmount ( ) , $ dArtStockAmount ) ; if ( $ iOnStock !== true ) { $ oEx = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ OutOfStockException :: class ) ; $ oEx -> setMessage ( 'ERROR_MESSAGE_OUTOFSTOCK_OUTOFSTOCK' ) ; $ oEx -> setArticleNr ( $ oProd -> oxarticles__oxartnum -> value ) ; $ oEx -> setProductId ( $ oProd -> getId ( ) ) ; $ oEx -> setBasketIndex ( $ key ) ; if ( ! is_numeric ( $ iOnStock ) ) { $ iOnStock = 0 ; } $ oEx -> setRemainingAmount ( $ iOnStock ) ; throw $ oEx ; } } } | Function which checks if article stock is valid . If not displays error and returns false . |
37,590 | protected function _insert ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ oUtilsDate = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) ; if ( ! $ this -> oxorder__oxorderdate || ! $ this -> oxorder__oxorderdate -> value ) { $ this -> oxorder__oxorderdate = new \ OxidEsales \ Eshop \ Core \ Field ( date ( 'Y-m-d H:i:s' , $ oUtilsDate -> getTime ( ) ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } else { $ this -> oxorder__oxorderdate = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUtilsDate -> formatDBDate ( $ this -> oxorder__oxorderdate ? $ this -> oxorder__oxorderdate -> value : null , true ) ) ; } $ this -> oxorder__oxshopid = new \ OxidEsales \ Eshop \ Core \ Field ( $ myConfig -> getShopId ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> oxorder__oxsenddate = new \ OxidEsales \ Eshop \ Core \ Field ( $ oUtilsDate -> formatDBDate ( $ this -> oxorder__oxsenddate ? $ this -> oxorder__oxsenddate -> value : null , true ) ) ; $ blInsert = parent :: _insert ( ) ; return $ blInsert ; } | Inserts order object information in DB . Returns true on success . |
37,591 | protected function _getCounterIdent ( ) { $ sCounterIdent = ( $ this -> _blSeparateNumbering ) ? 'oxOrder_' . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) : 'oxOrder' ; return $ sCounterIdent ; } | creates counter ident |
37,592 | protected function _setNumber ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ iCnt = oxNew ( \ OxidEsales \ Eshop \ Core \ Counter :: class ) -> getNext ( $ this -> _getCounterIdent ( ) ) ; $ sQ = "update oxorder set oxordernr = ? where oxid = ?" ; $ blUpdate = ( bool ) $ oDb -> execute ( $ sQ , [ $ iCnt , $ this -> getId ( ) ] ) ; if ( $ blUpdate ) { $ this -> oxorder__oxordernr = new \ OxidEsales \ Eshop \ Core \ Field ( $ iCnt ) ; } return $ blUpdate ; } | Tries to fetch and set next record number in DB . Returns true on success |
37,593 | protected function _update ( ) { $ this -> _aSkipSaveFields = [ 'oxtimestamp' , 'oxorderdate' ] ; $ this -> oxorder__oxsenddate = new \ OxidEsales \ Eshop \ Core \ Field ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> formatDBDate ( $ this -> oxorder__oxsenddate -> value , true ) ) ; return parent :: _update ( ) ; } | Updates object parameters to DB . |
37,594 | public function delete ( $ sOxId = null ) { if ( $ sOxId ) { if ( ! $ this -> load ( $ sOxId ) ) { return false ; } } elseif ( ! $ sOxId ) { $ sOxId = $ this -> getId ( ) ; } if ( ! $ sOxId ) { return false ; } $ oOrderArticles = $ this -> getOrderArticles ( false ) ; foreach ( $ oOrderArticles as $ oOrderArticle ) { $ oOrderArticle -> delete ( ) ; } if ( $ oPaymentType = $ this -> getPaymentType ( ) ) { $ oPaymentType -> delete ( ) ; } return parent :: delete ( $ sOxId ) ; } | Updates stock information deletes current ordering details from DB returns true on success . |
37,595 | protected function _getOrderBasket ( $ blStockCheck = true ) { $ this -> _oOrderBasket = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Basket :: class ) ; $ this -> _oOrderBasket -> enableSaveToDataBase ( false ) ; $ this -> _oOrderBasket -> setCalculationModeNetto ( $ this -> isNettoMode ( ) ) ; $ this -> _oOrderBasket -> setStockCheckMode ( $ blStockCheck ) ; $ this -> _oOrderBasket -> setBasketUser ( $ this -> getOrderUser ( ) ) ; $ this -> _oOrderBasket -> setOrderId ( $ this -> getId ( ) ) ; $ aCurrencies = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getCurrencyArray ( ) ; foreach ( $ aCurrencies as $ oCur ) { if ( $ oCur -> name == $ this -> oxorder__oxcurrency -> value ) { $ oBasketCur = $ oCur ; break ; } } $ this -> _oOrderBasket -> setBasketCurrency ( $ oBasketCur ) ; $ this -> _oOrderBasket -> setCardId ( $ this -> oxorder__oxcardid -> value ) ; $ this -> _oOrderBasket -> setCardMessage ( $ this -> oxorder__oxcardtext -> value ) ; if ( $ this -> _blReloadDiscount ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ this -> _oOrderBasket -> setSkipVouchersChecking ( true ) ; $ sQ = 'select oxid from oxvouchers where oxorderid = ' . $ oDb -> quote ( $ this -> getId ( ) ) ; $ aVouchers = $ oDb -> getAll ( $ sQ ) ; foreach ( $ aVouchers as $ aVoucher ) { $ this -> _oOrderBasket -> addVoucher ( $ aVoucher [ 'oxid' ] ) ; } } else { $ this -> _oOrderBasket -> setDiscountCalcMode ( false ) ; $ this -> _oOrderBasket -> setVoucherDiscount ( $ this -> oxorder__oxvoucherdiscount -> value ) ; $ this -> _oOrderBasket -> setTotalDiscount ( $ this -> oxorder__oxdiscount -> value ) ; } if ( ! $ this -> _blReloadDelivery ) { $ this -> _oOrderBasket -> setDeliveryPrice ( $ this -> getOrderDeliveryPrice ( ) ) ; } else { $ this -> _oOrderBasket -> setShipping ( $ this -> oxorder__oxdeltype -> value ) ; $ this -> _oOrderBasket -> setDeliveryPrice ( null ) ; } $ this -> _oOrderBasket -> setPayment ( $ this -> oxorder__oxpaymenttype -> value ) ; return $ this -> _oOrderBasket ; } | Returns basket object filled up with discount delivery wrapping and all other info |
37,596 | public function getOrderUser ( ) { if ( $ this -> _oUser === null ) { $ this -> _oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; $ this -> _oUser -> load ( $ this -> oxorder__oxuserid -> value ) ; if ( $ this -> _isLoaded ) { $ this -> _oUser -> oxuser__oxcompany = clone $ this -> oxorder__oxbillcompany ; $ this -> _oUser -> oxuser__oxusername = clone $ this -> oxorder__oxbillemail ; $ this -> _oUser -> oxuser__oxfname = clone $ this -> oxorder__oxbillfname ; $ this -> _oUser -> oxuser__oxlname = clone $ this -> oxorder__oxbilllname ; $ this -> _oUser -> oxuser__oxstreet = clone $ this -> oxorder__oxbillstreet ; $ this -> _oUser -> oxuser__oxstreetnr = clone $ this -> oxorder__oxbillstreetnr ; $ this -> _oUser -> oxuser__oxaddinfo = clone $ this -> oxorder__oxbilladdinfo ; $ this -> _oUser -> oxuser__oxustid = clone $ this -> oxorder__oxbillustid ; $ this -> _oUser -> oxuser__oxcity = clone $ this -> oxorder__oxbillcity ; $ this -> _oUser -> oxuser__oxcountryid = clone $ this -> oxorder__oxbillcountryid ; $ this -> _oUser -> oxuser__oxstateid = clone $ this -> oxorder__oxbillstateid ; $ this -> _oUser -> oxuser__oxzip = clone $ this -> oxorder__oxbillzip ; $ this -> _oUser -> oxuser__oxfon = clone $ this -> oxorder__oxbillfon ; $ this -> _oUser -> oxuser__oxfax = clone $ this -> oxorder__oxbillfax ; $ this -> _oUser -> oxuser__oxsal = clone $ this -> oxorder__oxbillsal ; } } return $ this -> _oUser ; } | Returns current order user object |
37,597 | public function getInvoiceNum ( ) { $ sQ = 'select max(oxorder.oxinvoicenr) from oxorder where oxorder.oxshopid = "' . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . '" ' ; return ( ( int ) \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOne ( $ sQ , false ) + 1 ) ; } | Returns order invoice number . |
37,598 | public function getShippingSetList ( ) { if ( ! ( $ sShipId = $ this -> oxorder__oxdelcountryid -> value ) ) { $ sShipId = $ this -> oxorder__oxbillcountryid -> value ; } $ oBasket = $ this -> _getOrderBasket ( false ) ; $ oOrderArticles = $ this -> getOrderArticles ( ) ; foreach ( $ oOrderArticles as $ sItemId => $ oItem ) { if ( $ oItem -> isBundle ( ) ) { $ oOrderArticles -> offsetUnset ( $ sItemId ) ; } } $ this -> _addOrderArticlesToBasket ( $ oBasket , $ oOrderArticles ) ; $ oBasket -> calculateBasket ( true ) ; $ oDeliveryList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ DeliveryList :: class , "core" ) ; $ oDeliveryList -> setCollectFittingDeliveriesSets ( true ) ; return $ oDeliveryList -> getDeliveryList ( $ oBasket , $ this -> getOrderUser ( ) , $ sShipId ) ; } | Loads possible shipping sets for this order |
37,599 | public function getVoucherNrList ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ aVouchers = [ ] ; $ sSelect = "select oxvouchernr from oxvouchers where oxorderid = " . $ oDb -> quote ( $ this -> oxorder__oxid -> value ) ; $ rs = $ oDb -> select ( $ sSelect ) ; if ( $ rs != false && $ rs -> count ( ) > 0 ) { while ( ! $ rs -> EOF ) { $ aVouchers [ ] = $ rs -> fields [ 'oxvouchernr' ] ; $ rs -> fetchRow ( ) ; } } return $ aVouchers ; } | Get vouchers numbers list which were used with this order |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.