Difference between revisions of "VbzCart/v1/class/vcCartDataManager/CaptureShippingPage"
< VbzCart | v1/class | vcCartDataManager
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{page/code/class/method}} | {{page/code/class/method}} | ||
− | * {{l/version| | + | ==Call Chains== |
− | ** {{l/version| | + | * {{l/version/method|vcPageContent_ckout|CapturePage}}() [protected] calls... |
− | *** {{hilite| | + | ** {{l/version/method|vcPageContent_ckout|CaptureShipping}}() [protected], which calls... |
− | **** $this->GetFormObject()->Receive($_POST) | + | *** {{l/version/method|vcCartDataManager|GetBuyerObject}}() |
− | + | *** {{l/version/method|vcCartDataManager|GetRecipObject}}() | |
− | + | *** {{hilite|{{l/version/method|vcCartDataManager|CaptureShippingPage}}() [public]}}, which calls... | |
+ | **** {{l/version/method|vcCartDataManager|GetFormObject}}()->Receive($_POST) | ||
+ | **** {{l/version/method|vcCartData_Buyer|CaptureContact}}($arStat); // email/phone | ||
+ | **** {{l/version/method|vcCartData_Recip|CaptureShipping}}($arStat); // shipping address / instructions | ||
+ | **** {{l/version/method|vcCartDataManager|UpdateBlob}}() (x2) | ||
+ | **** {{l/version/method|vcCartDataManager|StoreBlob}}() | ||
+ | **** {{l/version/method|vcCartDataManager|GetCartRecord}}() | ||
+ | ==Code== | ||
+ | <source lang=php> | ||
+ | public function CaptureShippingPage(array $arStat) { | ||
+ | //echo 'GOT TO CaptureShippingPage()<br>'; | ||
+ | //$oCDMgr = $this->FieldsManager(); | ||
+ | $oCDMgr = $this; | ||
+ | $oCDMgr->FetchBlob(); | ||
+ | |||
+ | $oCD_Buyer = $oCDMgr->GetBuyerObject(); | ||
+ | $oCD_Recip = $oCDMgr->GetRecipObject(); | ||
+ | |||
+ | //$arStat = $this->GetFormObject()->Receive($_POST); | ||
+ | $oFormStat = $this->GetFormObject()->Receive($_POST); | ||
+ | |||
+ | // 2019-04-13 TODO these probably need to pass $oFormStat instead | ||
+ | $oCD_Buyer->CaptureContact($arStat); // email/phone | ||
+ | $oCD_Recip->CaptureShipping($arStat); // shipping address / instructions | ||
+ | |||
+ | $this->AddMissing($oCD_Buyer->GetMissingArray()); | ||
+ | $this->AddMissing($oCD_Recip->GetMissingArray()); | ||
+ | |||
+ | // calculate resulting blob | ||
+ | //echo 'BLOB AFTER FETCH: '.$oCDMgr->RenderBlob(); | ||
+ | //echo 'UPDATING BUYER -> BLOB<br>'; | ||
+ | $oCDMgr->UpdateBlob($oCD_Buyer); | ||
+ | //echo 'UPDATING RECIP -> BLOB<br>'; | ||
+ | $oCDMgr->UpdateBlob($oCD_Recip); | ||
+ | //echo 'STORING BLOB<br>'; | ||
+ | $oCDMgr->StoreBlob(); | ||
+ | //echo 'SHIPPING VALUES:'.fcArray::Render($this->Values()); | ||
+ | //echo 'SHIPPING UPDATE ARRAY:'.fcArray::Render($this->UpdateArray()); | ||
+ | |||
+ | $rcCart = $this->GetCartRecord(); | ||
+ | $rcCart->Save(); | ||
+ | //echo 'SHIPPING SAVE SQL: ['.$this->sqlExec.']<br>'; | ||
+ | //die(); | ||
+ | } | ||
+ | </source> |
Latest revision as of 21:52, 21 April 2019
Call Chains
- vcPageContent_ckout::CapturePage() [protected] calls...
- vcPageContent_ckout::CaptureShipping() [protected], which calls...
- vcCartDataManager::GetBuyerObject()
- vcCartDataManager::GetRecipObject()
- vcCartDataManager::CaptureShippingPage() [public], which calls...
- vcCartDataManager::GetFormObject()->Receive($_POST)
- vcCartData_Buyer::CaptureContact($arStat); // email/phone
- vcCartData_Recip::CaptureShipping($arStat); // shipping address / instructions
- vcCartDataManager::UpdateBlob() (x2)
- vcCartDataManager::StoreBlob()
- vcCartDataManager::GetCartRecord()
- vcPageContent_ckout::CaptureShipping() [protected], which calls...
Code
public function CaptureShippingPage(array $arStat) {
//echo 'GOT TO CaptureShippingPage()<br>';
//$oCDMgr = $this->FieldsManager();
$oCDMgr = $this;
$oCDMgr->FetchBlob();
$oCD_Buyer = $oCDMgr->GetBuyerObject();
$oCD_Recip = $oCDMgr->GetRecipObject();
//$arStat = $this->GetFormObject()->Receive($_POST);
$oFormStat = $this->GetFormObject()->Receive($_POST);
// 2019-04-13 TODO these probably need to pass $oFormStat instead
$oCD_Buyer->CaptureContact($arStat); // email/phone
$oCD_Recip->CaptureShipping($arStat); // shipping address / instructions
$this->AddMissing($oCD_Buyer->GetMissingArray());
$this->AddMissing($oCD_Recip->GetMissingArray());
// calculate resulting blob
//echo 'BLOB AFTER FETCH: '.$oCDMgr->RenderBlob();
//echo 'UPDATING BUYER -> BLOB<br>';
$oCDMgr->UpdateBlob($oCD_Buyer);
//echo 'UPDATING RECIP -> BLOB<br>';
$oCDMgr->UpdateBlob($oCD_Recip);
//echo 'STORING BLOB<br>';
$oCDMgr->StoreBlob();
//echo 'SHIPPING VALUES:'.fcArray::Render($this->Values());
//echo 'SHIPPING UPDATE ARRAY:'.fcArray::Render($this->UpdateArray());
$rcCart = $this->GetCartRecord();
$rcCart->Save();
//echo 'SHIPPING SAVE SQL: ['.$this->sqlExec.']<br>';
//die();
}